user_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 1
value | submission_id_v0 stringlengths 10 10 | submission_id_v1 stringlengths 10 10 | cpu_time_v0 int64 10 38.3k | cpu_time_v1 int64 0 24.7k | memory_v0 int64 2.57k 1.02M | memory_v1 int64 2.57k 869k | status_v0 stringclasses 1
value | status_v1 stringclasses 1
value | improvement_frac float64 7.51 100 | input stringlengths 20 4.55k | target stringlengths 17 3.34k | code_v0_loc int64 1 148 | code_v1_loc int64 1 184 | code_v0_num_chars int64 13 4.55k | code_v1_num_chars int64 14 3.34k | code_v0_no_empty_lines stringlengths 21 6.88k | code_v1_no_empty_lines stringlengths 20 4.93k | code_same bool 1
class | relative_loc_diff_percent float64 0 79.8 | diff list | diff_only_import_comment bool 1
class | measured_runtime_v0 float64 0.01 4.45 | measured_runtime_v1 float64 0.01 4.31 | runtime_lift float64 0 359 | key list |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
u744920373 | p03353 | python | s593481531 | s061089557 | 45 | 41 | 4,596 | 5,340 | Accepted | Accepted | 8.89 | import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return list(map(int, sys.stdin.readline().split()))
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for _ in range(N)]
def dp2(ini, i, j): ret... | import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return list(map(int, sys.stdin.readline().split()))
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for _ in range(N)]
def dp2(ini, i, j): ret... | 31 | 39 | 970 | 1,102 | import sys
sys.setrecursionlimit(10**8)
def ii():
return int(sys.stdin.readline())
def mi():
return list(map(int, sys.stdin.readline().split()))
def li():
return list(map(int, sys.stdin.readline().split()))
def li2(N):
return [list(map(int, sys.stdin.readline().split())) for _ in range(N)]
de... | import sys
sys.setrecursionlimit(10**8)
def ii():
return int(sys.stdin.readline())
def mi():
return list(map(int, sys.stdin.readline().split()))
def li():
return list(map(int, sys.stdin.readline().split()))
def li2(N):
return [list(map(int, sys.stdin.readline().split())) for _ in range(N)]
de... | false | 20.512821 | [
"-alphabets = list(\"abcdefghijklmnopqrstuvwxyz\")",
"+\"\"\"",
"+alphabets = list('abcdefghijklmnopqrstuvwxyz')",
"- for j in range(1, min(K + 1, N - i + 1)):",
"- l.append(S[i : i + j])",
"- # print(set(l))",
"+ for j in range(1, min(K+1, N-i+1)):",
"+ ... | false | 0.035996 | 0.037107 | 0.970065 | [
"s593481531",
"s061089557"
] |
u057109575 | p03148 | python | s603203648 | s342706928 | 893 | 484 | 85,208 | 103,596 | Accepted | Accepted | 45.8 | from heapq import heappop, heappush
from collections import defaultdict
N, K = list(map(int, input().split()))
X = [list(map(int, input().split())) for _ in range(N)]
# Step 1: Choose greedy
X.sort(key=lambda x: -x[1])
pq = []
chosen = defaultdict(int)
cnt = 0
score = 0
for t, d in X[:K]:
heappush(pq... |
from collections import defaultdict
from heapq import heappop, heappush
N, K = list(map(int, input().split()))
X = [list(map(int, input().split())) for _ in range(N)]
X.sort(key=lambda x: x[1])
pq = []
f_x = 0
ctr = defaultdict(int)
appeared = 0
for _ in range(K):
t, d = X.pop()
heappush(pq, (d... | 43 | 42 | 857 | 865 | from heapq import heappop, heappush
from collections import defaultdict
N, K = list(map(int, input().split()))
X = [list(map(int, input().split())) for _ in range(N)]
# Step 1: Choose greedy
X.sort(key=lambda x: -x[1])
pq = []
chosen = defaultdict(int)
cnt = 0
score = 0
for t, d in X[:K]:
heappush(pq, (d, t))
... | from collections import defaultdict
from heapq import heappop, heappush
N, K = list(map(int, input().split()))
X = [list(map(int, input().split())) for _ in range(N)]
X.sort(key=lambda x: x[1])
pq = []
f_x = 0
ctr = defaultdict(int)
appeared = 0
for _ in range(K):
t, d = X.pop()
heappush(pq, (d, t))
appear... | false | 2.325581 | [
"+from collections import defaultdict",
"-from collections import defaultdict",
"-# Step 1: Choose greedy",
"-X.sort(key=lambda x: -x[1])",
"+X.sort(key=lambda x: x[1])",
"-chosen = defaultdict(int)",
"-cnt = 0",
"-score = 0",
"-for t, d in X[:K]:",
"+f_x = 0",
"+ctr = defaultdict(int)",
"+app... | false | 0.054092 | 0.03711 | 1.457598 | [
"s603203648",
"s342706928"
] |
u287132915 | p02755 | python | s136365113 | s908130544 | 22 | 20 | 3,068 | 3,188 | Accepted | Accepted | 9.09 | import math
a, b = list(map(int, input().split()))
saitei = math.ceil(a/0.08)
for i in range(10000):
if int((saitei+i)*0.1) == b and int((saitei+i)*0.08) == a:
print((saitei+i))
exit()
print((-1)) | import math
a, b = list(map(int, input().split()))
mini_8 = a / 0.08
maxi_8 = mini_8 + 12.5
mini_8 = math.ceil(mini_8)
if maxi_8 - int(maxi_8) == 0:
maxi_8 = int(maxi_8 - 1)
else:
maxi_8 = int(maxi_8)
mini_10 = b / 0.1
maxi_10 = mini_10 + 9
for i in range(mini_8, maxi_8+1):
if mini_10 <= i... | 12 | 19 | 221 | 377 | import math
a, b = list(map(int, input().split()))
saitei = math.ceil(a / 0.08)
for i in range(10000):
if int((saitei + i) * 0.1) == b and int((saitei + i) * 0.08) == a:
print((saitei + i))
exit()
print((-1))
| import math
a, b = list(map(int, input().split()))
mini_8 = a / 0.08
maxi_8 = mini_8 + 12.5
mini_8 = math.ceil(mini_8)
if maxi_8 - int(maxi_8) == 0:
maxi_8 = int(maxi_8 - 1)
else:
maxi_8 = int(maxi_8)
mini_10 = b / 0.1
maxi_10 = mini_10 + 9
for i in range(mini_8, maxi_8 + 1):
if mini_10 <= i and i <= maxi_... | false | 36.842105 | [
"-saitei = math.ceil(a / 0.08)",
"-for i in range(10000):",
"- if int((saitei + i) * 0.1) == b and int((saitei + i) * 0.08) == a:",
"- print((saitei + i))",
"+mini_8 = a / 0.08",
"+maxi_8 = mini_8 + 12.5",
"+mini_8 = math.ceil(mini_8)",
"+if maxi_8 - int(maxi_8) == 0:",
"+ maxi_8 = int(... | false | 0.081726 | 0.049412 | 1.653988 | [
"s136365113",
"s908130544"
] |
u496449946 | p02571 | python | s381522889 | s766176667 | 68 | 60 | 9,148 | 9,048 | Accepted | Accepted | 11.76 | S, T = [eval(input()) for x in range(2)]
max_match_len = 0
for i in range(len(S)):
if len(S) - len(T) < i:
break
compare_s = S[i:i+len(T)]
match_len = 0
for j in range(len(T)):
if compare_s[j] == T[j]:
match_len += 1
else:
if max_match_len < match_len:
max_match_len = mat... |
S, T = [eval(input()) for x in range(2)]
lenT = len(T)
max_match_len = 0
for i in range(len(S)-lenT+1):
compareS = S[i:i+lenT]
match_len = 0
for j in range(lenT):
if compareS[j] == T[j]:
match_len += 1
else:
if max_match_len < match_len:
max_match_len = match_len
print((lenT ... | 15 | 15 | 351 | 330 | S, T = [eval(input()) for x in range(2)]
max_match_len = 0
for i in range(len(S)):
if len(S) - len(T) < i:
break
compare_s = S[i : i + len(T)]
match_len = 0
for j in range(len(T)):
if compare_s[j] == T[j]:
match_len += 1
else:
if max_match_len < match_len:
... | S, T = [eval(input()) for x in range(2)]
lenT = len(T)
max_match_len = 0
for i in range(len(S) - lenT + 1):
compareS = S[i : i + lenT]
match_len = 0
for j in range(lenT):
if compareS[j] == T[j]:
match_len += 1
else:
if max_match_len < match_len:
max_match_len = ma... | false | 0 | [
"+lenT = len(T)",
"-for i in range(len(S)):",
"- if len(S) - len(T) < i:",
"- break",
"- compare_s = S[i : i + len(T)]",
"+for i in range(len(S) - lenT + 1):",
"+ compareS = S[i : i + lenT]",
"- for j in range(len(T)):",
"- if compare_s[j] == T[j]:",
"+ for j in range(... | false | 0.037516 | 0.044211 | 0.848559 | [
"s381522889",
"s766176667"
] |
u201928947 | p02599 | python | s236298974 | s430959911 | 773 | 706 | 159,596 | 159,708 | Accepted | Accepted | 8.67 | import sys
input = sys.stdin.buffer.readline
N,Q = list(map(int,input().split()))
BIT = [0]*(N+1)
def BIT_query(idx):
res_sum = 0
while idx > 0:
res_sum += BIT[idx]
idx -= idx&(-idx)
return res_sum
def BIT_update(idx,x):
while idx <= N:
BIT[idx] += x
id... | import sys
input = sys.stdin.buffer.readline
N,Q = list(map(int,input().split()))
BIT = [0]*(N+1)
def BIT_query(idx):
res_sum = 0
while idx > 0:
res_sum += BIT[idx]
idx -= idx&(-idx)
return res_sum
def BIT_update(idx,x):
while idx <= N:
BIT[idx] += x
idx ... | 46 | 45 | 998 | 991 | import sys
input = sys.stdin.buffer.readline
N, Q = list(map(int, input().split()))
BIT = [0] * (N + 1)
def BIT_query(idx):
res_sum = 0
while idx > 0:
res_sum += BIT[idx]
idx -= idx & (-idx)
return res_sum
def BIT_update(idx, x):
while idx <= N:
BIT[idx] += x
idx += ... | import sys
input = sys.stdin.buffer.readline
N, Q = list(map(int, input().split()))
BIT = [0] * (N + 1)
def BIT_query(idx):
res_sum = 0
while idx > 0:
res_sum += BIT[idx]
idx -= idx & (-idx)
return res_sum
def BIT_update(idx, x):
while idx <= N:
BIT[idx] += x
idx += ... | false | 2.173913 | [
"-c = [0] + list(map(int, input().split()))",
"+c = [-1] + list(map(int, input().split()))",
"- color = c[curR]",
"- last = lastAppeared[color]",
"+ new = c[curR]",
"+ last = lastAppeared[new]",
"- lastAppeared[color] = curR",
"+ lastAppeared[new] = curR"
] | false | 0.043461 | 0.044729 | 0.971635 | [
"s236298974",
"s430959911"
] |
u122428774 | p02707 | python | s248489088 | s676637216 | 206 | 165 | 122,004 | 106,296 | Accepted | Accepted | 19.9 | N = int(eval(input()))
from collections import Counter as C
l = dict(C((int(x) for x in input().split())))
for x in range(1,N+1):
print((l.get(x,0))) | n = int(eval(input()))
al = [int(x) - 1 for x in input().split()]
a = []
count = 0
for _ in [0] * n:
a.append(0)
for x in al:
a[x] += 1
count += 1
for x in a:
print(x) | 5 | 11 | 149 | 192 | N = int(eval(input()))
from collections import Counter as C
l = dict(C((int(x) for x in input().split())))
for x in range(1, N + 1):
print((l.get(x, 0)))
| n = int(eval(input()))
al = [int(x) - 1 for x in input().split()]
a = []
count = 0
for _ in [0] * n:
a.append(0)
for x in al:
a[x] += 1
count += 1
for x in a:
print(x)
| false | 54.545455 | [
"-N = int(eval(input()))",
"-from collections import Counter as C",
"-",
"-l = dict(C((int(x) for x in input().split())))",
"-for x in range(1, N + 1):",
"- print((l.get(x, 0)))",
"+n = int(eval(input()))",
"+al = [int(x) - 1 for x in input().split()]",
"+a = []",
"+count = 0",
"+for _ in [0]... | false | 0.050118 | 0.049907 | 1.004226 | [
"s248489088",
"s676637216"
] |
u923279197 | p02844 | python | s347018229 | s839006098 | 483 | 21 | 44,012 | 3,064 | Accepted | Accepted | 95.65 | from collections import defaultdict
n = int(eval(input()))
S = list(eval(input()))
d = [defaultdict(int) for i in range(3)]
for s in S:
for x in d[1]:
d[2][x+s]+=1
for x in d[0]:
d[1][x+s]+=1
d[0][s]+=1
print((len(d[2]))) | n = int(eval(input()))
S = eval(input())
ans = 0
for i in range(10):
a = S.find(str(i))
if a != -1:
for j in range(10):
b = S[a+1:].find(str(j))
if b != -1:
for k in range(10):
c = S[a+1:][b+1:].find(str(k))
if c!... | 12 | 16 | 247 | 403 | from collections import defaultdict
n = int(eval(input()))
S = list(eval(input()))
d = [defaultdict(int) for i in range(3)]
for s in S:
for x in d[1]:
d[2][x + s] += 1
for x in d[0]:
d[1][x + s] += 1
d[0][s] += 1
print((len(d[2])))
| n = int(eval(input()))
S = eval(input())
ans = 0
for i in range(10):
a = S.find(str(i))
if a != -1:
for j in range(10):
b = S[a + 1 :].find(str(j))
if b != -1:
for k in range(10):
c = S[a + 1 :][b + 1 :].find(str(k))
if c !=... | false | 25 | [
"-from collections import defaultdict",
"-",
"-S = list(eval(input()))",
"-d = [defaultdict(int) for i in range(3)]",
"-for s in S:",
"- for x in d[1]:",
"- d[2][x + s] += 1",
"- for x in d[0]:",
"- d[1][x + s] += 1",
"- d[0][s] += 1",
"-print((len(d[2])))",
"+S = eval(i... | false | 0.045816 | 0.006994 | 6.550794 | [
"s347018229",
"s839006098"
] |
u062484507 | p02683 | python | s267421839 | s105947641 | 415 | 78 | 27,108 | 9,276 | Accepted | Accepted | 81.2 | import numpy as np
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
n, m, x = list(map(int, readline().split()))
c = [list(map(int, readline().split())) for _ in range(n)]
ans = float('inf')
# bit全探索
for i in range(2 ** n):
bag = np.em... | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
n, m, x = list(map(int, readline().split()))
c = [list(map(int, readline().split())) for _ in range(n)]
ans = float('inf')
# bit全探索
for i in range(2 ** n):
bag = [0]*(m+1)
for j in r... | 21 | 19 | 559 | 538 | import numpy as np
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
n, m, x = list(map(int, readline().split()))
c = [list(map(int, readline().split())) for _ in range(n)]
ans = float("inf")
# bit全探索
for i in range(2**n):
bag = np.empty(m + 1)
... | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
n, m, x = list(map(int, readline().split()))
c = [list(map(int, readline().split())) for _ in range(n)]
ans = float("inf")
# bit全探索
for i in range(2**n):
bag = [0] * (m + 1)
for j in range(n):
... | false | 9.52381 | [
"-import numpy as np",
"- bag = np.empty(m + 1)",
"- total = 0",
"+ bag = [0] * (m + 1)",
"- bag += np.array(c[j])",
"- if np.amin(bag[1::]) >= x:",
"+ bag = [x + y for (x, y) in zip(bag, c[j])]",
"+ if min(bag[1::]) >= x:"
] | false | 0.183811 | 0.068565 | 2.680846 | [
"s267421839",
"s105947641"
] |
u644972721 | p03044 | python | s307095630 | s065559331 | 861 | 641 | 43,084 | 45,944 | Accepted | Accepted | 25.55 | from collections import deque
def bfs(i):
q = deque()
q.append(i)
c[i] = 1
while q:
p = q.popleft()
f = G[p]
z = W[p]
for j in range(len(f)):
if c[f[j]] == 0:
q.append(f[j])
c[f[j]] = 1
d[f[j]] = d... | from collections import deque
def bfs(s):
global color
q = deque()
q.append(s)
color[s] = 0
while q:
i = q.popleft()
for g in G[i]:
if color[g[0]] == -1:
if g[1] % 2 == 0:
color[g[0]] = color[i]
else:
... | 31 | 28 | 652 | 653 | from collections import deque
def bfs(i):
q = deque()
q.append(i)
c[i] = 1
while q:
p = q.popleft()
f = G[p]
z = W[p]
for j in range(len(f)):
if c[f[j]] == 0:
q.append(f[j])
c[f[j]] = 1
d[f[j]] = d[p] + z[j]
... | from collections import deque
def bfs(s):
global color
q = deque()
q.append(s)
color[s] = 0
while q:
i = q.popleft()
for g in G[i]:
if color[g[0]] == -1:
if g[1] % 2 == 0:
color[g[0]] = color[i]
else:
... | false | 9.677419 | [
"-def bfs(i):",
"+def bfs(s):",
"+ global color",
"- q.append(i)",
"- c[i] = 1",
"+ q.append(s)",
"+ color[s] = 0",
"- p = q.popleft()",
"- f = G[p]",
"- z = W[p]",
"- for j in range(len(f)):",
"- if c[f[j]] == 0:",
"- q.ap... | false | 0.073355 | 0.07499 | 0.978194 | [
"s307095630",
"s065559331"
] |
u627803856 | p02597 | python | s448900710 | s247375116 | 84 | 77 | 82,688 | 73,408 | Accepted | Accepted | 8.33 | n = int(eval(input()))
c = list(eval(input()))
left, right = 0, n - 1
cnt = 0
while True:
while left < n and c[left] == 'R':
left += 1
while right >= 0 and c[right] == 'W':
right -= 1
if left >= right:
break
cnt += 1
left, right = left + 1, right - 1
prin... | n = int(eval(input()))
c = eval(input())
left, right = 0, n - 1
cnt = 0
while left <= right:
while left < n and c[left] == 'R':
left += 1
while right > -1 and c[right] == 'W':
right -= 1
if left == n or right == -1 or left >= right: break
left += 1
right -= 1
cnt += 1... | 16 | 14 | 314 | 320 | n = int(eval(input()))
c = list(eval(input()))
left, right = 0, n - 1
cnt = 0
while True:
while left < n and c[left] == "R":
left += 1
while right >= 0 and c[right] == "W":
right -= 1
if left >= right:
break
cnt += 1
left, right = left + 1, right - 1
print(cnt)
| n = int(eval(input()))
c = eval(input())
left, right = 0, n - 1
cnt = 0
while left <= right:
while left < n and c[left] == "R":
left += 1
while right > -1 and c[right] == "W":
right -= 1
if left == n or right == -1 or left >= right:
break
left += 1
right -= 1
cnt += 1
pri... | false | 12.5 | [
"-c = list(eval(input()))",
"+c = eval(input())",
"-while True:",
"+while left <= right:",
"- while right >= 0 and c[right] == \"W\":",
"+ while right > -1 and c[right] == \"W\":",
"- if left >= right:",
"+ if left == n or right == -1 or left >= right:",
"+ left += 1",
"+ right -... | false | 0.038946 | 0.038686 | 1.006736 | [
"s448900710",
"s247375116"
] |
u271469978 | p02953 | python | s214788986 | s718750943 | 74 | 67 | 20,432 | 20,664 | Accepted | Accepted | 9.46 | N = int(eval(input()))
hhh = list(map(int, input().split()))
flag = True
for i in range(N - 1):
if hhh[i] < hhh[i + 1]:
flag = True
elif hhh[i] == hhh[i + 1]:
pass
elif (hhh[i] == hhh[i + 1] + 1) and flag:
flag = False
else:
print('No')
exit()
print('... | N = int(eval(input()))
hhh = list(map(int, input().split()))
for i in range(N - 2, -1, -1):
if hhh[i] <= hhh[i + 1]:
pass
elif hhh[i] - hhh[i + 1] == 1:
hhh[i] -= 1
else:
print('No')
exit()
print('Yes')
| 14 | 11 | 320 | 251 | N = int(eval(input()))
hhh = list(map(int, input().split()))
flag = True
for i in range(N - 1):
if hhh[i] < hhh[i + 1]:
flag = True
elif hhh[i] == hhh[i + 1]:
pass
elif (hhh[i] == hhh[i + 1] + 1) and flag:
flag = False
else:
print("No")
exit()
print("Yes")
| N = int(eval(input()))
hhh = list(map(int, input().split()))
for i in range(N - 2, -1, -1):
if hhh[i] <= hhh[i + 1]:
pass
elif hhh[i] - hhh[i + 1] == 1:
hhh[i] -= 1
else:
print("No")
exit()
print("Yes")
| false | 21.428571 | [
"-flag = True",
"-for i in range(N - 1):",
"- if hhh[i] < hhh[i + 1]:",
"- flag = True",
"- elif hhh[i] == hhh[i + 1]:",
"+for i in range(N - 2, -1, -1):",
"+ if hhh[i] <= hhh[i + 1]:",
"- elif (hhh[i] == hhh[i + 1] + 1) and flag:",
"- flag = False",
"+ elif hhh[i] - h... | false | 0.105195 | 0.049613 | 2.120283 | [
"s214788986",
"s718750943"
] |
u037430802 | p03599 | python | s021124130 | s087353283 | 85 | 36 | 3,188 | 5,048 | Accepted | Accepted | 57.65 |
A,B,C,D,E,F = list(map(int, input().split()))
# 作りうる水の量を洗い出す
waters = set()
for i in range(F//(100*A) + 1):
for j in range((F-100*A*i)//(100*B) + 1):
w = 100*A*i + 100*B*j
if w != 0:
waters.add(w)
waters = list(waters)
waters.sort()
sugars = set()
# Cを何回入れるか
for... | from fractions import Fraction
from collections import deque
import math
A,B,C,D,E,F = list(map(int, input().split()))
# 作りうる水の量を洗い出す
waters = set()
waters.add(100*A)
if 200*B <= F:
waters.add(200*B)
q = deque([100*A, 200*B])
while q:
w = q.popleft()
# 容器に入れられる量より多いならパス
if w > F: cont... | 54 | 51 | 866 | 1,100 | A, B, C, D, E, F = list(map(int, input().split()))
# 作りうる水の量を洗い出す
waters = set()
for i in range(F // (100 * A) + 1):
for j in range((F - 100 * A * i) // (100 * B) + 1):
w = 100 * A * i + 100 * B * j
if w != 0:
waters.add(w)
waters = list(waters)
waters.sort()
sugars = set()
# Cを何回入れるか
fo... | from fractions import Fraction
from collections import deque
import math
A, B, C, D, E, F = list(map(int, input().split()))
# 作りうる水の量を洗い出す
waters = set()
waters.add(100 * A)
if 200 * B <= F:
waters.add(200 * B)
q = deque([100 * A, 200 * B])
while q:
w = q.popleft()
# 容器に入れられる量より多いならパス
if w > F:
... | false | 5.555556 | [
"+from fractions import Fraction",
"+from collections import deque",
"+import math",
"+",
"-for i in range(F // (100 * A) + 1):",
"- for j in range((F - 100 * A * i) // (100 * B) + 1):",
"- w = 100 * A * i + 100 * B * j",
"- if w != 0:",
"- waters.add(w)",
"+waters.add(... | false | 0.077099 | 0.05823 | 1.324049 | [
"s021124130",
"s087353283"
] |
u562935282 | p03575 | python | s175147218 | s257228345 | 32 | 23 | 3,064 | 3,316 | Accepted | Accepted | 28.12 | '''
ABC 075
https://www.youtube.com/watch?v=VJntQuR2zNI
'''
def inpl(): return input().split()
def arr(r, c): return [[False for x in range(c)] for y in range(r)]
def dfs(x):
if vis[x]:
return
else:
vis[x] = True
for i in range(n):
if graph[x][i]:
... | def main():
from collections import deque
def traversal(ignore_idx):
s = 0
visited = [-1] * N
visited[s] = 0
dq = deque([s])
while dq:
v = dq.popleft()
for u, edge_idx in g[v]:
if ~visited[u] or edge_idx == ignore_idx:... | 44 | 35 | 1,100 | 889 | """
ABC 075
https://www.youtube.com/watch?v=VJntQuR2zNI
"""
def inpl():
return input().split()
def arr(r, c):
return [[False for x in range(c)] for y in range(r)]
def dfs(x):
if vis[x]:
return
else:
vis[x] = True
for i in range(n):
if graph[x][i]:
... | def main():
from collections import deque
def traversal(ignore_idx):
s = 0
visited = [-1] * N
visited[s] = 0
dq = deque([s])
while dq:
v = dq.popleft()
for u, edge_idx in g[v]:
if ~visited[u] or edge_idx == ignore_idx:
... | false | 20.454545 | [
"-\"\"\"",
"-ABC 075",
"-https://www.youtube.com/watch?v=VJntQuR2zNI",
"-\"\"\"",
"+def main():",
"+ from collections import deque",
"+ def traversal(ignore_idx):",
"+ s = 0",
"+ visited = [-1] * N",
"+ visited[s] = 0",
"+ dq = deque([s])",
"+ while dq:... | false | 0.072216 | 0.05876 | 1.229006 | [
"s175147218",
"s257228345"
] |
u222668979 | p02688 | python | s294483163 | s306057606 | 25 | 19 | 9,192 | 9,200 | Accepted | Accepted | 24 | n, k = list(map(int, input().split()))
A = [None]*k
for i in range(k):
d = int(eval(input()))
A[i] = list(map(int, input().split()))
sunuke = [0] * n
for i in range(k):
for j in A[i]:
sunuke[j - 1] += 1
ans = 0
for i in sunuke:
if i == 0:
ans += 1
print(ans)
| n, k = list(map(int, input().split()))
A = [None]*k
for i in range(k):
d = int(eval(input()))
A[i] = list(map(int, input().split()))
snuke = [0] * n
for i in range(k):
for j in A[i]:
snuke[j - 1] += 1
ans = 0
for i in snuke:
if i == 0:
ans += 1
print(ans) | 16 | 16 | 296 | 292 | n, k = list(map(int, input().split()))
A = [None] * k
for i in range(k):
d = int(eval(input()))
A[i] = list(map(int, input().split()))
sunuke = [0] * n
for i in range(k):
for j in A[i]:
sunuke[j - 1] += 1
ans = 0
for i in sunuke:
if i == 0:
ans += 1
print(ans)
| n, k = list(map(int, input().split()))
A = [None] * k
for i in range(k):
d = int(eval(input()))
A[i] = list(map(int, input().split()))
snuke = [0] * n
for i in range(k):
for j in A[i]:
snuke[j - 1] += 1
ans = 0
for i in snuke:
if i == 0:
ans += 1
print(ans)
| false | 0 | [
"-sunuke = [0] * n",
"+snuke = [0] * n",
"- sunuke[j - 1] += 1",
"+ snuke[j - 1] += 1",
"-for i in sunuke:",
"+for i in snuke:"
] | false | 0.063781 | 0.075089 | 0.849406 | [
"s294483163",
"s306057606"
] |
u888092736 | p03076 | python | s642635722 | s116919808 | 19 | 17 | 3,060 | 2,940 | Accepted | Accepted | 10.53 | from itertools import permutations
cook_times = [int(eval(input())) for _ in range(5)]
ans = float('inf')
for ts in permutations(cook_times):
total = 0
for t in ts[:-1]:
if t % 10 == 0:
total += t
else:
total += (t + 9) // 10 * 10
ans = min(ans, total + ... | cook_times = sorted([int(eval(input())) for _ in range(5)], key=lambda x: (x + 9) // 10 * 10 - x)
ans = 0
for t in cook_times[:-1]:
ans += (t + 9) // 10 * 10
print((ans + cook_times[-1])) | 14 | 5 | 333 | 187 | from itertools import permutations
cook_times = [int(eval(input())) for _ in range(5)]
ans = float("inf")
for ts in permutations(cook_times):
total = 0
for t in ts[:-1]:
if t % 10 == 0:
total += t
else:
total += (t + 9) // 10 * 10
ans = min(ans, total + ts[-1])
print... | cook_times = sorted(
[int(eval(input())) for _ in range(5)], key=lambda x: (x + 9) // 10 * 10 - x
)
ans = 0
for t in cook_times[:-1]:
ans += (t + 9) // 10 * 10
print((ans + cook_times[-1]))
| false | 64.285714 | [
"-from itertools import permutations",
"-",
"-cook_times = [int(eval(input())) for _ in range(5)]",
"-ans = float(\"inf\")",
"-for ts in permutations(cook_times):",
"- total = 0",
"- for t in ts[:-1]:",
"- if t % 10 == 0:",
"- total += t",
"- else:",
"- ... | false | 0.043219 | 0.043178 | 1.000939 | [
"s642635722",
"s116919808"
] |
u984664611 | p03680 | python | s460823596 | s825839882 | 230 | 195 | 13,220 | 7,084 | Accepted | Accepted | 15.22 | """
N個のボタン 初期条件としてボタン1が1個光ってる
ボタンiが光ってる時に押すとiが消えてaiが光る
i=ai なこともある
光ってないボタンは押せない
ボタン2が光ってる状態でおわる
回数を求める、不可なら-1
2が返る前に重複したら不可ということ
"""
n = int(eval(input()))
# ボタンの番号を 0 ~ n-1 番に読み替え
a = [int(eval(input()))-1 for _ in range(n)]
button, count = 0, 0
dup_check = {0}
while butt... | n = int(eval(input()))
# ボタンの番号を 0 ~ n-1 番に読み替え
a = [int(eval(input()))-1 for _ in range(n)]
button, count = 0, 0
for _ in range(n):
count += 1
button = a[button]
if button == 1:
break
if count < n:
print(count)
else:
print((-1))
| 26 | 15 | 504 | 260 | """
N個のボタン 初期条件としてボタン1が1個光ってる
ボタンiが光ってる時に押すとiが消えてaiが光る
i=ai なこともある
光ってないボタンは押せない
ボタン2が光ってる状態でおわる
回数を求める、不可なら-1
2が返る前に重複したら不可ということ
"""
n = int(eval(input()))
# ボタンの番号を 0 ~ n-1 番に読み替え
a = [int(eval(input())) - 1 for _ in range(n)]
button, count = 0, 0
dup_check = {0}
while button != 1:
len... | n = int(eval(input()))
# ボタンの番号を 0 ~ n-1 番に読み替え
a = [int(eval(input())) - 1 for _ in range(n)]
button, count = 0, 0
for _ in range(n):
count += 1
button = a[button]
if button == 1:
break
if count < n:
print(count)
else:
print((-1))
| false | 42.307692 | [
"-\"\"\"",
"- N個のボタン 初期条件としてボタン1が1個光ってる",
"- ボタンiが光ってる時に押すとiが消えてaiが光る",
"- i=ai なこともある",
"- 光ってないボタンは押せない",
"- ボタン2が光ってる状態でおわる",
"- 回数を求める、不可なら-1",
"- 2が返る前に重複したら不可ということ",
"-\"\"\"",
"-dup_check = {0}",
"-while button != 1:",
"- len_check = len(dup_check)",
"+for _ in... | false | 0.03847 | 0.038454 | 1.00042 | [
"s460823596",
"s825839882"
] |
u536034761 | p03487 | python | s436980626 | s817949473 | 83 | 75 | 27,340 | 27,328 | Accepted | Accepted | 9.64 | from collections import Counter
N = int(eval(input()))
A = Counter(list(map(int, input().split())))
ans = 0
for x, y in list(A.items()):
if y >= x:
ans += y - x
else:
ans += y
print(ans) | from collections import Counter
n = int(eval(input()))
A = Counter(list(map(int, input().split())))
ans = 0
for k, v in list(A.items()):
if k > v:
ans += v
elif k < v:
ans += v - k
print(ans)
| 10 | 11 | 189 | 209 | from collections import Counter
N = int(eval(input()))
A = Counter(list(map(int, input().split())))
ans = 0
for x, y in list(A.items()):
if y >= x:
ans += y - x
else:
ans += y
print(ans)
| from collections import Counter
n = int(eval(input()))
A = Counter(list(map(int, input().split())))
ans = 0
for k, v in list(A.items()):
if k > v:
ans += v
elif k < v:
ans += v - k
print(ans)
| false | 9.090909 | [
"-N = int(eval(input()))",
"+n = int(eval(input()))",
"-for x, y in list(A.items()):",
"- if y >= x:",
"- ans += y - x",
"- else:",
"- ans += y",
"+for k, v in list(A.items()):",
"+ if k > v:",
"+ ans += v",
"+ elif k < v:",
"+ ans += v - k"
] | false | 0.041377 | 0.049964 | 0.828132 | [
"s436980626",
"s817949473"
] |
u261103969 | p02552 | python | s818893300 | s421463378 | 90 | 26 | 61,680 | 9,056 | Accepted | Accepted | 71.11 | import sys
readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)
def main():
x = int(readline())
if x == 1:
print((0))
else:
print((1))
if __name__ == '__main__':
main()
| x = int(eval(input()))
if x == 1:
print((0))
else:
print((1)) | 19 | 6 | 266 | 65 | import sys
readline = sys.stdin.readline
MOD = 10**9 + 7
INF = float("INF")
sys.setrecursionlimit(10**5)
def main():
x = int(readline())
if x == 1:
print((0))
else:
print((1))
if __name__ == "__main__":
main()
| x = int(eval(input()))
if x == 1:
print((0))
else:
print((1))
| false | 68.421053 | [
"-import sys",
"-",
"-readline = sys.stdin.readline",
"-MOD = 10**9 + 7",
"-INF = float(\"INF\")",
"-sys.setrecursionlimit(10**5)",
"-",
"-",
"-def main():",
"- x = int(readline())",
"- if x == 1:",
"- print((0))",
"- else:",
"- print((1))",
"-",
"-",
"-if __na... | false | 0.05813 | 0.05374 | 1.081673 | [
"s818893300",
"s421463378"
] |
u077898957 | p03826 | python | s331013171 | s292300003 | 21 | 17 | 3,060 | 2,940 | Accepted | Accepted | 19.05 | a,b,c,d = list(map(int,input().split()))
print((int(max(a*b,c*d))))
| a,b,c,d = list(map(int,input().split()))
print((max(a*b,c*d))) | 2 | 2 | 61 | 55 | a, b, c, d = list(map(int, input().split()))
print((int(max(a * b, c * d))))
| a, b, c, d = list(map(int, input().split()))
print((max(a * b, c * d)))
| false | 0 | [
"-print((int(max(a * b, c * d))))",
"+print((max(a * b, c * d)))"
] | false | 0.041654 | 0.047343 | 0.879828 | [
"s331013171",
"s292300003"
] |
u794173881 | p03108 | python | s174218967 | s613921775 | 1,156 | 856 | 108,380 | 103,440 | Accepted | Accepted | 25.95 | class UnionFind:
"""素集合を木構造として管理する"""
def __init__(self, n):
self.parent = [-1] * n
self.cnt = n
def root(self, x):
"""頂点xの根を求める"""
if self.parent[x] < 0:
return x
else:
self.parent[x] = self.root(self.parent[x])
return... | class UnionFind:
"""素集合を木構造として管理する"""
def __init__(self, n):
self.parent = [-1] * n
self.cnt = n
def root(self, x):
"""頂点xの根を求める"""
if self.parent[x] < 0:
return x
else:
self.parent[x] = self.root(self.parent[x])
return... | 58 | 62 | 1,398 | 1,443 | class UnionFind:
"""素集合を木構造として管理する"""
def __init__(self, n):
self.parent = [-1] * n
self.cnt = n
def root(self, x):
"""頂点xの根を求める"""
if self.parent[x] < 0:
return x
else:
self.parent[x] = self.root(self.parent[x])
return self.paren... | class UnionFind:
"""素集合を木構造として管理する"""
def __init__(self, n):
self.parent = [-1] * n
self.cnt = n
def root(self, x):
"""頂点xの根を求める"""
if self.parent[x] < 0:
return x
else:
self.parent[x] = self.root(self.parent[x])
return self.paren... | false | 6.451613 | [
"+import sys",
"+",
"+input = sys.stdin.readline"
] | false | 0.040919 | 0.039169 | 1.044694 | [
"s174218967",
"s613921775"
] |
u840310460 | p03164 | python | s006583045 | s423601822 | 1,099 | 969 | 312,536 | 308,168 | Accepted | Accepted | 11.83 | N, W = [int(i) for i in input().split()]
weight, value = [0] * (N + 1), [0] * (N + 1)
for i in range(1, N + 1):
weight[i], value[i] = [int(i) for i in input().split()]
#%%
sum_value = sum(value)
dp = [[float("inf")] * (sum_value + 1) for _ in range(N + 1)]
dp[0][0] = 0
for i in range(1, N + 1):
for... | N, W = [int(i) for i in input().split()]
weight, value = [0] * (N + 1), [0] * (N + 1)
for i in range(1, N + 1):
weight[i], value[i] = [int(i) for i in input().split()]
#%%
sum_value = sum(value)
dp = [[float("inf")] * (sum_value + 1) for _ in range(N + 1)]
dp[0][0] = 0
for i in range(1, N + 1):
... | 23 | 25 | 597 | 613 | N, W = [int(i) for i in input().split()]
weight, value = [0] * (N + 1), [0] * (N + 1)
for i in range(1, N + 1):
weight[i], value[i] = [int(i) for i in input().split()]
#%%
sum_value = sum(value)
dp = [[float("inf")] * (sum_value + 1) for _ in range(N + 1)]
dp[0][0] = 0
for i in range(1, N + 1):
for j in range(s... | N, W = [int(i) for i in input().split()]
weight, value = [0] * (N + 1), [0] * (N + 1)
for i in range(1, N + 1):
weight[i], value[i] = [int(i) for i in input().split()]
#%%
sum_value = sum(value)
dp = [[float("inf")] * (sum_value + 1) for _ in range(N + 1)]
dp[0][0] = 0
for i in range(1, N + 1):
for j in range(s... | false | 8 | [
"- dp[i][j] = weight[i] + dp[i - 1][j - value[i]]",
"- dp[i][j] = min(dp[i][j], dp[i - 1][j])",
"+ dp[i][j] = min(dp[i - 1][j], weight[i] + dp[i - 1][j - value[i]])",
"+ else:",
"+ dp[i][j] = dp[i - 1][j]"
] | false | 0.050128 | 0.034934 | 1.434942 | [
"s006583045",
"s423601822"
] |
u994988729 | p03674 | python | s420539709 | s456082047 | 1,034 | 389 | 29,976 | 29,908 | Accepted | Accepted | 62.38 | from collections import Counter
N = int(input())
A = list(map(int, input().split()))
mod = 10 ** 9 + 7
# とりあえず二項係数を答えにぶち込む
fact = [1]
for i in range(1, N + 2):
fact.append(fact[-1] * i % mod)
ans = [0] * (N + 2)
fN = fact[N + 1]
for i in range(1, N + 2):
div = fact[i] * fact[N - i + 1] % mod
... | from collections import Counter
mod = 10 ** 9 + 7
class Combination:
def __init__(self, N, MOD=10 ** 9 + 7):
self.MOD = MOD
self.fact, self.inv = self._make_factorial_list(N)
def __call__(self, n, k):
if k < 0 or k > n:
return 0
res = self.fact[n] * sel... | 32 | 44 | 747 | 1,151 | from collections import Counter
N = int(input())
A = list(map(int, input().split()))
mod = 10**9 + 7
# とりあえず二項係数を答えにぶち込む
fact = [1]
for i in range(1, N + 2):
fact.append(fact[-1] * i % mod)
ans = [0] * (N + 2)
fN = fact[N + 1]
for i in range(1, N + 2):
div = fact[i] * fact[N - i + 1] % mod
value = fN * pow... | from collections import Counter
mod = 10**9 + 7
class Combination:
def __init__(self, N, MOD=10**9 + 7):
self.MOD = MOD
self.fact, self.inv = self._make_factorial_list(N)
def __call__(self, n, k):
if k < 0 or k > n:
return 0
res = self.fact[n] * self.inv[k] % self... | false | 27.272727 | [
"-N = int(input())",
"-A = list(map(int, input().split()))",
"-# とりあえず二項係数を答えにぶち込む",
"-fact = [1]",
"-for i in range(1, N + 2):",
"- fact.append(fact[-1] * i % mod)",
"-ans = [0] * (N + 2)",
"-fN = fact[N + 1]",
"-for i in range(1, N + 2):",
"- div = fact[i] * fact[N - i + 1] % mod",
"- ... | false | 0.042777 | 0.042772 | 1.000119 | [
"s420539709",
"s456082047"
] |
u722189950 | p03645 | python | s153149583 | s613673396 | 1,190 | 994 | 49,936 | 40,600 | Accepted | Accepted | 16.47 | from collections import deque
N, M = map(int, input().split())
lst = [[] for _ in range(N + 1)]
dist = [float("inf")]*(N+1)
for _ in range(M):
a, b = map(int, input().split())
lst[a].append(b)
lst[b].append(a)
q = deque()
d = 0
q.append([1,d])
while q:
now, d = q.popleft()
dist[now]... | from collections import deque
N, M = map(int, input().split())
lst = [[] for _ in range(N + 1)]
dist = [float("inf")]*(N+1)
dist[1] = 0
for _ in range(M):
a, b = map(int, input().split())
lst[a].append(b)
lst[b].append(a)
q = deque()
q.append(1)
while q:
now = q.popleft()
for itm ... | 22 | 21 | 488 | 493 | from collections import deque
N, M = map(int, input().split())
lst = [[] for _ in range(N + 1)]
dist = [float("inf")] * (N + 1)
for _ in range(M):
a, b = map(int, input().split())
lst[a].append(b)
lst[b].append(a)
q = deque()
d = 0
q.append([1, d])
while q:
now, d = q.popleft()
dist[now] = d
fo... | from collections import deque
N, M = map(int, input().split())
lst = [[] for _ in range(N + 1)]
dist = [float("inf")] * (N + 1)
dist[1] = 0
for _ in range(M):
a, b = map(int, input().split())
lst[a].append(b)
lst[b].append(a)
q = deque()
q.append(1)
while q:
now = q.popleft()
for itm in lst[now]:
... | false | 4.545455 | [
"+dist[1] = 0",
"-d = 0",
"-q.append([1, d])",
"+q.append(1)",
"- now, d = q.popleft()",
"- dist[now] = d",
"+ now = q.popleft()",
"- if dist[itm] > d + 1:",
"- q.append([itm, d + 1])",
"+ if dist[itm] > dist[now]:",
"+ q.append(itm)",
"+ ... | false | 0.045035 | 0.048478 | 0.928968 | [
"s153149583",
"s613673396"
] |
u558242240 | p03212 | python | s645817112 | s879477332 | 95 | 86 | 3,064 | 3,060 | Accepted | Accepted | 9.47 | s = eval(input())
l = len(s)
n = int(s)
ans = 0
import itertools
for li in range(3, l+1):
for i in itertools.product([7, 5, 3], repeat=li):
num = int(''.join(map(str, i)))
if num > n:
continue
if len(set(i)) == 3:
ans += 1
print(ans) | s = eval(input())
l = len(s)
n = int(s)
ans = 0
import itertools
for li in range(3, l+1):
for i in itertools.product([7, 5, 3], repeat=li):
if len(set(i)) != 3:
continue
num = int(''.join(map(str, i)))
if num <= n:
ans += 1
print(ans) | 13 | 14 | 291 | 294 | s = eval(input())
l = len(s)
n = int(s)
ans = 0
import itertools
for li in range(3, l + 1):
for i in itertools.product([7, 5, 3], repeat=li):
num = int("".join(map(str, i)))
if num > n:
continue
if len(set(i)) == 3:
ans += 1
print(ans)
| s = eval(input())
l = len(s)
n = int(s)
ans = 0
import itertools
for li in range(3, l + 1):
for i in itertools.product([7, 5, 3], repeat=li):
if len(set(i)) != 3:
continue
num = int("".join(map(str, i)))
if num <= n:
ans += 1
print(ans)
| false | 7.142857 | [
"+ if len(set(i)) != 3:",
"+ continue",
"- if num > n:",
"- continue",
"- if len(set(i)) == 3:",
"+ if num <= n:"
] | false | 0.047876 | 0.047836 | 1.000832 | [
"s645817112",
"s879477332"
] |
u627803856 | p02935 | python | s825422830 | s324792640 | 181 | 18 | 38,256 | 2,940 | Accepted | Accepted | 90.06 | n=int(eval(input()))
v=list(map(int,input().split()))
v.sort()
ans=v[0]
for i in range(n-1):
ans=(ans+v[i+1])/2
print(ans) | n = int(eval(input()))
v = list(map(int, input().split()))
v.sort()
res = (v[0] + v[1]) / 2
for i in range(2, n):
res = (res + v[i]) / 2
print(res) | 8 | 10 | 128 | 157 | n = int(eval(input()))
v = list(map(int, input().split()))
v.sort()
ans = v[0]
for i in range(n - 1):
ans = (ans + v[i + 1]) / 2
print(ans)
| n = int(eval(input()))
v = list(map(int, input().split()))
v.sort()
res = (v[0] + v[1]) / 2
for i in range(2, n):
res = (res + v[i]) / 2
print(res)
| false | 20 | [
"-ans = v[0]",
"-for i in range(n - 1):",
"- ans = (ans + v[i + 1]) / 2",
"-print(ans)",
"+res = (v[0] + v[1]) / 2",
"+for i in range(2, n):",
"+ res = (res + v[i]) / 2",
"+print(res)"
] | false | 0.092338 | 0.043521 | 2.121671 | [
"s825422830",
"s324792640"
] |
u580093517 | p03416 | python | s468075361 | s310314385 | 65 | 48 | 2,940 | 3,736 | Accepted | Accepted | 26.15 | a,b = list(map(int,input().split()))
count = 0
for i in range(a,b+1):
if str(i) == str(i)[::-1]:count += 1
print(count) | a,b = list(map(int,input().split()))
print((sum([i == i[::-1] for i in map(str,list(range(a,b+1)))]))) | 5 | 2 | 121 | 89 | a, b = list(map(int, input().split()))
count = 0
for i in range(a, b + 1):
if str(i) == str(i)[::-1]:
count += 1
print(count)
| a, b = list(map(int, input().split()))
print((sum([i == i[::-1] for i in map(str, list(range(a, b + 1)))])))
| false | 60 | [
"-count = 0",
"-for i in range(a, b + 1):",
"- if str(i) == str(i)[::-1]:",
"- count += 1",
"-print(count)",
"+print((sum([i == i[::-1] for i in map(str, list(range(a, b + 1)))])))"
] | false | 0.051383 | 0.04802 | 1.070045 | [
"s468075361",
"s310314385"
] |
u680851063 | p02843 | python | s470421042 | s507364470 | 906 | 31 | 9,080 | 9,180 | Accepted | Accepted | 96.58 | x = int(eval(input()))
l = -(-x//105)
h = x//100
fix = l*100
for b in range(0,h+1):
for c in range(0,h+1):
for d in range(0,h+1):
for e in range(0,h+1):
for f in range(0,h+1):
if fix + 1*b+2*c+3*d+4*e+5*f==x:
print('1')
... | x = int(eval(input()))
l = -(-x//105)
h = x//100
#fix = l*100
for i in range(l,h+1):
for b in range(0,i+1):
for c in range(0,i+1):
for d in range(0,i+1):
for e in range(0,i+1):
if x - (i*100 + 1*b+2*c+3*d+4*e+5*(i-b-c-d-e)) == 0:
... | 16 | 16 | 366 | 395 | x = int(eval(input()))
l = -(-x // 105)
h = x // 100
fix = l * 100
for b in range(0, h + 1):
for c in range(0, h + 1):
for d in range(0, h + 1):
for e in range(0, h + 1):
for f in range(0, h + 1):
if fix + 1 * b + 2 * c + 3 * d + 4 * e + 5 * f == x:
... | x = int(eval(input()))
l = -(-x // 105)
h = x // 100
# fix = l*100
for i in range(l, h + 1):
for b in range(0, i + 1):
for c in range(0, i + 1):
for d in range(0, i + 1):
for e in range(0, i + 1):
if (
x
- (
... | false | 0 | [
"-fix = l * 100",
"-for b in range(0, h + 1):",
"- for c in range(0, h + 1):",
"- for d in range(0, h + 1):",
"- for e in range(0, h + 1):",
"- for f in range(0, h + 1):",
"- if fix + 1 * b + 2 * c + 3 * d + 4 * e + 5 * f == x:",
"+# fix = l*100",... | false | 0.146407 | 0.036406 | 4.021514 | [
"s470421042",
"s507364470"
] |
u852690916 | p03209 | python | s784058977 | s202639845 | 179 | 60 | 38,384 | 61,908 | Accepted | Accepted | 66.48 | N,X = list(map(int,input().split()))
# 層の総数
T = [1]
for i in range(1, 50+1):
T.append(T[i-1]*2+3)
def hash(n,x):
return "{0:d},{1:d}".format(n,x)
# レベルnバーガーの下からx層内のパティの数
memo = dict()
def solve(n,x):
global T, memo
if hash(n,x) in memo:
return memo[hash(n,x)]
if n == 0 and... | N, X = list(map(int, input().split()))
c = [1] * (N + 1)
p = [1] * (N + 1)
for i in range(1, N + 1):
c[i] = c[i - 1] * 2 + 3
p[i] = p[i - 1] * 2 + 1
def solve(l, x):
if l == 0:
return x
res = 0
x -= 1
if x <= 0: return res
if x < c[l - 1]:
res += solve(l - 1, x)
... | 30 | 27 | 676 | 608 | N, X = list(map(int, input().split()))
# 層の総数
T = [1]
for i in range(1, 50 + 1):
T.append(T[i - 1] * 2 + 3)
def hash(n, x):
return "{0:d},{1:d}".format(n, x)
# レベルnバーガーの下からx層内のパティの数
memo = dict()
def solve(n, x):
global T, memo
if hash(n, x) in memo:
return memo[hash(n, x)]
if n == 0 a... | N, X = list(map(int, input().split()))
c = [1] * (N + 1)
p = [1] * (N + 1)
for i in range(1, N + 1):
c[i] = c[i - 1] * 2 + 3
p[i] = p[i - 1] * 2 + 1
def solve(l, x):
if l == 0:
return x
res = 0
x -= 1
if x <= 0:
return res
if x < c[l - 1]:
res += solve(l - 1, x)
... | false | 10 | [
"-# 層の総数",
"-T = [1]",
"-for i in range(1, 50 + 1):",
"- T.append(T[i - 1] * 2 + 3)",
"+c = [1] * (N + 1)",
"+p = [1] * (N + 1)",
"+for i in range(1, N + 1):",
"+ c[i] = c[i - 1] * 2 + 3",
"+ p[i] = p[i - 1] * 2 + 1",
"-def hash(n, x):",
"- return \"{0:d},{1:d}\".format(n, x)",
"-"... | false | 0.111148 | 0.041061 | 2.706916 | [
"s784058977",
"s202639845"
] |
u484229314 | p02838 | python | s359495499 | s505597167 | 977 | 895 | 137,920 | 137,016 | Accepted | Accepted | 8.39 | N = int(eval(input()))
A = [int(_) for _ in input().split()]
ans = 0
MOD = 10**9+7
for i in range(60):
b = 1 << i
cnt_1 = sum([a & b > 0 for a in A])
cnt_0 = N - cnt_1
b_sum = cnt_1 * cnt_0
ans += (b_sum << i) % MOD
print((ans%MOD))
| N = int(eval(input()))
A = [int(_) for _ in input().split()]
ans = 0
MOD = 10**9+7
for i in range(60):
b = 1 << i
cnt_1 = sum([a & b for a in A]) >> i
cnt_0 = N - cnt_1
b_sum = cnt_1 * cnt_0
ans += (b_sum << i) % MOD
print((ans%MOD))
| 12 | 12 | 257 | 258 | N = int(eval(input()))
A = [int(_) for _ in input().split()]
ans = 0
MOD = 10**9 + 7
for i in range(60):
b = 1 << i
cnt_1 = sum([a & b > 0 for a in A])
cnt_0 = N - cnt_1
b_sum = cnt_1 * cnt_0
ans += (b_sum << i) % MOD
print((ans % MOD))
| N = int(eval(input()))
A = [int(_) for _ in input().split()]
ans = 0
MOD = 10**9 + 7
for i in range(60):
b = 1 << i
cnt_1 = sum([a & b for a in A]) >> i
cnt_0 = N - cnt_1
b_sum = cnt_1 * cnt_0
ans += (b_sum << i) % MOD
print((ans % MOD))
| false | 0 | [
"- cnt_1 = sum([a & b > 0 for a in A])",
"+ cnt_1 = sum([a & b for a in A]) >> i"
] | false | 0.036925 | 0.037873 | 0.974968 | [
"s359495499",
"s505597167"
] |
u058433718 | p02390 | python | s414337778 | s292340668 | 30 | 20 | 7,680 | 5,592 | Accepted | Accepted | 33.33 | import sys
data = int(sys.stdin.readline().strip())
seconds, pre = data % 60, data / 60
minutes, hours = pre % 60, pre / 60
print(('%d:%d:%d' % (hours, minutes, seconds))) | data = eval(input())
seconds = int(data)
(seconds, sec) = divmod(seconds, 60)
(hour, minute) = divmod(seconds, 60)
print(('{}:{}:{}'.format(hour, minute, sec))) | 7 | 6 | 177 | 158 | import sys
data = int(sys.stdin.readline().strip())
seconds, pre = data % 60, data / 60
minutes, hours = pre % 60, pre / 60
print(("%d:%d:%d" % (hours, minutes, seconds)))
| data = eval(input())
seconds = int(data)
(seconds, sec) = divmod(seconds, 60)
(hour, minute) = divmod(seconds, 60)
print(("{}:{}:{}".format(hour, minute, sec)))
| false | 14.285714 | [
"-import sys",
"-",
"-data = int(sys.stdin.readline().strip())",
"-seconds, pre = data % 60, data / 60",
"-minutes, hours = pre % 60, pre / 60",
"-print((\"%d:%d:%d\" % (hours, minutes, seconds)))",
"+data = eval(input())",
"+seconds = int(data)",
"+(seconds, sec) = divmod(seconds, 60)",
"+(hour, ... | false | 0.041292 | 0.039762 | 1.03847 | [
"s414337778",
"s292340668"
] |
u759412327 | p02712 | python | s076612441 | s110410054 | 109 | 98 | 8,972 | 9,072 | Accepted | Accepted | 10.09 | N = int(eval(input()))
print((sum(n for n in range(1+N) if n%3!=0 and n%5!=0))) | print((sum(n for n in range(1+int(eval(input()))) if n%3 and n%5))) | 2 | 1 | 72 | 59 | N = int(eval(input()))
print((sum(n for n in range(1 + N) if n % 3 != 0 and n % 5 != 0)))
| print((sum(n for n in range(1 + int(eval(input()))) if n % 3 and n % 5)))
| false | 50 | [
"-N = int(eval(input()))",
"-print((sum(n for n in range(1 + N) if n % 3 != 0 and n % 5 != 0)))",
"+print((sum(n for n in range(1 + int(eval(input()))) if n % 3 and n % 5)))"
] | false | 0.154818 | 0.070294 | 2.202431 | [
"s076612441",
"s110410054"
] |
u497952650 | p02744 | python | s971331653 | s816359653 | 155 | 141 | 14,564 | 14,540 | Accepted | Accepted | 9.03 | def f(num,N,S):
alphabet = ["a","b","c","d","e","f","g","h","i","j"]
if N == num:
for i in S:
print(i)
return
else:
tmp = []
length = len(S)
for i in S:
ttmp = sorted(list(i))
for j in range(alphabet.index(ttmp[-1])+2):
... | def saiki(n,A):
if n == N:
A.sort()
for i in A:
print(i)
return
alpha = list("abcdefghijklmnopqr")
tmp = []
for i in A:
a = alpha.index(sorted(list(i))[-1])
for j in range(a+2):
tmp.append(i+alpha[j])
saiki(n+1... | 17 | 22 | 418 | 363 | def f(num, N, S):
alphabet = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"]
if N == num:
for i in S:
print(i)
return
else:
tmp = []
length = len(S)
for i in S:
ttmp = sorted(list(i))
for j in range(alphabet.index(ttmp[-1]) + 2):... | def saiki(n, A):
if n == N:
A.sort()
for i in A:
print(i)
return
alpha = list("abcdefghijklmnopqr")
tmp = []
for i in A:
a = alpha.index(sorted(list(i))[-1])
for j in range(a + 2):
tmp.append(i + alpha[j])
saiki(n + 1, tmp)
N = int(ev... | false | 22.727273 | [
"-def f(num, N, S):",
"- alphabet = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\"]",
"- if N == num:",
"- for i in S:",
"+def saiki(n, A):",
"+ if n == N:",
"+ A.sort()",
"+ for i in A:",
"- else:",
"- tmp = []",
"- length = ... | false | 0.04926 | 0.049097 | 1.003326 | [
"s971331653",
"s816359653"
] |
u493520238 | p02585 | python | s203347901 | s920447605 | 1,381 | 271 | 168,868 | 73,344 | Accepted | Accepted | 80.38 | n,k = list(map(int, input().split()))
pl = [0] + list(map(int, input().split()))
cl = [0] + list(map(int, input().split()))
ans = (10**18)*(-1)
for start in range(1,n+1):
val = 0
vals = []
already_set = set()
curr_mass = start
while True:
next_mass = pl[curr_mass]
point ... | n,k = list(map(int, input().split()))
pl = [0] + list(map(int, input().split()))
cl = [0] + list(map(int, input().split()))
valsl = []
already = [False]*(n+1)
for i in range(1,n+1):
if already[i]: continue
vals = [cl[i]]
curr_i = i
already[i] = True
while True:
next_i = pl[curr_... | 66 | 46 | 1,989 | 1,162 | n, k = list(map(int, input().split()))
pl = [0] + list(map(int, input().split()))
cl = [0] + list(map(int, input().split()))
ans = (10**18) * (-1)
for start in range(1, n + 1):
val = 0
vals = []
already_set = set()
curr_mass = start
while True:
next_mass = pl[curr_mass]
point = cl[ne... | n, k = list(map(int, input().split()))
pl = [0] + list(map(int, input().split()))
cl = [0] + list(map(int, input().split()))
valsl = []
already = [False] * (n + 1)
for i in range(1, n + 1):
if already[i]:
continue
vals = [cl[i]]
curr_i = i
already[i] = True
while True:
next_i = pl[cu... | false | 30.30303 | [
"-ans = (10**18) * (-1)",
"-for start in range(1, n + 1):",
"- val = 0",
"- vals = []",
"- already_set = set()",
"- curr_mass = start",
"+valsl = []",
"+already = [False] * (n + 1)",
"+for i in range(1, n + 1):",
"+ if already[i]:",
"+ continue",
"+ vals = [cl[i]]",
... | false | 0.045562 | 0.037618 | 1.211159 | [
"s203347901",
"s920447605"
] |
u692691139 | p02773 | python | s867865351 | s172613797 | 1,375 | 712 | 59,664 | 59,480 | Accepted | Accepted | 48.22 | from collections import Counter
n=int(input().rstrip())
d=dict()
for _ in range(n):
s=input().rstrip()
if s not in d:
d[s]=1
else:
d[s]+=1
ans=Counter(d).most_common()
ans.sort(key=lambda x: (-x[1],x[0]))
m=ans[0][1]
for i in ans:
if i[1]!=m:
break
print((i[0])) | #import pysnooper
#import numpy
#import os,re,sys,operator
from collections import Counter,deque
#from operator import itemgetter,mul
#from itertools import accumulate,combinations,groupby,combinations_with_replacement,permutations
from sys import stdin,setrecursionlimit
#from bisect import bisect_left,bisect_ri... | 16 | 36 | 315 | 951 | from collections import Counter
n = int(input().rstrip())
d = dict()
for _ in range(n):
s = input().rstrip()
if s not in d:
d[s] = 1
else:
d[s] += 1
ans = Counter(d).most_common()
ans.sort(key=lambda x: (-x[1], x[0]))
m = ans[0][1]
for i in ans:
if i[1] != m:
break
print((i[... | # import pysnooper
# import numpy
# import os,re,sys,operator
from collections import Counter, deque
# from operator import itemgetter,mul
# from itertools import accumulate,combinations,groupby,combinations_with_replacement,permutations
from sys import stdin, setrecursionlimit
# from bisect import bisect_left,bisect... | false | 55.555556 | [
"-from collections import Counter",
"+# import pysnooper",
"+# import numpy",
"+# import os,re,sys,operator",
"+from collections import Counter, deque",
"-n = int(input().rstrip())",
"-d = dict()",
"-for _ in range(n):",
"- s = input().rstrip()",
"- if s not in d:",
"- d[s] = 1",
... | false | 0.214604 | 0.12332 | 1.74022 | [
"s867865351",
"s172613797"
] |
u934442292 | p02888 | python | s888965314 | s054032081 | 692 | 579 | 9,352 | 107,060 | Accepted | Accepted | 16.33 | import sys
from bisect import bisect_left
input = sys.stdin.readline
def solve(N, L):
L.sort()
ans = 0
for a in range(N - 2):
for b in range(a + 1, N - 1):
c = bisect_left(L, L[a] + L[b]) - 1
ans += c - b
return ans
def main():
N = int(eval(input... | import sys
import numba as nb
import numpy as np
input = sys.stdin.readline
@nb.njit("i8(i8[:],i8)", cache=True)
def binary_search(a, key):
"""Meguru type binary search"""
ng = -1
ok = len(a)
def is_ok(a, key, idx):
if a[idx] >= key:
return True
else:
... | 26 | 51 | 445 | 937 | import sys
from bisect import bisect_left
input = sys.stdin.readline
def solve(N, L):
L.sort()
ans = 0
for a in range(N - 2):
for b in range(a + 1, N - 1):
c = bisect_left(L, L[a] + L[b]) - 1
ans += c - b
return ans
def main():
N = int(eval(input()))
L = list... | import sys
import numba as nb
import numpy as np
input = sys.stdin.readline
@nb.njit("i8(i8[:],i8)", cache=True)
def binary_search(a, key):
"""Meguru type binary search"""
ng = -1
ok = len(a)
def is_ok(a, key, idx):
if a[idx] >= key:
return True
else:
return F... | false | 49.019608 | [
"-from bisect import bisect_left",
"+import numba as nb",
"+import numpy as np",
"+@nb.njit(\"i8(i8[:],i8)\", cache=True)",
"+def binary_search(a, key):",
"+ \"\"\"Meguru type binary search\"\"\"",
"+ ng = -1",
"+ ok = len(a)",
"+",
"+ def is_ok(a, key, idx):",
"+ if a[idx] >=... | false | 0.107072 | 0.038731 | 2.764532 | [
"s888965314",
"s054032081"
] |
u652656291 | p03575 | python | s066810540 | s775441956 | 45 | 31 | 3,188 | 9,304 | Accepted | Accepted | 31.11 | N,M=list(map(int,input().split()))
edges=[list(map(int,input().split())) for i in range(M)]
ans=0
for x in edges:
l=list(range(N))
for y in edges:
if y!=x:
l=[l[y[0]-1]if l[i]==l[y[1]-1] else l[i] for i in range(N)]
if len(set(l))!=1:
ans+=1
print(ans)
| class UnionFind:
def __init__(self, n):
self.nodes = n
self.parents = [i for i in range(n)]
self.sizes = [1] * n
self.rank = [0] * n
def find(self, i): # どの集合に属しているか(根ノードの番号)
if self.parents[i] == i:
return i
else:
self.parents[... | 11 | 51 | 293 | 1,476 | N, M = list(map(int, input().split()))
edges = [list(map(int, input().split())) for i in range(M)]
ans = 0
for x in edges:
l = list(range(N))
for y in edges:
if y != x:
l = [l[y[0] - 1] if l[i] == l[y[1] - 1] else l[i] for i in range(N)]
if len(set(l)) != 1:
ans += 1
print(ans)
| class UnionFind:
def __init__(self, n):
self.nodes = n
self.parents = [i for i in range(n)]
self.sizes = [1] * n
self.rank = [0] * n
def find(self, i): # どの集合に属しているか(根ノードの番号)
if self.parents[i] == i:
return i
else:
self.parents[i] = self.... | false | 78.431373 | [
"+class UnionFind:",
"+ def __init__(self, n):",
"+ self.nodes = n",
"+ self.parents = [i for i in range(n)]",
"+ self.sizes = [1] * n",
"+ self.rank = [0] * n",
"+",
"+ def find(self, i): # どの集合に属しているか(根ノードの番号)",
"+ if self.parents[i] == i:",
"+ ... | false | 0.036441 | 0.052706 | 0.6914 | [
"s066810540",
"s775441956"
] |
u102461423 | p03783 | python | s384098427 | s679193095 | 593 | 349 | 30,264 | 28,128 | Accepted | Accepted | 41.15 | import sys
input = sys.stdin.readline
from heapq import heappop, heappush
"""
f(x) = (一番上の長方形の左端がxに来るときのコストの最小値) を関数ごと更新していきたい
更新後をg(x)とする
g(x) = |x-L| + min_{-width_1 \leq t\leq width_2} f(x+t), 前回の幅、今回の幅
常に、区間上で最小値を持ち傾きが1ずつ変わる凸な関数であることが維持される。(区間は1点かも)
傾きが変わる点の集合S_f = S_f_lower + S_f_upperを持っていく。
S_f_lower,... | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
from heapq import heappush, heappushpop
"""
・f(x) = (最上段の左端座標) -> 最小コスト
・g = newf とすると、g(x) = |x-l| + min_{x-w_{n-1}<=y<=x+w_n}f(y)
・常に [A0,B0] 上で定数、[A_i,A_{i-1}]で傾き-i、[B_{i-1},B_i]で傾きiの下に凸な折れ... | 49 | 49 | 1,109 | 1,223 | import sys
input = sys.stdin.readline
from heapq import heappop, heappush
"""
f(x) = (一番上の長方形の左端がxに来るときのコストの最小値) を関数ごと更新していきたい
更新後をg(x)とする
g(x) = |x-L| + min_{-width_1 \leq t\leq width_2} f(x+t), 前回の幅、今回の幅
常に、区間上で最小値を持ち傾きが1ずつ変わる凸な関数であることが維持される。(区間は1点かも)
傾きが変わる点の集合S_f = S_f_lower + S_f_upperを持っていく。
S_f_lower, S_upperは... | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
from heapq import heappush, heappushpop
"""
・f(x) = (最上段の左端座標) -> 最小コスト
・g = newf とすると、g(x) = |x-l| + min_{x-w_{n-1}<=y<=x+w_n}f(y)
・常に [A0,B0] 上で定数、[A_i,A_{i-1}]で傾き-i、[B_{i-1},B_i]で傾きiの下に凸な折れ線
heapqで(A... | false | 0 | [
"-input = sys.stdin.readline",
"-from heapq import heappop, heappush",
"+read = sys.stdin.buffer.read",
"+readline = sys.stdin.buffer.readline",
"+readlines = sys.stdin.buffer.readlines",
"+from heapq import heappush, heappushpop",
"-f(x) = (一番上の長方形の左端がxに来るときのコストの最小値) を関数ごと更新していきたい",
"-更新後をg(x)とする",
... | false | 0.037203 | 0.036966 | 1.006413 | [
"s384098427",
"s679193095"
] |
u241159583 | p02957 | python | s458954560 | s946604274 | 19 | 17 | 2,940 | 2,940 | Accepted | Accepted | 10.53 | a, b = list(map(int, input().split()))
if (a - b) % 2 == 0:
print(((a + b) // 2))
else:
print("IMPOSSIBLE") | a, b = list(map(int, input().split()))
print(((a+b)// 2 if (a+b)% 2 == 0 else "IMPOSSIBLE")) | 5 | 2 | 107 | 85 | a, b = list(map(int, input().split()))
if (a - b) % 2 == 0:
print(((a + b) // 2))
else:
print("IMPOSSIBLE")
| a, b = list(map(int, input().split()))
print(((a + b) // 2 if (a + b) % 2 == 0 else "IMPOSSIBLE"))
| false | 60 | [
"-if (a - b) % 2 == 0:",
"- print(((a + b) // 2))",
"-else:",
"- print(\"IMPOSSIBLE\")",
"+print(((a + b) // 2 if (a + b) % 2 == 0 else \"IMPOSSIBLE\"))"
] | false | 0.093994 | 0.062389 | 1.506567 | [
"s458954560",
"s946604274"
] |
u272028993 | p03893 | python | s041298897 | s297686246 | 11 | 10 | 2,696 | 2,568 | Accepted | Accepted | 9.09 | x=int(input())
x-=1
ans=6
for i in range(x):
ans=ans+ans+2
print(ans)
| x=int(input())
ans=2
for i in range(x):
ans=ans+ans+2
print(ans) | 6 | 5 | 83 | 76 | x = int(input())
x -= 1
ans = 6
for i in range(x):
ans = ans + ans + 2
print(ans)
| x = int(input())
ans = 2
for i in range(x):
ans = ans + ans + 2
print(ans)
| false | 16.666667 | [
"-x -= 1",
"-ans = 6",
"+ans = 2"
] | false | 0.044048 | 0.043118 | 1.021569 | [
"s041298897",
"s297686246"
] |
u091051505 | p03053 | python | s886297777 | s773532783 | 986 | 423 | 106,004 | 109,984 | Accepted | Accepted | 57.1 | import sys
sys.setrecursionlimit(10**6)
input = sys.stdin.readline
H,W = list(map(int,input().split()))
INF = 10**18
q = []
visited = [[True]*(W+2)]
visited += [[True] + [x == '#' for x in input().rstrip()] + [True] for _ in range(H)]
visited.append([True]*(W+2))
for i in range(1,H+1):
for j in range(1,... | import sys
sys.setrecursionlimit(10**6)
input = sys.stdin.readline
H,W = list(map(int,input().split()))
INF = 10**18
q = []
visited = [[True]*(W+2)]
visited += [[True] + [x == '#' for x in input().rstrip()] + [True] for _ in range(H)]
visited.append([True]*(W+2))
for i in range(1,H+1):
for j in range(1,... | 38 | 36 | 840 | 793 | import sys
sys.setrecursionlimit(10**6)
input = sys.stdin.readline
H, W = list(map(int, input().split()))
INF = 10**18
q = []
visited = [[True] * (W + 2)]
visited += [[True] + [x == "#" for x in input().rstrip()] + [True] for _ in range(H)]
visited.append([True] * (W + 2))
for i in range(1, H + 1):
for j in range(... | import sys
sys.setrecursionlimit(10**6)
input = sys.stdin.readline
H, W = list(map(int, input().split()))
INF = 10**18
q = []
visited = [[True] * (W + 2)]
visited += [[True] + [x == "#" for x in input().rstrip()] + [True] for _ in range(H)]
visited.append([True] * (W + 2))
for i in range(1, H + 1):
for j in range(... | false | 5.263158 | [
"-moves = [(0, 1), (0, -1), (1, 0), (-1, 0)] # 全方向調べる"
] | false | 0.03867 | 0.136953 | 0.282359 | [
"s886297777",
"s773532783"
] |
u404676457 | p03651 | python | s203986581 | s412561866 | 217 | 114 | 14,340 | 14,508 | Accepted | Accepted | 47.47 | import sys
n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
a.sort()
if a[-1] < k:
print('IMPOSSIBLE')
sys.exit(0)
seta = set(a)
if k in seta:
print('POSSIBLE')
sys.exit(0)
lena = len(seta)
sorteda = sorted(seta)
mini = sorteda[0] if sorteda[0] != 0 else sorted... | import sys
n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
a.sort()
if a[-1] < k:
print('IMPOSSIBLE')
sys.exit(0)
seta = set(a)
if k in seta:
print('POSSIBLE')
sys.exit(0)
def gojoho(l, s):
return s if l % s == 0 else gojoho(s, l % s)
koubaisu = gojoho(a... | 27 | 24 | 549 | 453 | import sys
n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
a.sort()
if a[-1] < k:
print("IMPOSSIBLE")
sys.exit(0)
seta = set(a)
if k in seta:
print("POSSIBLE")
sys.exit(0)
lena = len(seta)
sorteda = sorted(seta)
mini = sorteda[0] if sorteda[0] != 0 else sorteda[1]
for i in ra... | import sys
n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
a.sort()
if a[-1] < k:
print("IMPOSSIBLE")
sys.exit(0)
seta = set(a)
if k in seta:
print("POSSIBLE")
sys.exit(0)
def gojoho(l, s):
return s if l % s == 0 else gojoho(s, l % s)
koubaisu = gojoho(a[1], a[0])
for... | false | 11.111111 | [
"-lena = len(seta)",
"-sorteda = sorted(seta)",
"-mini = sorteda[0] if sorteda[0] != 0 else sorteda[1]",
"-for i in range(1, len(sorteda)):",
"- seta.add(sorteda[i] % mini)",
"-sorteda = sorted(seta)",
"-mini = sorteda[0] if sorteda[0] != 0 else sorteda[1]",
"-if k % mini == 0:",
"+",
"+",
"+... | false | 0.070816 | 0.132669 | 0.53378 | [
"s203986581",
"s412561866"
] |
u015593272 | p02819 | python | s401713477 | s884696987 | 149 | 18 | 12,504 | 2,940 | Accepted | Accepted | 87.92 | import numpy as np
def judge_prime(num):
FLAG = True
# for i in range(2, int(np.sqrt(num))+1):
for i in range(2, int(num**0.5)+1):
if (num%i == 0):
FLAG = False
if (num == 2):
FLAG = True
return(FLAG)
X = int(eval(input()))
while (True... | def judge_prime(num):
FLAG = True
for i in range(2, int(num**.5)+1):
if (num%i == 0):
FLAG = False
if (num == 2):
FLAG = True
return(FLAG)
X = int(eval(input()))
while (True):
flag = judge_prime(X)
if (flag):
break
... | 27 | 24 | 410 | 341 | import numpy as np
def judge_prime(num):
FLAG = True
# for i in range(2, int(np.sqrt(num))+1):
for i in range(2, int(num**0.5) + 1):
if num % i == 0:
FLAG = False
if num == 2:
FLAG = True
return FLAG
X = int(eval(input()))
while True:
flag = judge_prime(X)
if ... | def judge_prime(num):
FLAG = True
for i in range(2, int(num**0.5) + 1):
if num % i == 0:
FLAG = False
if num == 2:
FLAG = True
return FLAG
X = int(eval(input()))
while True:
flag = judge_prime(X)
if flag:
break
X += 1
print(X)
| false | 11.111111 | [
"-import numpy as np",
"-",
"-",
"- # for i in range(2, int(np.sqrt(num))+1):"
] | false | 0.036882 | 0.089788 | 0.410766 | [
"s401713477",
"s884696987"
] |
u475503988 | p03346 | python | s478622633 | s690846824 | 439 | 188 | 18,924 | 18,948 | Accepted | Accepted | 57.18 | n = int(eval(input()))
p = [int(eval(input())) for _ in range(n)]
q = [0] * n
for i in range(n):
q[p[i]-1] = i
mxk = 1
k = 1
for i in range(n-1):
if q[i] < q[i+1]:
k += 1
if k > mxk:
mxk = k
else:
k = 1
print((n-mxk))
| import sys
input = sys.stdin.buffer.readline
n = int(eval(input()))
p = [int(eval(input())) for _ in range(n)]
q = [0] * n
for i in range(n):
q[p[i]-1] = i
mxk = 1
k = 1
for i in range(n-1):
if q[i] < q[i+1]:
k += 1
if k > mxk:
mxk = k
else:
k = 1
prin... | 16 | 19 | 268 | 317 | n = int(eval(input()))
p = [int(eval(input())) for _ in range(n)]
q = [0] * n
for i in range(n):
q[p[i] - 1] = i
mxk = 1
k = 1
for i in range(n - 1):
if q[i] < q[i + 1]:
k += 1
if k > mxk:
mxk = k
else:
k = 1
print((n - mxk))
| import sys
input = sys.stdin.buffer.readline
n = int(eval(input()))
p = [int(eval(input())) for _ in range(n)]
q = [0] * n
for i in range(n):
q[p[i] - 1] = i
mxk = 1
k = 1
for i in range(n - 1):
if q[i] < q[i + 1]:
k += 1
if k > mxk:
mxk = k
else:
k = 1
print((n - mxk))
| false | 15.789474 | [
"+import sys",
"+",
"+input = sys.stdin.buffer.readline"
] | false | 0.035651 | 0.094149 | 0.378668 | [
"s478622633",
"s690846824"
] |
u481250941 | p03545 | python | s094077675 | s736478178 | 177 | 76 | 38,256 | 16,228 | Accepted | Accepted | 57.06 | import sys
def input():
return sys.stdin.readline().rstrip()
def bitall(s):
for bit in range(1 << 3):
f = s[0]
for i in range(3):
if bit & (1 << i):
f += "+"
f += s[i + 1]
else:
f += "-"
... | #
# abc079 c
#
import sys
from io import StringIO
import unittest
class TestClass(unittest.TestCase):
def assertIO(self, input, output):
stdout, stdin = sys.stdout, sys.stdin
sys.stdout, sys.stdin = StringIO(), StringIO(input)
resolve()
sys.stdout.seek(0)
ou... | 32 | 56 | 507 | 1,247 | import sys
def input():
return sys.stdin.readline().rstrip()
def bitall(s):
for bit in range(1 << 3):
f = s[0]
for i in range(3):
if bit & (1 << i):
f += "+"
f += s[i + 1]
else:
f += "-"
f += s[i + 1]
... | #
# abc079 c
#
import sys
from io import StringIO
import unittest
class TestClass(unittest.TestCase):
def assertIO(self, input, output):
stdout, stdin = sys.stdout, sys.stdin
sys.stdout, sys.stdin = StringIO(), StringIO(input)
resolve()
sys.stdout.seek(0)
out = sys.stdout.r... | false | 42.857143 | [
"+#",
"+# abc079 c",
"+#",
"+from io import StringIO",
"+import unittest",
"-def input():",
"- return sys.stdin.readline().rstrip()",
"+class TestClass(unittest.TestCase):",
"+ def assertIO(self, input, output):",
"+ stdout, stdin = sys.stdout, sys.stdin",
"+ sys.stdout, sys.... | false | 0.037643 | 0.11539 | 0.326226 | [
"s094077675",
"s736478178"
] |
u078042885 | p00111 | python | s024984078 | s669375208 | 100 | 80 | 7,476 | 7,420 | Accepted | Accepted | 20 | en=[chr(i) for i in range(65,91)]+list(' .,-\'?')
de={
'101':' ','000000':'\'','000011':',','10010001':'-','010001':'.','000001':'?',
'100101':'A','10011010':'B','0101':'C','0001':'D','110':'E','01001':'F',
'10011011':'G','010000':'H','0111':'I','10011000':'J','0110':'K','00100':'L',
'10011001':'M','10011110':'N'... | en='ABCDEFGHIJKLMNOPQRSTUVWXYZ'+' .,-\'?'
de={
'101':' ','000000':'\'','000011':',','10010001':'-','010001':'.','000001':'?',
'100101':'A','10011010':'B','0101':'C','0001':'D','110':'E','01001':'F',
'10011011':'G','010000':'H','0111':'I','10011000':'J','0110':'K','00100':'L',
'10011001':'M','10011110':'N','00101'... | 18 | 18 | 696 | 688 | en = [chr(i) for i in range(65, 91)] + list(" .,-'?")
de = {
"101": " ",
"000000": "'",
"000011": ",",
"10010001": "-",
"010001": ".",
"000001": "?",
"100101": "A",
"10011010": "B",
"0101": "C",
"0001": "D",
"110": "E",
"01001": "F",
"10011011": "G",
"010000": "H"... | en = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + " .,-'?"
de = {
"101": " ",
"000000": "'",
"000011": ",",
"10010001": "-",
"010001": ".",
"000001": "?",
"100101": "A",
"10011010": "B",
"0101": "C",
"0001": "D",
"110": "E",
"01001": "F",
"10011011": "G",
"010000": "H",
"01... | false | 0 | [
"-en = [chr(i) for i in range(65, 91)] + list(\" .,-'?\")",
"+en = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\" + \" .,-'?\""
] | false | 0.043696 | 0.039163 | 1.115747 | [
"s024984078",
"s669375208"
] |
u900109664 | p03624 | python | s843156508 | s521634868 | 20 | 17 | 3,956 | 3,188 | Accepted | Accepted | 15 | s = list(eval(input()))
for i in 'abcdefghijklmnopqrstuvwxyz':
if i not in s:
print(i)
s = ''
break
if s != '':
print('None')
| s = eval(input())
for i in 'abcdefghijklmnopqrstuvwxyz':
if i not in s:
print(i)
exit()
print('None')
| 8 | 6 | 159 | 121 | s = list(eval(input()))
for i in "abcdefghijklmnopqrstuvwxyz":
if i not in s:
print(i)
s = ""
break
if s != "":
print("None")
| s = eval(input())
for i in "abcdefghijklmnopqrstuvwxyz":
if i not in s:
print(i)
exit()
print("None")
| false | 25 | [
"-s = list(eval(input()))",
"+s = eval(input())",
"- s = \"\"",
"- break",
"-if s != \"\":",
"- print(\"None\")",
"+ exit()",
"+print(\"None\")"
] | false | 0.051889 | 0.117035 | 0.443365 | [
"s843156508",
"s521634868"
] |
u927740808 | p02572 | python | s935126270 | s977295837 | 248 | 189 | 25,120 | 25,356 | Accepted | Accepted | 23.79 | n = int(eval(input()))
l = eval(input())
a = l.split(' ')
tmp = 0
total2 = 0
for i in range(n):
tmp += int(a[i])
for i in range(n):
total2 += int(a[i])*(tmp-int(a[i]))
tmp -= int(a[i])
print((total2%1000000007))
| n = int(eval(input()))
l = eval(input())
a = l.split(' ')
tmp = 0
tmp2 = 0
for i in range(n):
tmp += int(a[i])
for i in range(n):
tmp2 += int(a[i])*int(a[i])
print((int((tmp*tmp-tmp2)//2)%1000000007)) | 16 | 14 | 230 | 211 | n = int(eval(input()))
l = eval(input())
a = l.split(" ")
tmp = 0
total2 = 0
for i in range(n):
tmp += int(a[i])
for i in range(n):
total2 += int(a[i]) * (tmp - int(a[i]))
tmp -= int(a[i])
print((total2 % 1000000007))
| n = int(eval(input()))
l = eval(input())
a = l.split(" ")
tmp = 0
tmp2 = 0
for i in range(n):
tmp += int(a[i])
for i in range(n):
tmp2 += int(a[i]) * int(a[i])
print((int((tmp * tmp - tmp2) // 2) % 1000000007))
| false | 12.5 | [
"-total2 = 0",
"+tmp2 = 0",
"- total2 += int(a[i]) * (tmp - int(a[i]))",
"- tmp -= int(a[i])",
"-print((total2 % 1000000007))",
"+ tmp2 += int(a[i]) * int(a[i])",
"+print((int((tmp * tmp - tmp2) // 2) % 1000000007))"
] | false | 0.145117 | 0.037775 | 3.841591 | [
"s935126270",
"s977295837"
] |
u574464625 | p03043 | python | s974263722 | s910008589 | 67 | 52 | 3,064 | 3,064 | Accepted | Accepted | 22.39 | n,k = list(map(int, input().split()))
win=0
lose=0
COUNT=0
ans=0
for i in range(1,n+1):
if i>=k:
win=0
lose=0
win+=1
lose+=n-1
ans+=float(win/(win+lose))
elif i<k:
win=0
lose=0
count=n
win+=1
while i<k:
... | n,k = list(map(int, input().split()))
lose=0
ans=0
for i in range(1,n+1):
if i>=k:
lose=0
lose+=n
ans+=float(1/lose)
elif i<k:
lose=0
count=n
while i<k:
count*=2
i*=2
lose+=count
ans+=float(1/lose)
prin... | 27 | 20 | 424 | 320 | n, k = list(map(int, input().split()))
win = 0
lose = 0
COUNT = 0
ans = 0
for i in range(1, n + 1):
if i >= k:
win = 0
lose = 0
win += 1
lose += n - 1
ans += float(win / (win + lose))
elif i < k:
win = 0
lose = 0
count = n
win += 1
... | n, k = list(map(int, input().split()))
lose = 0
ans = 0
for i in range(1, n + 1):
if i >= k:
lose = 0
lose += n
ans += float(1 / lose)
elif i < k:
lose = 0
count = n
while i < k:
count *= 2
i *= 2
lose += count
ans += float(... | false | 25.925926 | [
"-win = 0",
"-COUNT = 0",
"- win = 0",
"- win += 1",
"- lose += n - 1",
"- ans += float(win / (win + lose))",
"+ lose += n",
"+ ans += float(1 / lose)",
"- win = 0",
"- win += 1",
"- lose = lose + count - 1",
"- ans += float... | false | 0.073261 | 0.164164 | 0.446269 | [
"s974263722",
"s910008589"
] |
u542190960 | p02688 | python | s898213018 | s957576863 | 26 | 22 | 9,284 | 9,192 | Accepted | Accepted | 15.38 | n, k = list(map(int, input().split()))
d_list = []
a_list = []
for i in range(k):
d_list.append(int(eval(input())))
a_list.append(list(map(int, input().split())))
nonhave_list = []
for j in range(n):
for l in range(k):
exist = False
if j+1 in a_list[l]:
exist = Tru... | n, k = list(map(int, input().split()))
d_list, a_list = [], []
ans_list = [1] * n
for i in range(k):
d_list.append(int(eval(input())))
a_list = list(map(int, input().split()))
for j in a_list:
if ans_list[j-1] == 1:
ans_list[j-1] = 0
print((sum(ans_list)))
| 20 | 11 | 410 | 286 | n, k = list(map(int, input().split()))
d_list = []
a_list = []
for i in range(k):
d_list.append(int(eval(input())))
a_list.append(list(map(int, input().split())))
nonhave_list = []
for j in range(n):
for l in range(k):
exist = False
if j + 1 in a_list[l]:
exist = True
... | n, k = list(map(int, input().split()))
d_list, a_list = [], []
ans_list = [1] * n
for i in range(k):
d_list.append(int(eval(input())))
a_list = list(map(int, input().split()))
for j in a_list:
if ans_list[j - 1] == 1:
ans_list[j - 1] = 0
print((sum(ans_list)))
| false | 45 | [
"-d_list = []",
"-a_list = []",
"+d_list, a_list = [], []",
"+ans_list = [1] * n",
"- a_list.append(list(map(int, input().split())))",
"-nonhave_list = []",
"-for j in range(n):",
"- for l in range(k):",
"- exist = False",
"- if j + 1 in a_list[l]:",
"- exist = Tru... | false | 0.046385 | 0.048308 | 0.960196 | [
"s898213018",
"s957576863"
] |
u512212329 | p02660 | python | s333738431 | s101146391 | 124 | 104 | 9,448 | 9,472 | Accepted | Accepted | 16.13 | from itertools import accumulate
from collections import defaultdict
def main():
n = int(eval(input()))
prime_counter = defaultdict(int)
acc = tuple(accumulate(list(range(1, 42)))) # 10^12 < 2^39
def facs():
yield 2
for x in range(10 ** 6):
yield x * 2 + 3
... | from itertools import accumulate
from collections import defaultdict
def main():
n = int(eval(input()))
prime_counter = defaultdict(int) # key ^ value
acc = tuple(accumulate(list(range(1, 42)))) # because 10^12 < 2^39
def facs():
yield 2
for x in range(10 ** 5 * 5):
... | 35 | 34 | 754 | 772 | from itertools import accumulate
from collections import defaultdict
def main():
n = int(eval(input()))
prime_counter = defaultdict(int)
acc = tuple(accumulate(list(range(1, 42)))) # 10^12 < 2^39
def facs():
yield 2
for x in range(10**6):
yield x * 2 + 3
for fac in f... | from itertools import accumulate
from collections import defaultdict
def main():
n = int(eval(input()))
prime_counter = defaultdict(int) # key ^ value
acc = tuple(accumulate(list(range(1, 42)))) # because 10^12 < 2^39
def facs():
yield 2
for x in range(10**5 * 5):
yield ... | false | 2.857143 | [
"- prime_counter = defaultdict(int)",
"- acc = tuple(accumulate(list(range(1, 42)))) # 10^12 < 2^39",
"+ prime_counter = defaultdict(int) # key ^ value",
"+ acc = tuple(accumulate(list(range(1, 42)))) # because 10^12 < 2^39",
"- for x in range(10**6):",
"+ for x in range(10**5... | false | 0.035847 | 0.271501 | 0.132034 | [
"s333738431",
"s101146391"
] |
u596276291 | p04031 | python | s319705900 | s391944742 | 33 | 26 | 3,444 | 3,316 | Accepted | Accepted | 21.21 | from collections import defaultdict
def main():
n = int(eval(input()))
l = list(map(int, input().split()))
ans = 10 ** 20
for x in range(-100, 101):
ans = min(ans, sum([(x - a) ** 2 for a in l]))
print(ans)
if __name__ == '__main__':
main()
| from collections import defaultdict
def main():
N = int(eval(input()))
a_list = list(map(int, input().split()))
ans = 10 ** 10
for m in range(min(a_list), max(a_list) + 1):
cost = sum((m - a) ** 2 for a in a_list)
ans = min(ans, cost)
print(ans)
if __name__ == '__m... | 14 | 16 | 284 | 334 | from collections import defaultdict
def main():
n = int(eval(input()))
l = list(map(int, input().split()))
ans = 10**20
for x in range(-100, 101):
ans = min(ans, sum([(x - a) ** 2 for a in l]))
print(ans)
if __name__ == "__main__":
main()
| from collections import defaultdict
def main():
N = int(eval(input()))
a_list = list(map(int, input().split()))
ans = 10**10
for m in range(min(a_list), max(a_list) + 1):
cost = sum((m - a) ** 2 for a in a_list)
ans = min(ans, cost)
print(ans)
if __name__ == "__main__":
main(... | false | 12.5 | [
"- n = int(eval(input()))",
"- l = list(map(int, input().split()))",
"- ans = 10**20",
"- for x in range(-100, 101):",
"- ans = min(ans, sum([(x - a) ** 2 for a in l]))",
"+ N = int(eval(input()))",
"+ a_list = list(map(int, input().split()))",
"+ ans = 10**10",
"+ for... | false | 0.042843 | 0.06489 | 0.660249 | [
"s319705900",
"s391944742"
] |
u476604182 | p03283 | python | s788097634 | s802068277 | 1,725 | 817 | 59,096 | 66,888 | Accepted | Accepted | 52.64 | N, M, Q = list(map(int, input().split()))
dp = [[0]*N for i in range(N)]
for i in range(M):
l, r = list(map(int, input().split()))
dp[r-1][l-1] += 1
for i in range(N):
for j in range(N-1, 0, -1):
dp[i][j-1] += dp[i][j]
for j in range(N):
for i in range(N-1):
dp[i+1][j] += dp[i][j]
for i in ra... | import numpy as np
N, M, Q, *X = list(map(int, open(0).read().split()))
sheet = [[0]*N for i in range(N)]
for l, r in zip(*[iter(X[:2*M])]*2):
sheet[N-l][r-1] += 1
sheet = np.cumsum(np.cumsum(sheet,axis=1),axis=0)
for p,q in zip(*[iter(X[2*M:])]*2):
print((sheet[N-p][q-1])) | 14 | 9 | 374 | 279 | N, M, Q = list(map(int, input().split()))
dp = [[0] * N for i in range(N)]
for i in range(M):
l, r = list(map(int, input().split()))
dp[r - 1][l - 1] += 1
for i in range(N):
for j in range(N - 1, 0, -1):
dp[i][j - 1] += dp[i][j]
for j in range(N):
for i in range(N - 1):
dp[i + 1][j] += d... | import numpy as np
N, M, Q, *X = list(map(int, open(0).read().split()))
sheet = [[0] * N for i in range(N)]
for l, r in zip(*[iter(X[: 2 * M])] * 2):
sheet[N - l][r - 1] += 1
sheet = np.cumsum(np.cumsum(sheet, axis=1), axis=0)
for p, q in zip(*[iter(X[2 * M :])] * 2):
print((sheet[N - p][q - 1]))
| false | 35.714286 | [
"-N, M, Q = list(map(int, input().split()))",
"-dp = [[0] * N for i in range(N)]",
"-for i in range(M):",
"- l, r = list(map(int, input().split()))",
"- dp[r - 1][l - 1] += 1",
"-for i in range(N):",
"- for j in range(N - 1, 0, -1):",
"- dp[i][j - 1] += dp[i][j]",
"-for j in range(N)... | false | 0.113988 | 0.207878 | 0.548341 | [
"s788097634",
"s802068277"
] |
u600402037 | p02984 | python | s395162885 | s344603185 | 725 | 630 | 23,100 | 23,108 | Accepted | Accepted | 13.1 | import sys
import numpy as np
sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
N = ir()
A = np.array(lr())
sum_water = A.sum()
A *= 2
m1 = sum_water - A[1::2].sum() # 山1に降った水
print(m1, end=' ')
cur = m1
for a in A[:-1]:
print(a - cur, end='... | import sys
import numpy as np
sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
N = ir()
A = np.array(lr())
total = A.sum()
answer = [0] * N
answer[0] = total - A[1::2].sum() * 2
A = A.tolist()
for i in range(1, N):
answer[i] = A[i-1]*2 - a... | 18 | 17 | 348 | 346 | import sys
import numpy as np
sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
N = ir()
A = np.array(lr())
sum_water = A.sum()
A *= 2
m1 = sum_water - A[1::2].sum() # 山1に降った水
print(m1, end=" ")
cur = m1
for a in A[:-1]:
print(a - cur, end=" ")
cur = a... | import sys
import numpy as np
sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
N = ir()
A = np.array(lr())
total = A.sum()
answer = [0] * N
answer[0] = total - A[1::2].sum() * 2
A = A.tolist()
for i in range(1, N):
answer[i] = A[i - 1] * 2 - answer[i - 1]
... | false | 5.555556 | [
"-sum_water = A.sum()",
"-A *= 2",
"-m1 = sum_water - A[1::2].sum() # 山1に降った水",
"-print(m1, end=\" \")",
"-cur = m1",
"-for a in A[:-1]:",
"- print(a - cur, end=\" \")",
"- cur = a - cur",
"-# 20",
"+total = A.sum()",
"+answer = [0] * N",
"+answer[0] = total - A[1::2].sum() * 2",
"+A ... | false | 0.625843 | 0.588567 | 1.063332 | [
"s395162885",
"s344603185"
] |
u895515293 | p03112 | python | s676981992 | s707801725 | 1,041 | 902 | 16,168 | 16,288 | Accepted | Accepted | 13.35 | from bisect import bisect
num_a,num_b,num_q = list(map(int, input().split(' ')))
lsa = [int(eval(input())) for _ in range(num_a)]
lsb = [int(eval(input())) for _ in range(num_b)]
lsa.sort()
lsb.sort()
# print(lsa)
# print(lsb)
lsq = [int(eval(input())) for _ in range(num_q)]
for ques in lsq:
lower_b... | from bisect import bisect
LONG_MIN = -9223372036854775808
LONG_MAX = 9223372036854775807
num_a,num_b,num_q = list(map(int, input().split(' ')))
lsa = [int(eval(input())) for _ in range(num_a)] + [LONG_MIN, LONG_MAX]
lsb = [int(eval(input())) for _ in range(num_b)] + [LONG_MIN, LONG_MAX]
lsa.sort()
lsb.sort()
... | 37 | 27 | 1,341 | 1,003 | from bisect import bisect
num_a, num_b, num_q = list(map(int, input().split(" ")))
lsa = [int(eval(input())) for _ in range(num_a)]
lsb = [int(eval(input())) for _ in range(num_b)]
lsa.sort()
lsb.sort()
# print(lsa)
# print(lsb)
lsq = [int(eval(input())) for _ in range(num_q)]
for ques in lsq:
lower_bound_a = bise... | from bisect import bisect
LONG_MIN = -9223372036854775808
LONG_MAX = 9223372036854775807
num_a, num_b, num_q = list(map(int, input().split(" ")))
lsa = [int(eval(input())) for _ in range(num_a)] + [LONG_MIN, LONG_MAX]
lsb = [int(eval(input())) for _ in range(num_b)] + [LONG_MIN, LONG_MAX]
lsa.sort()
lsb.sort()
lsq = [... | false | 27.027027 | [
"+LONG_MIN = -9223372036854775808",
"+LONG_MAX = 9223372036854775807",
"-lsa = [int(eval(input())) for _ in range(num_a)]",
"-lsb = [int(eval(input())) for _ in range(num_b)]",
"+lsa = [int(eval(input())) for _ in range(num_a)] + [LONG_MIN, LONG_MAX]",
"+lsb = [int(eval(input())) for _ in range(num_b)] + ... | false | 0.041135 | 0.040582 | 1.013623 | [
"s676981992",
"s707801725"
] |
u930705402 | p03053 | python | s875991437 | s650320738 | 742 | 668 | 175,964 | 176,092 | Accepted | Accepted | 9.97 | from collections import deque
def mbfs(S,H,W):
dxy=[[1,0],[0,1],[-1,0],[0,-1]]
while(len(d)!=0):
h,w,x=d.popleft()
for t,y in dxy:
if(0<=h+t<=H-1 and 0<=w+y<=W-1 and S[h+t][w+y]!='#'):
S[h+t][w+y]='#'
d.append([h+t,w+y,x+1])
return x
H,W=... | from collections import deque
def mbfs(S,H,W,d):
dx=[1,0,-1,0]
dy=[0,1,0,-1]
while(len(d)!=0):
h=d[0][0]
w=d[0][1]
x=d[0][2]
d.popleft()
for di in range(4):
nh=h+dx[di]
nw=w+dy[di]
if(nh>H-1 or nh<0 or nw>W-1 or nw<0):
... | 18 | 27 | 514 | 682 | from collections import deque
def mbfs(S, H, W):
dxy = [[1, 0], [0, 1], [-1, 0], [0, -1]]
while len(d) != 0:
h, w, x = d.popleft()
for t, y in dxy:
if 0 <= h + t <= H - 1 and 0 <= w + y <= W - 1 and S[h + t][w + y] != "#":
S[h + t][w + y] = "#"
d.app... | from collections import deque
def mbfs(S, H, W, d):
dx = [1, 0, -1, 0]
dy = [0, 1, 0, -1]
while len(d) != 0:
h = d[0][0]
w = d[0][1]
x = d[0][2]
d.popleft()
for di in range(4):
nh = h + dx[di]
nw = w + dy[di]
if nh > H - 1 or nh <... | false | 33.333333 | [
"-def mbfs(S, H, W):",
"- dxy = [[1, 0], [0, 1], [-1, 0], [0, -1]]",
"+def mbfs(S, H, W, d):",
"+ dx = [1, 0, -1, 0]",
"+ dy = [0, 1, 0, -1]",
"- h, w, x = d.popleft()",
"- for t, y in dxy:",
"- if 0 <= h + t <= H - 1 and 0 <= w + y <= W - 1 and S[h + t][w + y] != \"#... | false | 0.049314 | 0.049682 | 0.992609 | [
"s875991437",
"s650320738"
] |
u260216890 | p02762 | python | s953226618 | s230129324 | 1,415 | 958 | 93,164 | 45,276 | Accepted | Accepted | 32.3 | N,M,K=list(map(int, input().split()))
class UnionFind(object):
def __init__(self, n=1):
self.par = [i for i in range(n)]
self.rank = [0 for _ in range(n)]
def find(self, x):
if self.par[x] == x:
return x
else:
self.par[x] = self.find(self.par[... | import sys
from collections import defaultdict
sys.setrecursionlimit(10 ** 6)
n,m,k=list(map(int, input().split()))
friend=[[] for _ in range(n)]
for i in range(m):
a,b=list(map(int, input().split()))
friend[a-1].append(b-1)
friend[b-1].append(a-1)
par=[None]*n
frmember=defaultdict(int)
... | 53 | 40 | 1,252 | 804 | N, M, K = list(map(int, input().split()))
class UnionFind(object):
def __init__(self, n=1):
self.par = [i for i in range(n)]
self.rank = [0 for _ in range(n)]
def find(self, x):
if self.par[x] == x:
return x
else:
self.par[x] = self.find(self.par[x])
... | import sys
from collections import defaultdict
sys.setrecursionlimit(10**6)
n, m, k = list(map(int, input().split()))
friend = [[] for _ in range(n)]
for i in range(m):
a, b = list(map(int, input().split()))
friend[a - 1].append(b - 1)
friend[b - 1].append(a - 1)
par = [None] * n
frmember = defaultdict(int... | false | 24.528302 | [
"-N, M, K = list(map(int, input().split()))",
"+import sys",
"+from collections import defaultdict",
"+",
"+sys.setrecursionlimit(10**6)",
"+n, m, k = list(map(int, input().split()))",
"+friend = [[] for _ in range(n)]",
"+for i in range(m):",
"+ a, b = list(map(int, input().split()))",
"+ f... | false | 0.038319 | 0.061341 | 0.624687 | [
"s953226618",
"s230129324"
] |
u545368057 | p03835 | python | s076577283 | s980353464 | 1,977 | 998 | 3,060 | 9,072 | Accepted | Accepted | 49.52 | K,S = list(map(int, input().split()))
ans = 0
for x in range(K+1):
for y in range(K+1):
if S - (x + y) <= K and S - (x+y) >= 0:
ans += 1
print(ans) | k, s = list(map(int, input().split()))
ans = 0
for i in range(k+1):
for j in range(k+1):
if 0 <= s-i-j <= k:
ans += 1
print(ans) | 8 | 7 | 174 | 152 | K, S = list(map(int, input().split()))
ans = 0
for x in range(K + 1):
for y in range(K + 1):
if S - (x + y) <= K and S - (x + y) >= 0:
ans += 1
print(ans)
| k, s = list(map(int, input().split()))
ans = 0
for i in range(k + 1):
for j in range(k + 1):
if 0 <= s - i - j <= k:
ans += 1
print(ans)
| false | 12.5 | [
"-K, S = list(map(int, input().split()))",
"+k, s = list(map(int, input().split()))",
"-for x in range(K + 1):",
"- for y in range(K + 1):",
"- if S - (x + y) <= K and S - (x + y) >= 0:",
"+for i in range(k + 1):",
"+ for j in range(k + 1):",
"+ if 0 <= s - i - j <= k:"
] | false | 0.076595 | 0.036571 | 2.094427 | [
"s076577283",
"s980353464"
] |
u780962115 | p02763 | python | s895519982 | s855134863 | 1,278 | 1,107 | 604,848 | 391,728 | Accepted | Accepted | 13.38 | class SegTree():
def __init__(self, lists, function, basement):
self.n = len(lists)
self.K = (self.n-1).bit_length()
self.func = function
self.basement = basement
self.seg = [basement]*2**(self.K+1)
self.lazy_seg = [basement]*2**(self.K+1)
X=2**self.K
... | class SegTree():
def __init__(self, lists, function, basement):
self.n = len(lists)
self.K = (self.n-1).bit_length()
self.func = function
self.basement = basement
self.seg = [basement]*(2**(self.K+1))
X=2**self.K
for i,v in enumerate(lists):
... | 76 | 75 | 2,072 | 1,961 | class SegTree:
def __init__(self, lists, function, basement):
self.n = len(lists)
self.K = (self.n - 1).bit_length()
self.func = function
self.basement = basement
self.seg = [basement] * 2 ** (self.K + 1)
self.lazy_seg = [basement] * 2 ** (self.K + 1)
X = 2**s... | class SegTree:
def __init__(self, lists, function, basement):
self.n = len(lists)
self.K = (self.n - 1).bit_length()
self.func = function
self.basement = basement
self.seg = [basement] * (2 ** (self.K + 1))
X = 2**self.K
for i, v in enumerate(lists):
... | false | 1.315789 | [
"- self.seg = [basement] * 2 ** (self.K + 1)",
"- self.lazy_seg = [basement] * 2 ** (self.K + 1)",
"+ self.seg = [basement] * (2 ** (self.K + 1))",
"- # 0-indexでa[k]の値をvalueに変更",
"- # 0-indexで[p,q)の値を取得する"
] | false | 0.037105 | 0.068869 | 0.53877 | [
"s895519982",
"s855134863"
] |
u644907318 | p03379 | python | s365812812 | s978389827 | 424 | 195 | 95,188 | 104,220 | Accepted | Accepted | 54.01 | N = int(eval(input()))
X = list(map(int,input().split()))
A = sorted(X[:])
B = A[N//2-1]
for i in range(N):
if X[i]>B:
print(B)
else:
print((A[N//2])) | N = int(eval(input()))
X = list(map(int,input().split()))
Y = sorted(X[:])
Y1 = Y[N//2-1]
Y2 = Y[N//2]
for i in range(N):
if X[i]>Y1:
print(Y1)
else:
print(Y2) | 9 | 10 | 174 | 186 | N = int(eval(input()))
X = list(map(int, input().split()))
A = sorted(X[:])
B = A[N // 2 - 1]
for i in range(N):
if X[i] > B:
print(B)
else:
print((A[N // 2]))
| N = int(eval(input()))
X = list(map(int, input().split()))
Y = sorted(X[:])
Y1 = Y[N // 2 - 1]
Y2 = Y[N // 2]
for i in range(N):
if X[i] > Y1:
print(Y1)
else:
print(Y2)
| false | 10 | [
"-A = sorted(X[:])",
"-B = A[N // 2 - 1]",
"+Y = sorted(X[:])",
"+Y1 = Y[N // 2 - 1]",
"+Y2 = Y[N // 2]",
"- if X[i] > B:",
"- print(B)",
"+ if X[i] > Y1:",
"+ print(Y1)",
"- print((A[N // 2]))",
"+ print(Y2)"
] | false | 0.007526 | 0.038605 | 0.194955 | [
"s365812812",
"s978389827"
] |
u684120680 | p03637 | python | s924289709 | s745681249 | 68 | 52 | 14,252 | 11,100 | Accepted | Accepted | 23.53 | n = int(eval(input()))
a = [int(i) for i in input().split()]
cnt_4 = sum(i%4==0 for i in a)
cnt_2 = sum(i%2==0 for i in a) - cnt_4
cnt_0 = n - cnt_4 - cnt_2
if cnt_2 == 0:
if cnt_4 >= cnt_0-1:
print('Yes')
else:
print('No')
else:
if cnt_4 >= cnt_0:
print('Yes')
else:
print('No'... | n = int(eval(input()))
a = [int(i)%4 for i in input().split()]
cnt_4 = a.count(0)
cnt_2 = a.count(2)
cnt_0 = n - cnt_4 - cnt_2
if cnt_2 == 0:
if cnt_4 >= cnt_0-1:
print('Yes')
else:
print('No')
else:
if cnt_4 >= cnt_0:
print('Yes')
else:
print('No')
| 18 | 18 | 321 | 291 | n = int(eval(input()))
a = [int(i) for i in input().split()]
cnt_4 = sum(i % 4 == 0 for i in a)
cnt_2 = sum(i % 2 == 0 for i in a) - cnt_4
cnt_0 = n - cnt_4 - cnt_2
if cnt_2 == 0:
if cnt_4 >= cnt_0 - 1:
print("Yes")
else:
print("No")
else:
if cnt_4 >= cnt_0:
print("Yes")
else:
... | n = int(eval(input()))
a = [int(i) % 4 for i in input().split()]
cnt_4 = a.count(0)
cnt_2 = a.count(2)
cnt_0 = n - cnt_4 - cnt_2
if cnt_2 == 0:
if cnt_4 >= cnt_0 - 1:
print("Yes")
else:
print("No")
else:
if cnt_4 >= cnt_0:
print("Yes")
else:
print("No")
| false | 0 | [
"-a = [int(i) for i in input().split()]",
"-cnt_4 = sum(i % 4 == 0 for i in a)",
"-cnt_2 = sum(i % 2 == 0 for i in a) - cnt_4",
"+a = [int(i) % 4 for i in input().split()]",
"+cnt_4 = a.count(0)",
"+cnt_2 = a.count(2)"
] | false | 0.038968 | 0.043364 | 0.89862 | [
"s924289709",
"s745681249"
] |
u072053884 | p02315 | python | s182935329 | s313439578 | 550 | 450 | 44,076 | 7,968 | Accepted | Accepted | 18.18 | def knapsack(items, num, weight):
r = weight + 1
C = [[0] * r for i in range(num + 1)]
for i, item in enumerate(items, start=1):
item_v, item_w = item
for w in range(1, r):
if item_w <= w:
v1 = item_v + C[i - 1][w - item_w]
v2 = C[i -... | def knapsack(items, num, weight):
C = [0] * (weight + 1)
for i in items:
item_v, item_w = i
for w in range(weight, 0, -1):
if item_w <= w:
v1 = item_v + C[w - item_w]
v2 = C[w]
C[w] = max(v1, v2)
return C[weight]
import ... | 26 | 22 | 639 | 503 | def knapsack(items, num, weight):
r = weight + 1
C = [[0] * r for i in range(num + 1)]
for i, item in enumerate(items, start=1):
item_v, item_w = item
for w in range(1, r):
if item_w <= w:
v1 = item_v + C[i - 1][w - item_w]
v2 = C[i - 1][w]
... | def knapsack(items, num, weight):
C = [0] * (weight + 1)
for i in items:
item_v, item_w = i
for w in range(weight, 0, -1):
if item_w <= w:
v1 = item_v + C[w - item_w]
v2 = C[w]
C[w] = max(v1, v2)
return C[weight]
import sys
file_... | false | 15.384615 | [
"- r = weight + 1",
"- C = [[0] * r for i in range(num + 1)]",
"- for i, item in enumerate(items, start=1):",
"- item_v, item_w = item",
"- for w in range(1, r):",
"+ C = [0] * (weight + 1)",
"+ for i in items:",
"+ item_v, item_w = i",
"+ for w in range(we... | false | 0.039263 | 0.078477 | 0.500306 | [
"s182935329",
"s313439578"
] |
u394721319 | p02995 | python | s116078360 | s866741023 | 175 | 36 | 38,384 | 5,076 | Accepted | Accepted | 79.43 | A,B,C,D = [int(i) for i in input().split()]
def gcd(a,b):
while b!=0:
a,b=b,a%b
return a
def lcm(a,b):
return a*b//gcd(a,b)
E = lcm(C,D)
p = B-A+1
ac = p//C
if A%C+p%C >= C+1:
ac += 1
ad = p//D
if A%D+p%D >= D+1:
ad += 1
ae = p//E
if A%E+p%E >= E+1:
ae += 1... | from fractions import gcd
def lcm(a,b):
return a*b//gcd(a,b)
A,B,C,D = [int(zz) for zz in input().split()]
bc = B//C
ac = (A-1)//C
bd = B//D
ad = (A-1)//D
bcd = B//lcm(C,D)
acd = (A-1)//lcm(C,D)
print((B-A-bc+ac-bd+ad+bcd-acd+1))
| 27 | 15 | 344 | 250 | A, B, C, D = [int(i) for i in input().split()]
def gcd(a, b):
while b != 0:
a, b = b, a % b
return a
def lcm(a, b):
return a * b // gcd(a, b)
E = lcm(C, D)
p = B - A + 1
ac = p // C
if A % C + p % C >= C + 1:
ac += 1
ad = p // D
if A % D + p % D >= D + 1:
ad += 1
ae = p // E
if A % E +... | from fractions import gcd
def lcm(a, b):
return a * b // gcd(a, b)
A, B, C, D = [int(zz) for zz in input().split()]
bc = B // C
ac = (A - 1) // C
bd = B // D
ad = (A - 1) // D
bcd = B // lcm(C, D)
acd = (A - 1) // lcm(C, D)
print((B - A - bc + ac - bd + ad + bcd - acd + 1))
| false | 44.444444 | [
"-A, B, C, D = [int(i) for i in input().split()]",
"-",
"-",
"-def gcd(a, b):",
"- while b != 0:",
"- a, b = b, a % b",
"- return a",
"+from fractions import gcd",
"-E = lcm(C, D)",
"-p = B - A + 1",
"-ac = p // C",
"-if A % C + p % C >= C + 1:",
"- ac += 1",
"-ad = p // D"... | false | 0.035851 | 0.046112 | 0.777473 | [
"s116078360",
"s866741023"
] |
u745514010 | p03640 | python | s945037631 | s673816968 | 40 | 36 | 9,640 | 9,280 | Accepted | Accepted | 10 | h, w = list(map(int, input().split()))
n = int(eval(input()))
alst = list(map(int, input().split()))
c = [[0 for _ in range(w)] for _ in range(h)]
num = 0
apos = 0
for pos in range(h * w):
x = pos // w
y = pos % w
if x % 2 == 1:
y = w - y - 1
c[x][y] = apos + 1
num += 1
... | h, w = list(map(int, input().split()))
n = int(eval(input()))
alst = list(map(int, input().split()))
cnt = 0
pos = 0
rev = False
for i in range(h):
ans = [0 for _ in range(w)]
for j in range(w):
if rev:
ans[w - 1 - j] = pos + 1
else:
ans[j] = pos + 1
... | 20 | 22 | 397 | 471 | h, w = list(map(int, input().split()))
n = int(eval(input()))
alst = list(map(int, input().split()))
c = [[0 for _ in range(w)] for _ in range(h)]
num = 0
apos = 0
for pos in range(h * w):
x = pos // w
y = pos % w
if x % 2 == 1:
y = w - y - 1
c[x][y] = apos + 1
num += 1
if alst[apos] == ... | h, w = list(map(int, input().split()))
n = int(eval(input()))
alst = list(map(int, input().split()))
cnt = 0
pos = 0
rev = False
for i in range(h):
ans = [0 for _ in range(w)]
for j in range(w):
if rev:
ans[w - 1 - j] = pos + 1
else:
ans[j] = pos + 1
cnt += 1
... | false | 9.090909 | [
"-c = [[0 for _ in range(w)] for _ in range(h)]",
"-num = 0",
"-apos = 0",
"-for pos in range(h * w):",
"- x = pos // w",
"- y = pos % w",
"- if x % 2 == 1:",
"- y = w - y - 1",
"- c[x][y] = apos + 1",
"- num += 1",
"- if alst[apos] == num:",
"- apos += 1",
"-... | false | 0.036495 | 0.039283 | 0.929024 | [
"s945037631",
"s673816968"
] |
u046187684 | p03044 | python | s672350299 | s830393097 | 656 | 473 | 38,828 | 50,292 | Accepted | Accepted | 27.9 | N=int(eval(input()));p=[[]for _ in range(N+1)]
for _ in range(N-1):u,v,w=list(map(int,input().split()));p[u].append((v,w));p[v].append((u,w))
s=[(1,0)];l=[-1]*N
while s:
a,w=s.pop()
l[a-1]=w%2
for b,c in p[a]:
if l[b-1]==-1:s.append((b,w+c))
for i in l:print(i)
| def solve(string):
n, *uvw = list(map(int, string.split()))
p = [[] for _ in range(n + 1)]
for u, v, w in zip(uvw[::3], uvw[1::3], uvw[2::3]):
p[u].append((v, w))
p[v].append((u, w))
s = [(1, 0)]
l = [-1] * n
while s:
a, w = s.pop()
l[a - 1] = w % 2
... | 9 | 20 | 263 | 583 | N = int(eval(input()))
p = [[] for _ in range(N + 1)]
for _ in range(N - 1):
u, v, w = list(map(int, input().split()))
p[u].append((v, w))
p[v].append((u, w))
s = [(1, 0)]
l = [-1] * N
while s:
a, w = s.pop()
l[a - 1] = w % 2
for b, c in p[a]:
if l[b - 1] == -1:
s.append((b, ... | def solve(string):
n, *uvw = list(map(int, string.split()))
p = [[] for _ in range(n + 1)]
for u, v, w in zip(uvw[::3], uvw[1::3], uvw[2::3]):
p[u].append((v, w))
p[v].append((u, w))
s = [(1, 0)]
l = [-1] * n
while s:
a, w = s.pop()
l[a - 1] = w % 2
for b,... | false | 55 | [
"-N = int(eval(input()))",
"-p = [[] for _ in range(N + 1)]",
"-for _ in range(N - 1):",
"- u, v, w = list(map(int, input().split()))",
"- p[u].append((v, w))",
"- p[v].append((u, w))",
"-s = [(1, 0)]",
"-l = [-1] * N",
"-while s:",
"- a, w = s.pop()",
"- l[a - 1] = w % 2",
"- ... | false | 0.049305 | 0.11907 | 0.414088 | [
"s672350299",
"s830393097"
] |
u377989038 | p03111 | python | s059197522 | s018417960 | 329 | 74 | 3,064 | 3,192 | Accepted | Accepted | 77.51 | from itertools import product
n, a, b, c = list(map(int, input().split()))
l = [int(eval(input())) for _ in range(n)]
ans = 10 ** 10
for bit in product([0, 1, 2, 3], repeat=n):
tmp = [0] * 4
mp = 0
for i, j in enumerate(bit):
if j != 3 and tmp[j] != 0:
mp += 10
tmp[... | # dfs版
def dfs(d, A, B, C, f):
global ans
if d == n:
if not 0 in [A, B, C]:
ans = min(ans, abs(a - A) + abs(b - B) + abs(c - C) + f - 30)
return
dfs(d + 1, A, B, C, f)
dfs(d + 1, A + l[d], B, C, f + 10)
dfs(d + 1, A, B + l[d], C, f + 10)
dfs(d + 1, A, B, C +... | 18 | 18 | 476 | 465 | from itertools import product
n, a, b, c = list(map(int, input().split()))
l = [int(eval(input())) for _ in range(n)]
ans = 10**10
for bit in product([0, 1, 2, 3], repeat=n):
tmp = [0] * 4
mp = 0
for i, j in enumerate(bit):
if j != 3 and tmp[j] != 0:
mp += 10
tmp[j] += l[i]
... | # dfs版
def dfs(d, A, B, C, f):
global ans
if d == n:
if not 0 in [A, B, C]:
ans = min(ans, abs(a - A) + abs(b - B) + abs(c - C) + f - 30)
return
dfs(d + 1, A, B, C, f)
dfs(d + 1, A + l[d], B, C, f + 10)
dfs(d + 1, A, B + l[d], C, f + 10)
dfs(d + 1, A, B, C + l[d], f +... | false | 0 | [
"-from itertools import product",
"+# dfs版",
"+def dfs(d, A, B, C, f):",
"+ global ans",
"+ if d == n:",
"+ if not 0 in [A, B, C]:",
"+ ans = min(ans, abs(a - A) + abs(b - B) + abs(c - C) + f - 30)",
"+ return",
"+ dfs(d + 1, A, B, C, f)",
"+ dfs(d + 1, A + l[d... | false | 0.683577 | 0.079261 | 8.624402 | [
"s059197522",
"s018417960"
] |
u028014940 | p02725 | python | s637685022 | s531236913 | 213 | 135 | 26,420 | 26,444 | Accepted | Accepted | 36.62 |
K, N = list(map(int, input().split()))
A = list(map(int, input().split()))
lst = []
for i in range(1, N-1):
diff_1 = abs(A[i + 1] - A[i])
lst.append(diff_1)
diff_2 = abs(A[i] - A[i - 1])
lst.append(diff_2)
lst.append
lst.append(K + A[0] - A[N-1])
print((K - max(lst))) |
K, N = list(map(int, input().split()))
A = list(map(int, input().split()))
lst = []
for i in range(1, N-1):
diff_1 = abs(A[i + 1] - A[i])
lst.append(diff_1)
lst.append(K + A[0] - A[N-1])
print((K - max(lst))) | 13 | 10 | 290 | 219 | K, N = list(map(int, input().split()))
A = list(map(int, input().split()))
lst = []
for i in range(1, N - 1):
diff_1 = abs(A[i + 1] - A[i])
lst.append(diff_1)
diff_2 = abs(A[i] - A[i - 1])
lst.append(diff_2)
lst.append
lst.append(K + A[0] - A[N - 1])
print((K - max(lst)))
| K, N = list(map(int, input().split()))
A = list(map(int, input().split()))
lst = []
for i in range(1, N - 1):
diff_1 = abs(A[i + 1] - A[i])
lst.append(diff_1)
lst.append(K + A[0] - A[N - 1])
print((K - max(lst)))
| false | 23.076923 | [
"- diff_2 = abs(A[i] - A[i - 1])",
"- lst.append(diff_2)",
"-lst.append"
] | false | 0.141563 | 0.03851 | 3.675961 | [
"s637685022",
"s531236913"
] |
u271934630 | p03633 | python | s625916137 | s653602313 | 336 | 23 | 66,156 | 3,572 | Accepted | Accepted | 93.15 | from functools import reduce
from fractions import gcd
def lcm(x, y):
return x * y // gcd(x, y)
n = int(eval(input()))
t = [int(eval(input())) for _ in range(n)]
print((reduce(lcm, t)))
| import sys
stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)
from functools import reduce
i_i = lambda: int(i_s())
i_l = lambda: list(map(int, stdin.readline().split()))
i_s = lambda: stdin.readline().rstrip()
def gcd(a,b):
while b:
a, b = b, a%b
return a
def lcm(a,b):
return a*b//g... | 12 | 24 | 192 | 443 | from functools import reduce
from fractions import gcd
def lcm(x, y):
return x * y // gcd(x, y)
n = int(eval(input()))
t = [int(eval(input())) for _ in range(n)]
print((reduce(lcm, t)))
| import sys
stdin = sys.stdin
sys.setrecursionlimit(10**7)
from functools import reduce
i_i = lambda: int(i_s())
i_l = lambda: list(map(int, stdin.readline().split()))
i_s = lambda: stdin.readline().rstrip()
def gcd(a, b):
while b:
a, b = b, a % b
return a
def lcm(a, b):
return a * b // gcd(a, ... | false | 50 | [
"+import sys",
"+",
"+stdin = sys.stdin",
"+sys.setrecursionlimit(10**7)",
"-from fractions import gcd",
"+",
"+i_i = lambda: int(i_s())",
"+i_l = lambda: list(map(int, stdin.readline().split()))",
"+i_s = lambda: stdin.readline().rstrip()",
"-def lcm(x, y):",
"- return x * y // gcd(x, y)",
... | false | 0.053904 | 0.036752 | 1.466715 | [
"s625916137",
"s653602313"
] |
u744034042 | p03031 | python | s705101555 | s470916663 | 49 | 45 | 9,216 | 9,148 | Accepted | Accepted | 8.16 | n,m=list(map(int,input().split()))
comb = []
for _ in range(m):
comb.append(list(map(int,input().split()))[1:])
point = list(map(int,input().split()))
ans = 0
for i in range(2**n): #スイッチのon/offの組み合わせは2**n通りある
on = [0]*m
for j in range(n): #それぞれ何個めがonになっているか調べる
if (i>>j)&1: #j個目がonになっているとき
... | n,m=list(map(int,input().split()))
comb = []
for _ in range(m):
comb.append(list(map(int,input().split()))[1:])
point = list(map(int,input().split()))
ans = 0
for i in range(2**n): #スイッチのon/offの組み合わせは2**n通りある
on = [0]*m
for j in range(n): #それぞれ何個めがonになっているか調べる
if (i>>j)&1: #j個目がonになっているとき
... | 17 | 17 | 661 | 632 | n, m = list(map(int, input().split()))
comb = []
for _ in range(m):
comb.append(list(map(int, input().split()))[1:])
point = list(map(int, input().split()))
ans = 0
for i in range(2**n): # スイッチのon/offの組み合わせは2**n通りある
on = [0] * m
for j in range(n): # それぞれ何個めがonになっているか調べる
if (i >> j) & 1: # j個目がonに... | n, m = list(map(int, input().split()))
comb = []
for _ in range(m):
comb.append(list(map(int, input().split()))[1:])
point = list(map(int, input().split()))
ans = 0
for i in range(2**n): # スイッチのon/offの組み合わせは2**n通りある
on = [0] * m
for j in range(n): # それぞれ何個めがonになっているか調べる
if (i >> j) & 1: # j個目がonに... | false | 0 | [
"- if all(point[l] == on[l] for l in range(m)): # もしこの組み合わせのon/offパターンが所与の条件に一致するなら",
"+ if point == on: # もしこの組み合わせのon/offパターンが所与の条件に一致するなら"
] | false | 0.04645 | 0.058395 | 0.79544 | [
"s705101555",
"s470916663"
] |
u137912513 | p02861 | python | s126784777 | s574813308 | 433 | 194 | 8,052 | 45,680 | Accepted | Accepted | 55.2 | import itertools as it
n = int(eval(input()))
zahyou = []
for i in range(n):
x,y = list(map(int, input().split()))
zahyou.append((x,y))
perm = list(it.permutations(list(range(n)),n))
ans = 0
for zyu in perm:
for i in range(n-1):
ans += ((zahyou[zyu[i]][0] - zahyou[zyu[i+1]][0])**2 +(zahyou... | import math
n = int(eval(input()))
dist = [[0]*n for _ in range(n)]
pos = [tuple(map(int, input().split())) for _ in range(n)]
for i in range(n):
for j in range(n):
dist[i][j] = ((pos[i][0] - pos[j][0])**2 + (pos[i][1] - pos[j][1])**2)**0.5
from itertools import permutations
per = list(permutations(... | 13 | 15 | 375 | 473 | import itertools as it
n = int(eval(input()))
zahyou = []
for i in range(n):
x, y = list(map(int, input().split()))
zahyou.append((x, y))
perm = list(it.permutations(list(range(n)), n))
ans = 0
for zyu in perm:
for i in range(n - 1):
ans += (
(zahyou[zyu[i]][0] - zahyou[zyu[i + 1]][0]) ... | import math
n = int(eval(input()))
dist = [[0] * n for _ in range(n)]
pos = [tuple(map(int, input().split())) for _ in range(n)]
for i in range(n):
for j in range(n):
dist[i][j] = (
(pos[i][0] - pos[j][0]) ** 2 + (pos[i][1] - pos[j][1]) ** 2
) ** 0.5
from itertools import permutations
... | false | 13.333333 | [
"-import itertools as it",
"+import math",
"-zahyou = []",
"+dist = [[0] * n for _ in range(n)]",
"+pos = [tuple(map(int, input().split())) for _ in range(n)]",
"- x, y = list(map(int, input().split()))",
"- zahyou.append((x, y))",
"-perm = list(it.permutations(list(range(n)), n))",
"-ans = 0"... | false | 0.040284 | 0.03893 | 1.034771 | [
"s126784777",
"s574813308"
] |
u368249389 | p02695 | python | s502811347 | s356734267 | 717 | 640 | 9,136 | 9,200 | Accepted | Accepted | 10.74 | # Problem C - Many Requirements
# input
N, M, Q = list(map(int, input().split()))
q_list = []
for i in range(Q):
a, b, c, d = list(map(int, input().split()))
q_list.append([a, b, c, d])
# initialization
max_ans = 0
# dfs search
def dfs_score(a_list, p, n, max_ans):
if p==N:
tmp_sco... | # Problem C - Many Requirements
# input
N, M, Q = list(map(int, input().split()))
query = []
for i in range(Q):
a, b, c, d = list(map(int, input().split()))
query.append([a, b, c, d])
# dfs search
def dfs(nums, score, ini_num, keta):
if keta==N+1:
tmp_score = 0
for q in query:... | 30 | 30 | 709 | 706 | # Problem C - Many Requirements
# input
N, M, Q = list(map(int, input().split()))
q_list = []
for i in range(Q):
a, b, c, d = list(map(int, input().split()))
q_list.append([a, b, c, d])
# initialization
max_ans = 0
# dfs search
def dfs_score(a_list, p, n, max_ans):
if p == N:
tmp_score = 0
f... | # Problem C - Many Requirements
# input
N, M, Q = list(map(int, input().split()))
query = []
for i in range(Q):
a, b, c, d = list(map(int, input().split()))
query.append([a, b, c, d])
# dfs search
def dfs(nums, score, ini_num, keta):
if keta == N + 1:
tmp_score = 0
for q in query:
... | false | 0 | [
"-q_list = []",
"+query = []",
"- q_list.append([a, b, c, d])",
"-# initialization",
"-max_ans = 0",
"+ query.append([a, b, c, d])",
"-def dfs_score(a_list, p, n, max_ans):",
"- if p == N:",
"+def dfs(nums, score, ini_num, keta):",
"+ if keta == N + 1:",
"- for q in q_list:",
... | false | 0.048936 | 0.05277 | 0.927339 | [
"s502811347",
"s356734267"
] |
u642883360 | p02701 | python | s893837684 | s925319679 | 280 | 257 | 114,096 | 111,028 | Accepted | Accepted | 8.21 | n = int(eval(input()))
S = [eval(input()) for i in range(n)]
S = list(set(S))
print((len(S))) | n = int(eval(input()))
S = [eval(input()) for i in range(n)]
print((len(set(S)))) | 4 | 3 | 82 | 69 | n = int(eval(input()))
S = [eval(input()) for i in range(n)]
S = list(set(S))
print((len(S)))
| n = int(eval(input()))
S = [eval(input()) for i in range(n)]
print((len(set(S))))
| false | 25 | [
"-S = list(set(S))",
"-print((len(S)))",
"+print((len(set(S))))"
] | false | 0.046298 | 0.047905 | 0.966452 | [
"s893837684",
"s925319679"
] |
u489959379 | p02866 | python | s535585915 | s195030076 | 279 | 124 | 57,644 | 20,696 | Accepted | Accepted | 55.56 | import sys
sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 998244353
def resolve():
n = int(eval(input()))
D = list(map(int, input().split()))
tree = [0 for _ in range(max(D) + 1)]
for i in range(n):
idx = D[i]
tree[idx] += 1
if D[0] != 0 or tree[0] != ... | import sys
sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 998244353
def resolve():
n = int(eval(input()))
D = list(map(int, input().split()))
MAX_L = max(D) + 1
cnt = [0] * MAX_L
for d in D:
cnt[d] += 1
if cnt[0] != 1 or D[0] != 0:
print((0))
... | 29 | 33 | 533 | 579 | import sys
sys.setrecursionlimit(10**7)
f_inf = float("inf")
mod = 998244353
def resolve():
n = int(eval(input()))
D = list(map(int, input().split()))
tree = [0 for _ in range(max(D) + 1)]
for i in range(n):
idx = D[i]
tree[idx] += 1
if D[0] != 0 or tree[0] != 1 or 0 in tree:
... | import sys
sys.setrecursionlimit(10**7)
f_inf = float("inf")
mod = 998244353
def resolve():
n = int(eval(input()))
D = list(map(int, input().split()))
MAX_L = max(D) + 1
cnt = [0] * MAX_L
for d in D:
cnt[d] += 1
if cnt[0] != 1 or D[0] != 0:
print((0))
exit()
res = ... | false | 12.121212 | [
"- tree = [0 for _ in range(max(D) + 1)]",
"- for i in range(n):",
"- idx = D[i]",
"- tree[idx] += 1",
"- if D[0] != 0 or tree[0] != 1 or 0 in tree:",
"+ MAX_L = max(D) + 1",
"+ cnt = [0] * MAX_L",
"+ for d in D:",
"+ cnt[d] += 1",
"+ if cnt[0] != 1 or D[0... | false | 0.071289 | 0.119767 | 0.59523 | [
"s535585915",
"s195030076"
] |
u032662562 | p00113 | python | s649726897 | s869228815 | 2,090 | 120 | 19,036 | 10,000 | Accepted | Accepted | 94.26 | def solve1(m,n):
div=[]
rem=[]
r=m
rem = [-1 for _ in range(n)]
digit=0
while True:
(d,r) = divmod(r,n)
div.append(d)
if r==0:
return(''.join(map(str, div))[1:],'')
elif rem[r] != -1:
le = digit - rem[r]
s = ''.join... | from decimal import *
import re
def solve2(m, n):
maxreplen = 160
PREC=200
getcontext().prec = PREC
x = Decimal(m) / Decimal(n)
s = x.to_eng_string()
if len(s) < PREC:
return(s[2:],'')
rep = 1
while True:
r = r'(.{%d})\1{%d,}' % (rep, int(maxreplen/rep)-1)
... | 30 | 35 | 703 | 894 | def solve1(m, n):
div = []
rem = []
r = m
rem = [-1 for _ in range(n)]
digit = 0
while True:
(d, r) = divmod(r, n)
div.append(d)
if r == 0:
return ("".join(map(str, div))[1:], "")
elif rem[r] != -1:
le = digit - rem[r]
s = "".jo... | from decimal import *
import re
def solve2(m, n):
maxreplen = 160
PREC = 200
getcontext().prec = PREC
x = Decimal(m) / Decimal(n)
s = x.to_eng_string()
if len(s) < PREC:
return (s[2:], "")
rep = 1
while True:
r = r"(.{%d})\1{%d,}" % (rep, int(maxreplen / rep) - 1)
... | false | 14.285714 | [
"-def solve1(m, n):",
"- div = []",
"- rem = []",
"- r = m",
"- rem = [-1 for _ in range(n)]",
"- digit = 0",
"+from decimal import *",
"+import re",
"+",
"+",
"+def solve2(m, n):",
"+ maxreplen = 160",
"+ PREC = 200",
"+ getcontext().prec = PREC",
"+ x = Decim... | false | 0.291613 | 0.040671 | 7.170015 | [
"s649726897",
"s869228815"
] |
u464244643 | p02744 | python | s661926067 | s117792948 | 287 | 143 | 13,780 | 4,340 | Accepted | Accepted | 50.17 | import sys
import numpy as np
from itertools import combinations
def input():
return sys.stdin.readline()[:-1]
if __name__ == "__main__":
N = int(eval(input()))
al = [chr(ord('a') + i) for i in range(26)]
def dfs(s, mx):
if (len(s) == N):
print(s)
else:
... | import sys
def input():
return sys.stdin.readline()[:-1]
if __name__ == "__main__":
N = int(eval(input()))
al = [chr(ord('a') + i) for i in range(26)]
def dfs(s, mx):
if (len(s) == N):
print(s)
else:
for c in al:
if c == chr(or... | 24 | 22 | 521 | 475 | import sys
import numpy as np
from itertools import combinations
def input():
return sys.stdin.readline()[:-1]
if __name__ == "__main__":
N = int(eval(input()))
al = [chr(ord("a") + i) for i in range(26)]
def dfs(s, mx):
if len(s) == N:
print(s)
else:
for c i... | import sys
def input():
return sys.stdin.readline()[:-1]
if __name__ == "__main__":
N = int(eval(input()))
al = [chr(ord("a") + i) for i in range(26)]
def dfs(s, mx):
if len(s) == N:
print(s)
else:
for c in al:
if c == chr(ord(mx) + 1):
... | false | 8.333333 | [
"-import numpy as np",
"-from itertools import combinations",
"- tmp = chr(ord(mx) + 1) if (c == mx) else mx",
"- dfs(s + c, tmp)",
"+ nmx = chr(ord(mx) + 1) if (c == mx) else mx # 次のmx",
"+ dfs(s + c, nmx)"
] | false | 0.052624 | 0.054356 | 0.968136 | [
"s661926067",
"s117792948"
] |
u013408661 | p03241 | python | s330787985 | s314060341 | 580 | 21 | 3,064 | 3,060 | Accepted | Accepted | 96.38 | n,m=list(map(int,input().split()))
for i in range(2,m):
if i*i>m:
print((1))
exit()
if m%i==0:
break
for i in range(n,m+1):
if m%i==0:
print((m//i))
exit() | n,m=list(map(int,input().split()))
stack=[]
for i in range(1,int(m**0.5)+1):
if m%i==0:
if i<=m//n:
stack.append(i)
if m//i<=m//n:
stack.append(m//i)
print((max(stack))) | 11 | 9 | 181 | 191 | n, m = list(map(int, input().split()))
for i in range(2, m):
if i * i > m:
print((1))
exit()
if m % i == 0:
break
for i in range(n, m + 1):
if m % i == 0:
print((m // i))
exit()
| n, m = list(map(int, input().split()))
stack = []
for i in range(1, int(m**0.5) + 1):
if m % i == 0:
if i <= m // n:
stack.append(i)
if m // i <= m // n:
stack.append(m // i)
print((max(stack)))
| false | 18.181818 | [
"-for i in range(2, m):",
"- if i * i > m:",
"- print((1))",
"- exit()",
"+stack = []",
"+for i in range(1, int(m**0.5) + 1):",
"- break",
"-for i in range(n, m + 1):",
"- if m % i == 0:",
"- print((m // i))",
"- exit()",
"+ if i <= m // n:",
"... | false | 0.084779 | 0.038542 | 2.199676 | [
"s330787985",
"s314060341"
] |
u159994501 | p03031 | python | s100982218 | s922397702 | 47 | 40 | 3,064 | 3,064 | Accepted | Accepted | 14.89 | n, m = list(map(int, input().split()))
k = []
s = []
for i in range(m):
l = list(map(int, input().split()))
k.append(l[0])
s.append(l[1:])
p = list(map(int, input().split()))
ans = 0
for bit in range(2 ** n):
q = 1
for i in range(m):
sum = 0
for j in range(k[i]):
... | N, M = list(map(int, input().split()))
s = [list(map(int, input().split())) for i in range(M)]
p = list(map(int, input().split()))
ans = 0
for i in range(2 ** N): # all comb
for j in range(M): # k loop
c = 0
for k in range(N): # s loop
if ((i >> k) & 1) and (k + 1) in s[j][1:]... | 23 | 15 | 475 | 446 | n, m = list(map(int, input().split()))
k = []
s = []
for i in range(m):
l = list(map(int, input().split()))
k.append(l[0])
s.append(l[1:])
p = list(map(int, input().split()))
ans = 0
for bit in range(2**n):
q = 1
for i in range(m):
sum = 0
for j in range(k[i]):
if (bit >>... | N, M = list(map(int, input().split()))
s = [list(map(int, input().split())) for i in range(M)]
p = list(map(int, input().split()))
ans = 0
for i in range(2**N): # all comb
for j in range(M): # k loop
c = 0
for k in range(N): # s loop
if ((i >> k) & 1) and (k + 1) in s[j][1:]:
... | false | 34.782609 | [
"-n, m = list(map(int, input().split()))",
"-k = []",
"-s = []",
"-for i in range(m):",
"- l = list(map(int, input().split()))",
"- k.append(l[0])",
"- s.append(l[1:])",
"+N, M = list(map(int, input().split()))",
"+s = [list(map(int, input().split())) for i in range(M)]",
"-for bit in ran... | false | 0.041736 | 0.044909 | 0.929347 | [
"s100982218",
"s922397702"
] |
u752898745 | p03206 | python | s951016845 | s536373475 | 19 | 16 | 2,940 | 2,940 | Accepted | Accepted | 15.79 | d=25-int(eval(input()));print(("Christmas"+" Eve"*d)) | print(("Christmas"+" Eve"*(25-int(eval(input()))))) | 1 | 1 | 45 | 43 | d = 25 - int(eval(input()))
print(("Christmas" + " Eve" * d))
| print(("Christmas" + " Eve" * (25 - int(eval(input())))))
| false | 0 | [
"-d = 25 - int(eval(input()))",
"-print((\"Christmas\" + \" Eve\" * d))",
"+print((\"Christmas\" + \" Eve\" * (25 - int(eval(input())))))"
] | false | 0.046934 | 0.04527 | 1.036757 | [
"s951016845",
"s536373475"
] |
u329709276 | p03780 | python | s536928470 | s314433537 | 26 | 20 | 3,572 | 3,572 | Accepted | Accepted | 23.08 | N,K = list(map(int,input().split()))
a = sorted(map(int,input().split()))
count = N
s = 0
for i in range(N-1,-1,-1):
if s + a[i] < K:
s += a[i]
else:
count = min(i,count)
print(count) | N,K = list(map(int,input().split()))
a = sorted(map(int,input().split()))
count = N
s = 0
for i in range(N-1,-1,-1):
if s + a[i] < K:
s += a[i]
else:
count = i
print(count) | 11 | 11 | 212 | 201 | N, K = list(map(int, input().split()))
a = sorted(map(int, input().split()))
count = N
s = 0
for i in range(N - 1, -1, -1):
if s + a[i] < K:
s += a[i]
else:
count = min(i, count)
print(count)
| N, K = list(map(int, input().split()))
a = sorted(map(int, input().split()))
count = N
s = 0
for i in range(N - 1, -1, -1):
if s + a[i] < K:
s += a[i]
else:
count = i
print(count)
| false | 0 | [
"- count = min(i, count)",
"+ count = i"
] | false | 0.072783 | 0.03701 | 1.966586 | [
"s536928470",
"s314433537"
] |
u839236261 | p02621 | python | s963238657 | s898102702 | 33 | 26 | 9,140 | 9,152 | Accepted | Accepted | 21.21 | a=int(eval(input()))
s=a+a**2+a**3
print(s) | a=int(eval(input()))
print((a+a**2+a**3)) | 3 | 2 | 39 | 34 | a = int(eval(input()))
s = a + a**2 + a**3
print(s)
| a = int(eval(input()))
print((a + a**2 + a**3))
| false | 33.333333 | [
"-s = a + a**2 + a**3",
"-print(s)",
"+print((a + a**2 + a**3))"
] | false | 0.140152 | 0.041356 | 3.388935 | [
"s963238657",
"s898102702"
] |
u571445182 | p03407 | python | s959672612 | s011584542 | 21 | 17 | 3,316 | 2,940 | Accepted | Accepted | 19.05 | Tmp = []
Tmp = input().rstrip().split(' ')
X = int(Tmp[0])
Y = int(Tmp[1])
C = int(Tmp[2])
Ans = X + Y
if Ans >= C:
print('Yes')
else:
print('No')
| A, B, C=list(map(int,input().split()))
A += B
if A >= C:
print('Yes')
else:
print('No')
| 13 | 8 | 170 | 95 | Tmp = []
Tmp = input().rstrip().split(" ")
X = int(Tmp[0])
Y = int(Tmp[1])
C = int(Tmp[2])
Ans = X + Y
if Ans >= C:
print("Yes")
else:
print("No")
| A, B, C = list(map(int, input().split()))
A += B
if A >= C:
print("Yes")
else:
print("No")
| false | 38.461538 | [
"-Tmp = []",
"-Tmp = input().rstrip().split(\" \")",
"-X = int(Tmp[0])",
"-Y = int(Tmp[1])",
"-C = int(Tmp[2])",
"-Ans = X + Y",
"-if Ans >= C:",
"+A, B, C = list(map(int, input().split()))",
"+A += B",
"+if A >= C:"
] | false | 0.042643 | 0.039089 | 1.090927 | [
"s959672612",
"s011584542"
] |
u467175809 | p02406 | python | s126050707 | s111800943 | 20 | 10 | 5,908 | 5,056 | Accepted | Accepted | 50 | print(("".join([" " + str(i) for i in range(1, int(eval(input())) + 1) if i % 3 == 0 or '3' in str(i)])))
| print("".join(" "+str(i)for i in range(1,eval(input())+1)if i%3==0 or'3'in str(i)))
| 2 | 1 | 100 | 76 | print(
(
"".join(
[
" " + str(i)
for i in range(1, int(eval(input())) + 1)
if i % 3 == 0 or "3" in str(i)
]
)
)
)
| print(
"".join(
" " + str(i) for i in range(1, eval(input()) + 1) if i % 3 == 0 or "3" in str(i)
)
)
| false | 50 | [
"- (",
"- \"\".join(",
"- [",
"- \" \" + str(i)",
"- for i in range(1, int(eval(input())) + 1)",
"- if i % 3 == 0 or \"3\" in str(i)",
"- ]",
"- )",
"+ \"\".join(",
"+ \" \" + str(i) for i in range(1, eva... | false | 0.043196 | 0.042341 | 1.020209 | [
"s126050707",
"s111800943"
] |
u393253137 | p02899 | python | s426407588 | s419471910 | 221 | 94 | 24,992 | 13,812 | Accepted | Accepted | 57.47 | n = int(input())
A = list(map(int, input().split()))
D = {a:i for i,a in enumerate(A)}
L=sorted(D.items())
for a, b in L:
print(b+1, end=' ')
print()
| def main():
n = int(eval(input()))
A = list(map(int, input().split()))
ans = [0]*n
for i, a in enumerate(A):
ans[a - 1] = i + 1
print((*ans))
main() | 7 | 8 | 159 | 175 | n = int(input())
A = list(map(int, input().split()))
D = {a: i for i, a in enumerate(A)}
L = sorted(D.items())
for a, b in L:
print(b + 1, end=" ")
print()
| def main():
n = int(eval(input()))
A = list(map(int, input().split()))
ans = [0] * n
for i, a in enumerate(A):
ans[a - 1] = i + 1
print((*ans))
main()
| false | 12.5 | [
"-n = int(input())",
"-A = list(map(int, input().split()))",
"-D = {a: i for i, a in enumerate(A)}",
"-L = sorted(D.items())",
"-for a, b in L:",
"- print(b + 1, end=\" \")",
"-print()",
"+def main():",
"+ n = int(eval(input()))",
"+ A = list(map(int, input().split()))",
"+ ans = [0]... | false | 0.03632 | 0.036594 | 0.992502 | [
"s426407588",
"s419471910"
] |
u786020649 | p03557 | python | s139313878 | s419933753 | 624 | 217 | 31,688 | 31,560 | Accepted | Accepted | 65.22 |
import sys
from heapq import heapify,heappop,heappush
from collections import defaultdict
read=sys.stdin.read
readline=sys.stdin.readline
def main():
n=int(readline())
a,b,c=(list(map(int,lst.split())) for lst in read().splitlines())
a.sort()
b.sort()
c=[-x for x in c]
c.sort()
... | import sys
from bisect import bisect_right,bisect_left
read=sys.stdin.read
readline=sys.stdin.readline
def main():
n=int(readline())
a,b,c=(list(map(int,lst.split())) for lst in read().splitlines())
a.sort()
b.sort()
c=[-x for x in c]
c.sort()
print((sum(bisect_left(a,x)*bisect_... | 31 | 18 | 673 | 399 | import sys
from heapq import heapify, heappop, heappush
from collections import defaultdict
read = sys.stdin.read
readline = sys.stdin.readline
def main():
n = int(readline())
a, b, c = (list(map(int, lst.split())) for lst in read().splitlines())
a.sort()
b.sort()
c = [-x for x in c]
c.sort()... | import sys
from bisect import bisect_right, bisect_left
read = sys.stdin.read
readline = sys.stdin.readline
def main():
n = int(readline())
a, b, c = (list(map(int, lst.split())) for lst in read().splitlines())
a.sort()
b.sort()
c = [-x for x in c]
c.sort()
print((sum(bisect_left(a, x) * ... | false | 41.935484 | [
"-from heapq import heapify, heappop, heappush",
"-from collections import defaultdict",
"+from bisect import bisect_right, bisect_left",
"-",
"- def bise(x, lst):",
"- left = 0",
"- right = len(lst)",
"- while right - left > 0:",
"- mid = (right + left) // 2",
"... | false | 0.120477 | 0.046118 | 2.612339 | [
"s139313878",
"s419933753"
] |
u250583425 | p02702 | python | s713470123 | s017422149 | 138 | 81 | 88,900 | 88,684 | Accepted | Accepted | 41.3 | import sys
def input(): return sys.stdin.readline().rstrip()
def main():
S = eval(input())
s_list = list(map(int, list(S)))[::-1]
MOD = 2019
sum_v = 0
cnt = [0] * MOD
cnt[0] = 1
for i, s in enumerate(s_list):
sum_v += s * pow(10, i, MOD)
sum_v %= MOD
c... | import sys
def input(): return sys.stdin.readline().rstrip()
def main():
S = eval(input())
s_list = list(map(int, list(S)))[::-1]
MOD = 2019
sum_v = 0
cnt = [0] * MOD
cnt[0] = 1
x = 1
for s in s_list:
sum_v += s * x
sum_v %= MOD
x *= 10
x... | 19 | 22 | 429 | 447 | import sys
def input():
return sys.stdin.readline().rstrip()
def main():
S = eval(input())
s_list = list(map(int, list(S)))[::-1]
MOD = 2019
sum_v = 0
cnt = [0] * MOD
cnt[0] = 1
for i, s in enumerate(s_list):
sum_v += s * pow(10, i, MOD)
sum_v %= MOD
cnt[sum_v... | import sys
def input():
return sys.stdin.readline().rstrip()
def main():
S = eval(input())
s_list = list(map(int, list(S)))[::-1]
MOD = 2019
sum_v = 0
cnt = [0] * MOD
cnt[0] = 1
x = 1
for s in s_list:
sum_v += s * x
sum_v %= MOD
x *= 10
x %= MOD
... | false | 13.636364 | [
"- for i, s in enumerate(s_list):",
"- sum_v += s * pow(10, i, MOD)",
"+ x = 1",
"+ for s in s_list:",
"+ sum_v += s * x",
"+ x *= 10",
"+ x %= MOD"
] | false | 0.036123 | 0.039291 | 0.91937 | [
"s713470123",
"s017422149"
] |
u054662964 | p02755 | python | s470427495 | s254564316 | 26 | 18 | 3,064 | 3,068 | Accepted | Accepted | 30.77 | a,b = input().split()
a = int(a)
b = int(b)
c = 0
for i in range(10000):
d = c*0.08
e = c*0.1
d = int(d)
e = int(e)
if d == a and e == b:
print(c)
break
elif c == 9999:
print('-1')
break
else:
c += 1 | a,b = input().split()
a = int(a)
b = int(b)
c = 0
for i in range(1001):
d = c*0.08
e = c*0.1
d = int(d)
e = int(e)
if d == a and e == b:
print(c)
break
elif c == 1000:
print('-1')
break
else:
c += 1 | 17 | 17 | 283 | 282 | a, b = input().split()
a = int(a)
b = int(b)
c = 0
for i in range(10000):
d = c * 0.08
e = c * 0.1
d = int(d)
e = int(e)
if d == a and e == b:
print(c)
break
elif c == 9999:
print("-1")
break
else:
c += 1
| a, b = input().split()
a = int(a)
b = int(b)
c = 0
for i in range(1001):
d = c * 0.08
e = c * 0.1
d = int(d)
e = int(e)
if d == a and e == b:
print(c)
break
elif c == 1000:
print("-1")
break
else:
c += 1
| false | 0 | [
"-for i in range(10000):",
"+for i in range(1001):",
"- elif c == 9999:",
"+ elif c == 1000:"
] | false | 0.082405 | 0.043658 | 1.887508 | [
"s470427495",
"s254564316"
] |
u808429775 | p00162 | python | s711903466 | s586403120 | 540 | 370 | 21,216 | 21,144 | Accepted | Accepted | 31.48 | MAX = 1000000
hamming_list = [False] * (MAX + 1)
hamming_list[0] = False
hamming_list[1] = True
for index in range(2, MAX + 1):
if index / 2 % 1 == 0:
if hamming_list[index // 2]:
hamming_list[index] = True
elif index / 3 % 1 == 0:
if hamming_list[index // 3]:
... | MAX = 1000000
hamming_list = [False] * (MAX + 1)
hamming_list[0] = False
hamming_list[1] = True
for index in range(2, MAX + 1):
if index % 2 == 0:
if hamming_list[index // 2]:
hamming_list[index] = True
elif index % 3 == 0:
if hamming_list[index // 3]:
h... | 31 | 31 | 683 | 671 | MAX = 1000000
hamming_list = [False] * (MAX + 1)
hamming_list[0] = False
hamming_list[1] = True
for index in range(2, MAX + 1):
if index / 2 % 1 == 0:
if hamming_list[index // 2]:
hamming_list[index] = True
elif index / 3 % 1 == 0:
if hamming_list[index // 3]:
hamming_lis... | MAX = 1000000
hamming_list = [False] * (MAX + 1)
hamming_list[0] = False
hamming_list[1] = True
for index in range(2, MAX + 1):
if index % 2 == 0:
if hamming_list[index // 2]:
hamming_list[index] = True
elif index % 3 == 0:
if hamming_list[index // 3]:
hamming_list[index]... | false | 0 | [
"- if index / 2 % 1 == 0:",
"+ if index % 2 == 0:",
"- elif index / 3 % 1 == 0:",
"+ elif index % 3 == 0:",
"- elif index / 5 % 1 == 0:",
"+ elif index % 5 == 0:"
] | false | 1.222123 | 0.297085 | 4.113717 | [
"s711903466",
"s586403120"
] |
u393253137 | p03720 | python | s786029087 | s483213616 | 21 | 17 | 3,316 | 2,940 | Accepted | Accepted | 19.05 | from collections import Counter
n,m=list(map(int,input().split()))
L=[0]*(2*m)
for i in range(m):
L[2*i],L[2*i+1]=list(map(int,input().split()))
s=Counter(L)
for i in range(n):
print((s[i+1])) | n,m=map(int,input().split())
ans=[0]*n
for _ in range(m):
a,b=map(int,input().split())
ans[a-1] += 1
ans[b-1] += 1
print(*ans, sep="\n")
| 8 | 7 | 193 | 154 | from collections import Counter
n, m = list(map(int, input().split()))
L = [0] * (2 * m)
for i in range(m):
L[2 * i], L[2 * i + 1] = list(map(int, input().split()))
s = Counter(L)
for i in range(n):
print((s[i + 1]))
| n, m = map(int, input().split())
ans = [0] * n
for _ in range(m):
a, b = map(int, input().split())
ans[a - 1] += 1
ans[b - 1] += 1
print(*ans, sep="\n")
| false | 12.5 | [
"-from collections import Counter",
"-",
"-n, m = list(map(int, input().split()))",
"-L = [0] * (2 * m)",
"-for i in range(m):",
"- L[2 * i], L[2 * i + 1] = list(map(int, input().split()))",
"-s = Counter(L)",
"-for i in range(n):",
"- print((s[i + 1]))",
"+n, m = map(int, input().split())",... | false | 0.043153 | 0.042817 | 1.007852 | [
"s786029087",
"s483213616"
] |
u146803137 | p02897 | python | s282642082 | s139335766 | 63 | 27 | 61,684 | 9,144 | Accepted | Accepted | 57.14 | n = int(eval(input()))
odd = n//2 + n%2
print((odd/n))
| n = int(eval(input()))
if n%2:
print(((n//2+1)/n))
else:
print(((n//2)/n))
| 3 | 5 | 49 | 77 | n = int(eval(input()))
odd = n // 2 + n % 2
print((odd / n))
| n = int(eval(input()))
if n % 2:
print(((n // 2 + 1) / n))
else:
print(((n // 2) / n))
| false | 40 | [
"-odd = n // 2 + n % 2",
"-print((odd / n))",
"+if n % 2:",
"+ print(((n // 2 + 1) / n))",
"+else:",
"+ print(((n // 2) / n))"
] | false | 0.120689 | 0.076316 | 1.581444 | [
"s282642082",
"s139335766"
] |
u864197622 | p03241 | python | s431364086 | s350256907 | 28 | 20 | 3,192 | 3,188 | Accepted | Accepted | 28.57 | def primeFactor(N):
i = 2
ret = {}
n = N
if n < 0:
ret[-1] = 1
n = -n
if n == 0:
ret[0] = 1
while i**2 <= n:
k = 0
while n % i == 0:
n //= i
k += 1
ret[i] = k
i += 1
if n > 1:
ret[n] ... | def primeFactor(N):
i = 2
ret = {}
n = N
if n < 0:
ret[-1] = 1
n = -n
if n == 0:
ret[0] = 1
d = 2
sq = int(n ** (1/2))
while i <= sq:
k = 0
while n % i == 0:
n //= i
k += 1
ret[i] = k
if ... | 51 | 51 | 958 | 984 | def primeFactor(N):
i = 2
ret = {}
n = N
if n < 0:
ret[-1] = 1
n = -n
if n == 0:
ret[0] = 1
while i**2 <= n:
k = 0
while n % i == 0:
n //= i
k += 1
ret[i] = k
i += 1
if n > 1:
ret[n] = 1
return re... | def primeFactor(N):
i = 2
ret = {}
n = N
if n < 0:
ret[-1] = 1
n = -n
if n == 0:
ret[0] = 1
d = 2
sq = int(n ** (1 / 2))
while i <= sq:
k = 0
while n % i == 0:
n //= i
k += 1
ret[i] = k
if k > 0:
... | false | 0 | [
"- while i**2 <= n:",
"+ d = 2",
"+ sq = int(n ** (1 / 2))",
"+ while i <= sq:",
"- i += 1",
"+ if k > 0:",
"+ sq = int(n ** (1 / 2))",
"+ if i == 2:",
"+ i = 3",
"+ elif i == 3:",
"+ i = 5",
"+ elif d == 2:",
"+... | false | 0.040782 | 0.036215 | 1.126097 | [
"s431364086",
"s350256907"
] |
u820351940 | p03282 | python | s697067055 | s850130135 | 45 | 17 | 4,592 | 2,940 | Accepted | Accepted | 62.22 | s = eval(input())
k = int(eval(input()))
import random
for i, v in enumerate(s):
if v != "1":
break
after = "1" * i + v * 100
print((after[min(len(s), k) - 1]))
| s = eval(input())
k = int(eval(input()))
if k <= len(s) and s[:k] == "1" * k:
print("1")
else:
for i in s:
if i != "1":
print(i)
break
| 9 | 10 | 168 | 173 | s = eval(input())
k = int(eval(input()))
import random
for i, v in enumerate(s):
if v != "1":
break
after = "1" * i + v * 100
print((after[min(len(s), k) - 1]))
| s = eval(input())
k = int(eval(input()))
if k <= len(s) and s[:k] == "1" * k:
print("1")
else:
for i in s:
if i != "1":
print(i)
break
| false | 10 | [
"-import random",
"-",
"-for i, v in enumerate(s):",
"- if v != \"1\":",
"- break",
"-after = \"1\" * i + v * 100",
"-print((after[min(len(s), k) - 1]))",
"+if k <= len(s) and s[:k] == \"1\" * k:",
"+ print(\"1\")",
"+else:",
"+ for i in s:",
"+ if i != \"1\":",
"+ ... | false | 0.040062 | 0.08597 | 0.466002 | [
"s697067055",
"s850130135"
] |
u046187684 | p02923 | python | s020989345 | s853960515 | 60 | 55 | 15,176 | 15,180 | Accepted | Accepted | 8.33 | def solve(string):
n, *h = list(map(int, string.split()))
ans = count = 0
for h0, h1 in zip(h, h[1:]):
if h0 >= h1:
count += 1
else:
ans = max(ans, count)
count = 0
return str(max(ans, count))
if __name__ == '__main__':
print((solve(... | def solve(string):
n, *h = list(map(int, string.split()))
s = "".join(["1" if h0 >= h1 else "0" for h0, h1 in zip(h, h[1:])]).split("0")
return str(max(list(map(len, s))))
if __name__ == '__main__':
print((solve('\n'.join([eval(input()), eval(input())]))))
| 14 | 8 | 345 | 262 | def solve(string):
n, *h = list(map(int, string.split()))
ans = count = 0
for h0, h1 in zip(h, h[1:]):
if h0 >= h1:
count += 1
else:
ans = max(ans, count)
count = 0
return str(max(ans, count))
if __name__ == "__main__":
print((solve("\n".join([ev... | def solve(string):
n, *h = list(map(int, string.split()))
s = "".join(["1" if h0 >= h1 else "0" for h0, h1 in zip(h, h[1:])]).split("0")
return str(max(list(map(len, s))))
if __name__ == "__main__":
print((solve("\n".join([eval(input()), eval(input())]))))
| false | 42.857143 | [
"- ans = count = 0",
"- for h0, h1 in zip(h, h[1:]):",
"- if h0 >= h1:",
"- count += 1",
"- else:",
"- ans = max(ans, count)",
"- count = 0",
"- return str(max(ans, count))",
"+ s = \"\".join([\"1\" if h0 >= h1 else \"0\" for h0, h1 in zip(h... | false | 0.108578 | 0.008281 | 13.111344 | [
"s020989345",
"s853960515"
] |
u110943895 | p03469 | python | s948237123 | s959569889 | 20 | 17 | 3,060 | 2,940 | Accepted | Accepted | 15 | s = list(input())
s[3] = "8"
print(*s, sep="")
| s = eval(input())
print(("2018"+s[4:])) | 3 | 2 | 48 | 32 | s = list(input())
s[3] = "8"
print(*s, sep="")
| s = eval(input())
print(("2018" + s[4:]))
| false | 33.333333 | [
"-s = list(input())",
"-s[3] = \"8\"",
"-print(*s, sep=\"\")",
"+s = eval(input())",
"+print((\"2018\" + s[4:]))"
] | false | 0.037271 | 0.035175 | 1.059605 | [
"s948237123",
"s959569889"
] |
u835924161 | p02766 | python | s457105565 | s377431403 | 167 | 17 | 38,384 | 2,940 | Accepted | Accepted | 89.82 | n,k=list(map(int,input().split()))
ans=int(0)
while n>0:
n=int(n/k)
ans+=1
print(ans) | import math
n,k=list(map(int,input().split()))
print((1+int(math.log(n)/math.log(k)))) | 6 | 3 | 92 | 80 | n, k = list(map(int, input().split()))
ans = int(0)
while n > 0:
n = int(n / k)
ans += 1
print(ans)
| import math
n, k = list(map(int, input().split()))
print((1 + int(math.log(n) / math.log(k))))
| false | 50 | [
"+import math",
"+",
"-ans = int(0)",
"-while n > 0:",
"- n = int(n / k)",
"- ans += 1",
"-print(ans)",
"+print((1 + int(math.log(n) / math.log(k))))"
] | false | 0.043317 | 0.044246 | 0.979012 | [
"s457105565",
"s377431403"
] |
u814986259 | p02897 | python | s419816101 | s836784183 | 22 | 17 | 3,316 | 2,940 | Accepted | Accepted | 22.73 | N = int(eval(input()))
print(((N - (N//2))/N))
| N = int(eval(input()))
if N % 2 == 0:
print((1/2))
else:
print(((N-N//2)/N))
| 4 | 5 | 44 | 79 | N = int(eval(input()))
print(((N - (N // 2)) / N))
| N = int(eval(input()))
if N % 2 == 0:
print((1 / 2))
else:
print(((N - N // 2) / N))
| false | 20 | [
"-print(((N - (N // 2)) / N))",
"+if N % 2 == 0:",
"+ print((1 / 2))",
"+else:",
"+ print(((N - N // 2) / N))"
] | false | 0.040262 | 0.049597 | 0.811793 | [
"s419816101",
"s836784183"
] |
u227082700 | p02704 | python | s775570134 | s691646408 | 1,867 | 1,622 | 100,224 | 99,096 | Accepted | Accepted | 13.12 | n,*s=list(map(int,open(0).read().split()));s,t,f,g=[s[i-n:i]for i in range(n,4*n+1,n)];a=[n*[0]for _ in range(n)]
for b in range(64):
e=1<<b;u=[k&e for k in f];v=[k&e for k in g];l=[0]*n;m=l[:]
for i in range(n):
for j in range(n):
if(u[i]&v[j])|((s[i]^1)*u[i])|((t[j]^1)*v[j]):a[i][j]|=e;l[i]+=1;m[j]... | n,*s=list(map(int,open(0).read().split()));s,t,f,g=[s[i*n:i*n+n]for i in range(4)];a=[n*[0]for _ in[0]*n];r=list(range(n))
for b in range(64):
e=1<<b;u=[k&e for k in f];v=[k&e for k in g];l=[0]*n;m=l[:]
for i in r:
for j in r:
if(u[i]&v[j])|((s[i]^1)*u[i])|((t[j]^1)*v[j]):a[i][j]|=e;l[i]+=1;m[j]+=1
... | 19 | 19 | 799 | 746 | n, *s = list(map(int, open(0).read().split()))
s, t, f, g = [s[i - n : i] for i in range(n, 4 * n + 1, n)]
a = [n * [0] for _ in range(n)]
for b in range(64):
e = 1 << b
u = [k & e for k in f]
v = [k & e for k in g]
l = [0] * n
m = l[:]
for i in range(n):
for j in range(n):
i... | n, *s = list(map(int, open(0).read().split()))
s, t, f, g = [s[i * n : i * n + n] for i in range(4)]
a = [n * [0] for _ in [0] * n]
r = list(range(n))
for b in range(64):
e = 1 << b
u = [k & e for k in f]
v = [k & e for k in g]
l = [0] * n
m = l[:]
for i in r:
for j in r:
if ... | false | 0 | [
"-s, t, f, g = [s[i - n : i] for i in range(n, 4 * n + 1, n)]",
"-a = [n * [0] for _ in range(n)]",
"+s, t, f, g = [s[i * n : i * n + n] for i in range(4)]",
"+a = [n * [0] for _ in [0] * n]",
"+r = list(range(n))",
"- for i in range(n):",
"- for j in range(n):",
"+ for i in r:",
"+ ... | false | 0.037697 | 0.037058 | 1.017225 | [
"s775570134",
"s691646408"
] |
u922449550 | p03177 | python | s328875660 | s920573053 | 1,979 | 550 | 72,796 | 42,348 | Accepted | Accepted | 72.21 | N, K = list(map(int, input().split()))
A = [list(map(int, input().split())) for i in range(N)]
MOD = 10**9 + 7
def dot(M1, M2, mod=10**9+7):
n = len(M1)
res = [[0]*n for _ in range(n)]
for i in range(n):
for j in range(n):
for k in range(n):
res[i][j] += M1[i][k] * M2[k][j] % MOD
... | N, K = list(map(int, input().split()))
A = [list(map(int, input().split())) for i in range(N)]
MOD = 10**9 + 7
def dot(M1, M2, mod=10**9+7):
n = len(M1)
res = [[0]*n for _ in range(n)]
for i in range(n):
for j in range(n):
for k in range(n):
res[i][j] = (res[i][j] + M1[i][k] * M2[k]... | 33 | 33 | 615 | 633 | N, K = list(map(int, input().split()))
A = [list(map(int, input().split())) for i in range(N)]
MOD = 10**9 + 7
def dot(M1, M2, mod=10**9 + 7):
n = len(M1)
res = [[0] * n for _ in range(n)]
for i in range(n):
for j in range(n):
for k in range(n):
res[i][j] += M1[i][k] * ... | N, K = list(map(int, input().split()))
A = [list(map(int, input().split())) for i in range(N)]
MOD = 10**9 + 7
def dot(M1, M2, mod=10**9 + 7):
n = len(M1)
res = [[0] * n for _ in range(n)]
for i in range(n):
for j in range(n):
for k in range(n):
res[i][j] = (res[i][j] +... | false | 0 | [
"- res[i][j] += M1[i][k] * M2[k][j] % MOD",
"+ res[i][j] = (res[i][j] + M1[i][k] * M2[k][j]) % MOD",
"- return power(dot(M, M, mod), k // 2)",
"+ return power(dot(M, M, mod), k // 2, mod)"
] | false | 0.048602 | 0.047741 | 1.018028 | [
"s328875660",
"s920573053"
] |
u077291787 | p03798 | python | s149543081 | s927936450 | 138 | 109 | 7,008 | 4,852 | Accepted | Accepted | 21.01 | # ABC055D - Menagerie (ARC069D)
def check(a: int, b: int) -> list:
ret, cur, prev = [], a, b
for i in S:
ret += [cur]
if cur ^ (i == "o"):
prev, cur = cur, prev ^ 1 # both are different
else:
prev, cur = cur, prev # both neighbors are the same
flg =... | # ABC055D - Menagerie (ARC069D)
def check(a: int, b: int) -> list:
ret, cur, prev = [], a, b
for i in S:
ret += [cur]
if cur ^ (i == "o"):
prev, cur = cur, prev ^ 1 # both are different
else:
prev, cur = cur, prev # both neighbors are the same
flg =... | 28 | 28 | 751 | 757 | # ABC055D - Menagerie (ARC069D)
def check(a: int, b: int) -> list:
ret, cur, prev = [], a, b
for i in S:
ret += [cur]
if cur ^ (i == "o"):
prev, cur = cur, prev ^ 1 # both are different
else:
prev, cur = cur, prev # both neighbors are the same
flg = cur == a... | # ABC055D - Menagerie (ARC069D)
def check(a: int, b: int) -> list:
ret, cur, prev = [], a, b
for i in S:
ret += [cur]
if cur ^ (i == "o"):
prev, cur = cur, prev ^ 1 # both are different
else:
prev, cur = cur, prev # both neighbors are the same
flg = cur == a... | false | 0 | [
"- print(*[\"S\" if i else \"W\" for i in ans], sep=\"\")",
"+ print(\"\".join(\"S\" if i else \"W\" for i in ans), sep=\"\")"
] | false | 0.03986 | 0.044143 | 0.902967 | [
"s149543081",
"s927936450"
] |
u645250356 | p03712 | python | s989933468 | s718865147 | 163 | 40 | 38,384 | 10,468 | Accepted | Accepted | 75.46 | from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpln(n): return list(int(sys.st... | from collections import Counter,defaultdict,deque
from heapq import heappop,heappush
from bisect import bisect_left,bisect_right
import sys,math,itertools,fractions
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.std... | 19 | 20 | 583 | 565 | from collections import Counter, defaultdict, deque
from heapq import heappop, heappush, heapify
import sys, bisect, math, itertools
sys.setrecursionlimit(10**8)
mod = 10**9 + 7
def inp():
return int(sys.stdin.readline())
def inpl():
return list(map(int, sys.stdin.readline().split()))
def inpln(n):
r... | from collections import Counter, defaultdict, deque
from heapq import heappop, heappush
from bisect import bisect_left, bisect_right
import sys, math, itertools, fractions
sys.setrecursionlimit(10**8)
mod = 10**9 + 7
INF = float("inf")
def inp():
return int(sys.stdin.readline())
def inpl():
return list(map... | false | 5 | [
"-from heapq import heappop, heappush, heapify",
"-import sys, bisect, math, itertools",
"+from heapq import heappop, heappush",
"+from bisect import bisect_left, bisect_right",
"+import sys, math, itertools, fractions",
"+INF = float(\"inf\")",
"-def inpln(n):",
"- return list(int(sys.stdin.readli... | false | 0.136068 | 0.085476 | 1.591884 | [
"s989933468",
"s718865147"
] |
u278356323 | p02954 | python | s531375719 | s569862198 | 198 | 135 | 9,716 | 11,448 | Accepted | Accepted | 31.82 | # ABC136d
import sys
import re
import math
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
s = eval(input())
l = re.findall("R+L+", s)
ans = []
# print(l)
for i in l:
R = math.ceil((i.count("R")-1)/2) + math.ceil(i.count("L")/2)
L = math.ceil(i.count("R")/2) + math.ceil((i.count("L")-1... | def main():
import sys
import math
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
# map(int, input().split())
s = input()[:-1]
sakai = s.replace('RL', 'R,L').split(',')
kodomo = [0] * (len(s)+1)
pos = [0] * (len(sakai)+1)
for i in range(len(sakai)):
... | 25 | 28 | 583 | 796 | # ABC136d
import sys
import re
import math
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
s = eval(input())
l = re.findall("R+L+", s)
ans = []
# print(l)
for i in l:
R = math.ceil((i.count("R") - 1) / 2) + math.ceil(i.count("L") / 2)
L = math.ceil(i.count("R") / 2) + math.ceil((i.count("L") - 1) / 2)
... | def main():
import sys
import math
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
# map(int, input().split())
s = input()[:-1]
sakai = s.replace("RL", "R,L").split(",")
kodomo = [0] * (len(s) + 1)
pos = [0] * (len(sakai) + 1)
for i in range(len(sakai)):
seq = sa... | false | 10.714286 | [
"-# ABC136d",
"-import sys",
"-import re",
"-import math",
"+def main():",
"+ import sys",
"+ import math",
"-input = sys.stdin.readline",
"-sys.setrecursionlimit(10**6)",
"-s = eval(input())",
"-l = re.findall(\"R+L+\", s)",
"-ans = []",
"-# print(l)",
"-for i in l:",
"- R = ma... | false | 0.082415 | 0.04095 | 2.012558 | [
"s531375719",
"s569862198"
] |
u391675400 | p03545 | python | s477105753 | s279688492 | 19 | 17 | 3,064 | 3,064 | Accepted | Accepted | 10.53 | a= list(str(eval(input())))
for i in range(2**3):
x = ["+","+","+"]
for j in range(len(a)):
if (i >> j) & 1 == 1:
x[j] = "-"
if eval(a[0]+x[0]+a[1]+x[1]+a[2]+x[2]+a[3]) == 7:
print((a[0]+x[0]+a[1]+x[1]+a[2]+x[2]+a[3]+"=7"))
break
| from itertools import product
a = list(str(eval(input())))
for bit in product([0,1],repeat=3): # 01の組み合わせ
x = ["+","+","+"]
for i,j in enumerate(bit):
#print(bit,i,j)
if j == 1:
x[i] = "-"
if eval(a[0]+x[0]+a[1]+x[1]+a[2]+x[2]+a[3]) == 7:
print((a[0]+x[0]+... | 11 | 50 | 283 | 771 | a = list(str(eval(input())))
for i in range(2**3):
x = ["+", "+", "+"]
for j in range(len(a)):
if (i >> j) & 1 == 1:
x[j] = "-"
if eval(a[0] + x[0] + a[1] + x[1] + a[2] + x[2] + a[3]) == 7:
print((a[0] + x[0] + a[1] + x[1] + a[2] + x[2] + a[3] + "=7"))
break
| from itertools import product
a = list(str(eval(input())))
for bit in product([0, 1], repeat=3): # 01の組み合わせ
x = ["+", "+", "+"]
for i, j in enumerate(bit):
# print(bit,i,j)
if j == 1:
x[i] = "-"
if eval(a[0] + x[0] + a[1] + x[1] + a[2] + x[2] + a[3]) == 7:
print((a[0] +... | false | 78 | [
"+from itertools import product",
"+",
"-for i in range(2**3):",
"+for bit in product([0, 1], repeat=3): # 01の組み合わせ",
"- for j in range(len(a)):",
"- if (i >> j) & 1 == 1:",
"- x[j] = \"-\"",
"+ for i, j in enumerate(bit):",
"+ # print(bit,i,j)",
"+ if j == 1... | false | 0.047968 | 0.044773 | 1.071351 | [
"s477105753",
"s279688492"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.