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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
u143492911 | p03767 | python | s673075688 | s304295495 | 230 | 211 | 37,084 | 37,084 | Accepted | Accepted | 8.26 | n=int(eval(input()))
a=list(map(int,input().split()))
a.sort()
a.reverse()
total=0
for i in range(n):
total+=a[i*2+1]
print(total) | n=int(eval(input()))
a=list(map(int,input().split()))
a.sort()
print((sum(a[n::2]))) | 8 | 4 | 135 | 79 | n = int(eval(input()))
a = list(map(int, input().split()))
a.sort()
a.reverse()
total = 0
for i in range(n):
total += a[i * 2 + 1]
print(total)
| n = int(eval(input()))
a = list(map(int, input().split()))
a.sort()
print((sum(a[n::2])))
| false | 50 | [
"-a.reverse()",
"-total = 0",
"-for i in range(n):",
"- total += a[i * 2 + 1]",
"-print(total)",
"+print((sum(a[n::2])))"
] | false | 0.109398 | 0.008341 | 13.115262 | [
"s673075688",
"s304295495"
] |
u462831976 | p02265 | python | s545227861 | s362877685 | 4,770 | 1,510 | 47,960 | 214,392 | Accepted | Accepted | 68.34 | # -*- coding: utf-8 -*-
import sys
import os
from collections import deque
N = int(eval(input()))
q = deque()
for i in range(N):
lst = input().split()
command = lst[0]
if command == 'insert':
v = int(lst[1])
q.appendleft(v)
elif command == 'delete':
v = int(l... | import sys
from collections import deque
n = int(sys.stdin.readline())
lines = sys.stdin.readlines()
Q = deque()
for i in range(n):
command = lines[i].split()
if command[0] == "insert":
Q.appendleft(command[1])
elif command[0] == "deleteFirst":
Q.popleft()
elif command[0] =... | 28 | 22 | 526 | 524 | # -*- coding: utf-8 -*-
import sys
import os
from collections import deque
N = int(eval(input()))
q = deque()
for i in range(N):
lst = input().split()
command = lst[0]
if command == "insert":
v = int(lst[1])
q.appendleft(v)
elif command == "delete":
v = int(lst[1])
try:
... | import sys
from collections import deque
n = int(sys.stdin.readline())
lines = sys.stdin.readlines()
Q = deque()
for i in range(n):
command = lines[i].split()
if command[0] == "insert":
Q.appendleft(command[1])
elif command[0] == "deleteFirst":
Q.popleft()
elif command[0] == "deleteLast... | false | 21.428571 | [
"-# -*- coding: utf-8 -*-",
"-import os",
"-N = int(eval(input()))",
"-q = deque()",
"-for i in range(N):",
"- lst = input().split()",
"- command = lst[0]",
"- if command == \"insert\":",
"- v = int(lst[1])",
"- q.appendleft(v)",
"- elif command == \"delete\":",
"- ... | false | 0.037818 | 0.038514 | 0.98193 | [
"s545227861",
"s362877685"
] |
u040599127 | p03030 | python | s236774262 | s500679022 | 197 | 170 | 39,920 | 38,256 | Accepted | Accepted | 13.71 | N = int(eval(input()))
S = [None]*N
P = [None]*N
I = [None]*N
for i in range(N):
tmp = input().split()
S[i] = tmp[0]
P[i] = int(tmp[1])
I[i] = i+1
def less(a, b):
if a[0] == b[0]:
if a[1] == b[1]:
return a[2] < b[2]
return a[1] > b[1]
return a[0] < b... | N = int(eval(input()))
T = [None]*N
for i in range(N):
tmp = input().split()
T[i] = (tmp[0], -int(tmp[1]), i+1)
T.sort()
for t in T:
print((t[2]))
| 28 | 9 | 583 | 160 | N = int(eval(input()))
S = [None] * N
P = [None] * N
I = [None] * N
for i in range(N):
tmp = input().split()
S[i] = tmp[0]
P[i] = int(tmp[1])
I[i] = i + 1
def less(a, b):
if a[0] == b[0]:
if a[1] == b[1]:
return a[2] < b[2]
return a[1] > b[1]
return a[0] < b[0]
fo... | N = int(eval(input()))
T = [None] * N
for i in range(N):
tmp = input().split()
T[i] = (tmp[0], -int(tmp[1]), i + 1)
T.sort()
for t in T:
print((t[2]))
| false | 67.857143 | [
"-S = [None] * N",
"-P = [None] * N",
"-I = [None] * N",
"+T = [None] * N",
"- S[i] = tmp[0]",
"- P[i] = int(tmp[1])",
"- I[i] = i + 1",
"-",
"-",
"-def less(a, b):",
"- if a[0] == b[0]:",
"- if a[1] == b[1]:",
"- return a[2] < b[2]",
"- return a[1] > b... | false | 0.076632 | 0.041609 | 1.841714 | [
"s236774262",
"s500679022"
] |
u077291787 | p02595 | python | s855151521 | s677924870 | 222 | 178 | 55,064 | 122,476 | Accepted | Accepted | 19.82 | # B - Distance
from math import sqrt
def main():
N, D, *XY = list(map(int, open(0).read().split()))
res = sum(sqrt(x ** 2 + y ** 2) <= D for x, y in zip(*[iter(XY)] * 2))
print(res)
if __name__ == "__main__":
main()
| # B - Distance
def main():
N, D, *XY = list(map(int, open(0).read().split()))
res = sum(x ** 2 + y ** 2 <= D ** 2 for x, y in zip(*[iter(XY)] * 2))
print(res)
if __name__ == "__main__":
main()
| 12 | 9 | 241 | 213 | # B - Distance
from math import sqrt
def main():
N, D, *XY = list(map(int, open(0).read().split()))
res = sum(sqrt(x**2 + y**2) <= D for x, y in zip(*[iter(XY)] * 2))
print(res)
if __name__ == "__main__":
main()
| # B - Distance
def main():
N, D, *XY = list(map(int, open(0).read().split()))
res = sum(x**2 + y**2 <= D**2 for x, y in zip(*[iter(XY)] * 2))
print(res)
if __name__ == "__main__":
main()
| false | 25 | [
"-from math import sqrt",
"-",
"-",
"- res = sum(sqrt(x**2 + y**2) <= D for x, y in zip(*[iter(XY)] * 2))",
"+ res = sum(x**2 + y**2 <= D**2 for x, y in zip(*[iter(XY)] * 2))"
] | false | 0.062453 | 0.077358 | 0.807316 | [
"s855151521",
"s677924870"
] |
u741397536 | p03027 | python | s462808382 | s434590025 | 1,572 | 1,436 | 63,184 | 72,924 | Accepted | Accepted | 8.65 | Q = int(eval(input()))
mod = 10**6+3
arr = []
for i in range(Q):
x, d, n = list(map(int, input().split()))
arr.append([x, d, n])
P = [1]*(mod+1)
for i in range(mod):
P[i+1] = P[i]*(i+1)%mod
def rev(a):
return pow(a,mod-2,mod)
def f(x, d, n):
if d == 0:
return pow(x, n, mod... | Q = int(eval(input()))
mod = 10**6+3
arr = []
for i in range(Q):
arr.append(list(map(int, input().split())))
P = [1]*(mod+1)
for i in range(mod):
P[i+1] = P[i]*(i+1)%mod
def rev(a):
return pow(a,mod-2,mod)
def f(x, d, n):
if d == 0:
return pow(x, n, mod)
else:
d_r... | 28 | 28 | 623 | 607 | Q = int(eval(input()))
mod = 10**6 + 3
arr = []
for i in range(Q):
x, d, n = list(map(int, input().split()))
arr.append([x, d, n])
P = [1] * (mod + 1)
for i in range(mod):
P[i + 1] = P[i] * (i + 1) % mod
def rev(a):
return pow(a, mod - 2, mod)
def f(x, d, n):
if d == 0:
return pow(x, n, ... | Q = int(eval(input()))
mod = 10**6 + 3
arr = []
for i in range(Q):
arr.append(list(map(int, input().split())))
P = [1] * (mod + 1)
for i in range(mod):
P[i + 1] = P[i] * (i + 1) % mod
def rev(a):
return pow(a, mod - 2, mod)
def f(x, d, n):
if d == 0:
return pow(x, n, mod)
else:
d... | false | 0 | [
"- x, d, n = list(map(int, input().split()))",
"- arr.append([x, d, n])",
"+ arr.append(list(map(int, input().split())))",
"- if d_r * x % mod == 0:",
"+ xdr = d_r * x % mod",
"+ if xdr == 0:",
"- elif (d_r * x % mod + n - 1) >= mod:",
"+ elif (xdr + n - 1) ... | false | 0.726029 | 0.723595 | 1.003364 | [
"s462808382",
"s434590025"
] |
u150984829 | p00510 | python | s742294207 | s566868921 | 50 | 30 | 5,692 | 5,616 | Accepted | Accepted | 40 | n=int(eval(input()))
a=s=int(eval(input()))
b=1
for _ in[0]*n:
i,o=list(map(int,input().split()))
s+=i-o
if s<0:b=0;break
if a<s:a=s
print((a*b))
| import sys
eval(input())
a=s=int(eval(input()))
b=1
for e in sys.stdin:
i,o=list(map(int,e.split()))
s+=i-o
if s<0:b=0;break
if a<s:a=s
print((a*b))
| 9 | 10 | 138 | 142 | n = int(eval(input()))
a = s = int(eval(input()))
b = 1
for _ in [0] * n:
i, o = list(map(int, input().split()))
s += i - o
if s < 0:
b = 0
break
if a < s:
a = s
print((a * b))
| import sys
eval(input())
a = s = int(eval(input()))
b = 1
for e in sys.stdin:
i, o = list(map(int, e.split()))
s += i - o
if s < 0:
b = 0
break
if a < s:
a = s
print((a * b))
| false | 10 | [
"-n = int(eval(input()))",
"+import sys",
"+",
"+eval(input())",
"-for _ in [0] * n:",
"- i, o = list(map(int, input().split()))",
"+for e in sys.stdin:",
"+ i, o = list(map(int, e.split()))"
] | false | 0.047661 | 0.047772 | 0.997683 | [
"s742294207",
"s566868921"
] |
u380772254 | p02744 | python | s836258812 | s760309889 | 612 | 376 | 64,856 | 55,768 | Accepted | Accepted | 38.56 | import sys
def I(): return int(sys.stdin.readline())
def MI(): return list(map(int, sys.stdin.readline().split()))
def LMI(): return list(map(int, sys.stdin.readline().split()))
MOD = 10 ** 9 + 7
s = 'abcdefghijklmnop'
N = I()
for c1 in range(1):
if N == 1:
print((s[c1]))
... | import sys
def I(): return int(sys.stdin.readline())
def MI(): return list(map(int, sys.stdin.readline().split()))
def LMI(): return list(map(int, sys.stdin.readline().split()))
MOD = 10 ** 9 + 7
s = 'abcdefghijklmnop'
N = I()
def f(n, seq, m):
for i in range(m + 1):
if n == N:
... | 55 | 21 | 2,179 | 416 | import sys
def I():
return int(sys.stdin.readline())
def MI():
return list(map(int, sys.stdin.readline().split()))
def LMI():
return list(map(int, sys.stdin.readline().split()))
MOD = 10**9 + 7
s = "abcdefghijklmnop"
N = I()
for c1 in range(1):
if N == 1:
print((s[c1]))
continue
... | import sys
def I():
return int(sys.stdin.readline())
def MI():
return list(map(int, sys.stdin.readline().split()))
def LMI():
return list(map(int, sys.stdin.readline().split()))
MOD = 10**9 + 7
s = "abcdefghijklmnop"
N = I()
def f(n, seq, m):
for i in range(m + 1):
if n == N:
... | false | 61.818182 | [
"-for c1 in range(1):",
"- if N == 1:",
"- print((s[c1]))",
"- continue",
"- for c2 in range(2):",
"- if N == 2:",
"- print((s[c1] + s[c2]))",
"- continue",
"- for c3 in range(max(c1, c2) + 2):",
"- if N == 3:",
"- ... | false | 0.038542 | 0.038009 | 1.014014 | [
"s836258812",
"s760309889"
] |
u548624367 | p03329 | python | s486604885 | s355213028 | 593 | 271 | 6,296 | 2,940 | Accepted | Accepted | 54.3 | n = int(eval(input()))
v = [1,6,36,216,1296,7776,46656,9,81,729,6561,59049]
dp = [float("inf") for i in range(n+1)]
dp[0] = 0
for i in range(n):
for j in v:
if i + j <= n:
dp[i+j] = min(dp[i+j], dp[i]+1)
print(("{}".format(dp[n])))
| def ds(a, b):
return a if a<b else ds(a//b,b)+a%b
ans = float('inf')
n = int(eval(input()))
for i in range(n+1):
ans = min(ans,ds(i,6)+ds(n-i,9))
print(ans) | 9 | 7 | 238 | 158 | n = int(eval(input()))
v = [1, 6, 36, 216, 1296, 7776, 46656, 9, 81, 729, 6561, 59049]
dp = [float("inf") for i in range(n + 1)]
dp[0] = 0
for i in range(n):
for j in v:
if i + j <= n:
dp[i + j] = min(dp[i + j], dp[i] + 1)
print(("{}".format(dp[n])))
| def ds(a, b):
return a if a < b else ds(a // b, b) + a % b
ans = float("inf")
n = int(eval(input()))
for i in range(n + 1):
ans = min(ans, ds(i, 6) + ds(n - i, 9))
print(ans)
| false | 22.222222 | [
"+def ds(a, b):",
"+ return a if a < b else ds(a // b, b) + a % b",
"+",
"+",
"+ans = float(\"inf\")",
"-v = [1, 6, 36, 216, 1296, 7776, 46656, 9, 81, 729, 6561, 59049]",
"-dp = [float(\"inf\") for i in range(n + 1)]",
"-dp[0] = 0",
"-for i in range(n):",
"- for j in v:",
"- if i + ... | false | 0.10566 | 0.121997 | 0.866087 | [
"s486604885",
"s355213028"
] |
u959682820 | p02642 | python | s549429084 | s384135331 | 1,323 | 596 | 32,300 | 31,896 | Accepted | Accepted | 54.95 | n = int(eval(input()))
a = list(map(int, input().split()))
MAX = 1000005
cnt = [0] * MAX
for x in a:
if cnt[x] > 2:
continue
#cnt配列の各倍数のところに+1
for i in range(x, MAX, x):
cnt[i] += 1
ans = 0
for x in a:
if cnt[x] == 1:
ans += 1
print(ans) | n = int(eval(input()))
a = list(map(int, input().split()))
MAX = 1000005
cnt = [0] * MAX
for x in a:
if cnt[x] != 0:
cnt[x] = 2
continue
#cnt配列の各倍数のところに+1
for i in range(x, MAX, x):
cnt[i] += 1
ans = 0
for x in a:
if cnt[x] == 1:
ans += 1
print(ans) | 17 | 18 | 289 | 310 | n = int(eval(input()))
a = list(map(int, input().split()))
MAX = 1000005
cnt = [0] * MAX
for x in a:
if cnt[x] > 2:
continue
# cnt配列の各倍数のところに+1
for i in range(x, MAX, x):
cnt[i] += 1
ans = 0
for x in a:
if cnt[x] == 1:
ans += 1
print(ans)
| n = int(eval(input()))
a = list(map(int, input().split()))
MAX = 1000005
cnt = [0] * MAX
for x in a:
if cnt[x] != 0:
cnt[x] = 2
continue
# cnt配列の各倍数のところに+1
for i in range(x, MAX, x):
cnt[i] += 1
ans = 0
for x in a:
if cnt[x] == 1:
ans += 1
print(ans)
| false | 5.555556 | [
"- if cnt[x] > 2:",
"+ if cnt[x] != 0:",
"+ cnt[x] = 2"
] | false | 0.23989 | 0.15766 | 1.521562 | [
"s549429084",
"s384135331"
] |
u580697892 | p02899 | python | s687130739 | s203451612 | 337 | 291 | 23,348 | 24,128 | Accepted | Accepted | 13.65 | # coding: utf-8
N = int(input())
A = list(map(int, input().split()))
for i in range(N):
A[i] = [A[i]]
A[i].append(i+1)
A.sort(key=lambda x: x[0])
for i in range(N):
print(A[i][1], end=" ")
| # coding: utf-8
N = int(input())
A = list(map(int, input().split()))
ans = [[i+1] for i in range(N)]
for i in range(N):
ans[i].append(A[i])
ans.sort(key=lambda x: x[1])
for i in range(N):
print(ans[i][0], end=" ")
| 9 | 9 | 208 | 229 | # coding: utf-8
N = int(input())
A = list(map(int, input().split()))
for i in range(N):
A[i] = [A[i]]
A[i].append(i + 1)
A.sort(key=lambda x: x[0])
for i in range(N):
print(A[i][1], end=" ")
| # coding: utf-8
N = int(input())
A = list(map(int, input().split()))
ans = [[i + 1] for i in range(N)]
for i in range(N):
ans[i].append(A[i])
ans.sort(key=lambda x: x[1])
for i in range(N):
print(ans[i][0], end=" ")
| false | 0 | [
"+ans = [[i + 1] for i in range(N)]",
"- A[i] = [A[i]]",
"- A[i].append(i + 1)",
"-A.sort(key=lambda x: x[0])",
"+ ans[i].append(A[i])",
"+ans.sort(key=lambda x: x[1])",
"- print(A[i][1], end=\" \")",
"+ print(ans[i][0], end=\" \")"
] | false | 0.044643 | 0.047231 | 0.945198 | [
"s687130739",
"s203451612"
] |
u631277801 | p03637 | python | s503305005 | s210204870 | 85 | 65 | 14,228 | 14,168 | Accepted | Accepted | 23.53 | N = int(eval(input()))
A = list(map(int, input().split()))
odds = []
bai4 = []
for i in range(N):
odds.append(A[i]%2 == 1)
bai4.append(A[i]%4 == 0)
odd = sum(odds)
bi4 = sum(bai4)
bi2 = N - odd - bi4
if odd + bool(bi2) > bi4+1:
print("No")
else:
print("Yes") | import sys
stdin = sys.stdin
def li(): return list(map(int, stdin.readline().split()))
def li_(): return [int(x)-1 for x in stdin.readline().split()]
def lf(): return list(map(float, stdin.readline().split()))
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return... | 18 | 34 | 293 | 677 | N = int(eval(input()))
A = list(map(int, input().split()))
odds = []
bai4 = []
for i in range(N):
odds.append(A[i] % 2 == 1)
bai4.append(A[i] % 4 == 0)
odd = sum(odds)
bi4 = sum(bai4)
bi2 = N - odd - bi4
if odd + bool(bi2) > bi4 + 1:
print("No")
else:
print("Yes")
| import sys
stdin = sys.stdin
def li():
return list(map(int, stdin.readline().split()))
def li_():
return [int(x) - 1 for x in stdin.readline().split()]
def lf():
return list(map(float, stdin.readline().split()))
def ls():
return stdin.readline().split()
def ns():
return stdin.readline().r... | false | 47.058824 | [
"-N = int(eval(input()))",
"-A = list(map(int, input().split()))",
"-odds = []",
"-bai4 = []",
"-for i in range(N):",
"- odds.append(A[i] % 2 == 1)",
"- bai4.append(A[i] % 4 == 0)",
"-odd = sum(odds)",
"-bi4 = sum(bai4)",
"-bi2 = N - odd - bi4",
"-if odd + bool(bi2) > bi4 + 1:",
"+import... | false | 0.039686 | 0.038043 | 1.043174 | [
"s503305005",
"s210204870"
] |
u201234972 | p03700 | python | s808448954 | s516024069 | 1,721 | 596 | 8,948 | 51,816 | Accepted | Accepted | 65.37 | N, A, B = list(map( int, input().split()))
H = [0]*N
hmax = 0
for i in range(N):
h = int( eval(input()))
H[i] = h
hmax = max( h, hmax)
L = 0
R = hmax//B + 1
add = A-B
while L != R:
now = (L+R)//2
need = 0
for i in range(N):
if H[i] > now*B:
need += (H[i]-1-no... | N, A, B = list(map( int, input().split()))
H = [0]*N
hmax = 0
for i in range(N):
h = int( eval(input()))
H[i] = h
hmax = max( h, hmax)
L = 0
R = hmax//B + 1
add = A-B
while L != R:
now = (L+R)//2
need = 0
for i in range(N):
if H[i] > now*B:
need += (H[i]-1-no... | 22 | 22 | 399 | 451 | N, A, B = list(map(int, input().split()))
H = [0] * N
hmax = 0
for i in range(N):
h = int(eval(input()))
H[i] = h
hmax = max(h, hmax)
L = 0
R = hmax // B + 1
add = A - B
while L != R:
now = (L + R) // 2
need = 0
for i in range(N):
if H[i] > now * B:
need += (H[i] - 1 - now * ... | N, A, B = list(map(int, input().split()))
H = [0] * N
hmax = 0
for i in range(N):
h = int(eval(input()))
H[i] = h
hmax = max(h, hmax)
L = 0
R = hmax // B + 1
add = A - B
while L != R:
now = (L + R) // 2
need = 0
for i in range(N):
if H[i] > now * B:
need += (H[i] - 1 - now * ... | false | 0 | [
"- if need <= now:",
"+ if need <= now: # うまくいくとき",
"- else:",
"- L = now + 1",
"+ else: # うまくいかないとき",
"+ L = now + 1 # うまく行かないので+1している.これがないと無限ループが発生する。"
] | false | 0.085062 | 0.04643 | 1.832021 | [
"s808448954",
"s516024069"
] |
u171366497 | p03734 | python | s829814727 | s787830093 | 177 | 36 | 3,064 | 3,064 | Accepted | Accepted | 79.66 | N,W=list(map(int,input().split()))
w0,v=list(map(int,input().split()))
goods=[[v],[],[],[]]
for i in range(N-1):
w,v=list(map(int,input().split()))
goods[w-w0].append(v)
val=[]
for x in range(4):
goods[x].sort(reverse=True)
valx=[0]*(len(goods[x])+1)
for k in range(len(goods[x])):
... | N,W=list(map(int,input().split()))
goods=[[] for i in range(4)]
w1=-1
for i in range(N):
w,v=list(map(int,input().split()))
if i==0:
w1=w
goods[w-w1].append(v)
S=[]
for x in range(4):
goods[x].sort(reverse=True)
G=goods[x]
now=[0]*(len(G)+1)
for i in range(len(G)):
... | 28 | 26 | 811 | 680 | N, W = list(map(int, input().split()))
w0, v = list(map(int, input().split()))
goods = [[v], [], [], []]
for i in range(N - 1):
w, v = list(map(int, input().split()))
goods[w - w0].append(v)
val = []
for x in range(4):
goods[x].sort(reverse=True)
valx = [0] * (len(goods[x]) + 1)
for k in range(len(g... | N, W = list(map(int, input().split()))
goods = [[] for i in range(4)]
w1 = -1
for i in range(N):
w, v = list(map(int, input().split()))
if i == 0:
w1 = w
goods[w - w1].append(v)
S = []
for x in range(4):
goods[x].sort(reverse=True)
G = goods[x]
now = [0] * (len(G) + 1)
for i in range... | false | 7.142857 | [
"-w0, v = list(map(int, input().split()))",
"-goods = [[v], [], [], []]",
"-for i in range(N - 1):",
"+goods = [[] for i in range(4)]",
"+w1 = -1",
"+for i in range(N):",
"- goods[w - w0].append(v)",
"-val = []",
"+ if i == 0:",
"+ w1 = w",
"+ goods[w - w1].append(v)",
"+S = []... | false | 0.074761 | 0.076333 | 0.979408 | [
"s829814727",
"s787830093"
] |
u562935282 | p02909 | python | s802741660 | s343052196 | 169 | 17 | 38,256 | 2,940 | Accepted | Accepted | 89.94 | s = eval(input())
w = ['Sunny', 'Cloudy', 'Rainy']
print((w[(w.index(s) + 1) % 3]))
| def main():
W = ['Sunny', 'Cloudy', 'Rainy']
S = eval(input())
i = (W.index(S) + 1) % 3
print((W[i]))
if __name__ == '__main__':
main()
| 4 | 9 | 80 | 158 | s = eval(input())
w = ["Sunny", "Cloudy", "Rainy"]
print((w[(w.index(s) + 1) % 3]))
| def main():
W = ["Sunny", "Cloudy", "Rainy"]
S = eval(input())
i = (W.index(S) + 1) % 3
print((W[i]))
if __name__ == "__main__":
main()
| false | 55.555556 | [
"-s = eval(input())",
"-w = [\"Sunny\", \"Cloudy\", \"Rainy\"]",
"-print((w[(w.index(s) + 1) % 3]))",
"+def main():",
"+ W = [\"Sunny\", \"Cloudy\", \"Rainy\"]",
"+ S = eval(input())",
"+ i = (W.index(S) + 1) % 3",
"+ print((W[i]))",
"+",
"+",
"+if __name__ == \"__main__\":",
"+ ... | false | 0.034087 | 0.042949 | 0.793658 | [
"s802741660",
"s343052196"
] |
u187205913 | p03476 | python | s910625759 | s414894778 | 1,662 | 499 | 32,048 | 32,236 | Accepted | Accepted | 69.98 | q = int(eval(input()))
l = [list(map(int,input().split())) for _ in range(q)]
def prime_table(n):
list = [True for _ in range(n+1)]
for i in range(2,int(n**0.5)+1):
if list[i]:
j = i*2
while j<=n:
list[j] = False
j += i
table = [i f... | q = int(eval(input()))
l = [list(map(int,input().split())) for _ in range(q)]
def prime_table(n):
list = [True for _ in range(n+1)]
for i in range(2,int(n**0.5)+1):
if list[i]:
j = i*2
while j<=n:
list[j] = False
j += i
table = [i f... | 24 | 25 | 649 | 651 | q = int(eval(input()))
l = [list(map(int, input().split())) for _ in range(q)]
def prime_table(n):
list = [True for _ in range(n + 1)]
for i in range(2, int(n**0.5) + 1):
if list[i]:
j = i * 2
while j <= n:
list[j] = False
j += i
table = [i f... | q = int(eval(input()))
l = [list(map(int, input().split())) for _ in range(q)]
def prime_table(n):
list = [True for _ in range(n + 1)]
for i in range(2, int(n**0.5) + 1):
if list[i]:
j = i * 2
while j <= n:
list[j] = False
j += i
table = [i f... | false | 4 | [
"+table_set = set(table)",
"-for i in range(len(table)):",
"- if table[i] * 2 - 1 in table:",
"- sim_sum[table[i] * 2 - 1] += 1",
"+for p in table:",
"+ if p * 2 - 1 in table_set:",
"+ sim_sum[p * 2 - 1] += 1"
] | false | 1.351127 | 0.347132 | 3.892253 | [
"s910625759",
"s414894778"
] |
u803647747 | p03804 | python | s823164756 | s845623792 | 25 | 23 | 3,064 | 3,060 | Accepted | Accepted | 8 | N, M = list(map(int, input().split()))
A_list = []
B_list = []
for _ in range(N):
A_list.append(list(eval(input())))
for _ in range(M):
B_list.append(list(eval(input())))
whole_flag = 0
for i in range(N-M+1):
for j in range(N-M+1):
flag = 0
for k in range(M):
... | N, M = list(map(int, input().split()))
A_list=[eval(input())for i in range(N)]
B_list=[eval(input())for i in range(M)]
whole_flag = 0
for i in range(N-M+1):
for j in range(N-M+1):
flag = 0
for k in range(M):
if B_list[k] == A_list[i+k][j:j+M]:
flag += 1
... | 25 | 17 | 534 | 442 | N, M = list(map(int, input().split()))
A_list = []
B_list = []
for _ in range(N):
A_list.append(list(eval(input())))
for _ in range(M):
B_list.append(list(eval(input())))
whole_flag = 0
for i in range(N - M + 1):
for j in range(N - M + 1):
flag = 0
for k in range(M):
if B_list[k]... | N, M = list(map(int, input().split()))
A_list = [eval(input()) for i in range(N)]
B_list = [eval(input()) for i in range(M)]
whole_flag = 0
for i in range(N - M + 1):
for j in range(N - M + 1):
flag = 0
for k in range(M):
if B_list[k] == A_list[i + k][j : j + M]:
flag += ... | false | 32 | [
"-A_list = []",
"-B_list = []",
"-for _ in range(N):",
"- A_list.append(list(eval(input())))",
"-for _ in range(M):",
"- B_list.append(list(eval(input())))",
"+A_list = [eval(input()) for i in range(N)]",
"+B_list = [eval(input()) for i in range(M)]",
"-if whole_flag == 0:",
"- print(\"No... | false | 0.14471 | 0.088712 | 1.631232 | [
"s823164756",
"s845623792"
] |
u852690916 | p02762 | python | s016962752 | s248479173 | 1,219 | 574 | 74,248 | 61,912 | Accepted | Accepted | 52.91 | def main():
N, M, K=list(map(int, input().split()))
friend_or_block = [0] * N
parent = [-1] * N
def root(x):
p, s = parent[x], list()
while p >= 0:
s.append(x)
x, p = p, parent[p]
for c in s: parent[c] = x
return x
def same(x, y)... | import sys
input = sys.stdin.readline
def main():
N, M, K=list(map(int, input().split()))
friend_or_block = [0] * N
parent = [-1] * N
def root(x):
p, s = parent[x], list()
while p >= 0:
s.append(x)
x, p = p, parent[p]
for c in s: parent[c] = x... | 43 | 45 | 1,071 | 1,111 | def main():
N, M, K = list(map(int, input().split()))
friend_or_block = [0] * N
parent = [-1] * N
def root(x):
p, s = parent[x], list()
while p >= 0:
s.append(x)
x, p = p, parent[p]
for c in s:
parent[c] = x
return x
def same(x, y... | import sys
input = sys.stdin.readline
def main():
N, M, K = list(map(int, input().split()))
friend_or_block = [0] * N
parent = [-1] * N
def root(x):
p, s = parent[x], list()
while p >= 0:
s.append(x)
x, p = p, parent[p]
for c in s:
parent[c... | false | 4.444444 | [
"+import sys",
"+",
"+input = sys.stdin.readline",
"+",
"+"
] | false | 0.124776 | 0.121318 | 1.028502 | [
"s016962752",
"s248479173"
] |
u263737105 | p02583 | python | s066014764 | s346169327 | 113 | 90 | 9,084 | 9,120 | Accepted | Accepted | 20.35 | import itertools as it
N = int(eval(input()))
s = list(map(int, input().split()))
s.sort()
count = 0
c = it.combinations(s, 3)
for i in c:
listed = list(i)
if listed[0] == listed[1] or listed[1] == listed[2] or listed[2] == listed[0]:
continue
if (listed[0] + listed[1]) > listed[... | import itertools as it
N = int(eval(input()))
s = list(map(int, input().split()))
s.sort()
count = 0
c = it.combinations(s, 3)
for i in c:
if i[0] == i[1] or i[1] == i[2] or i[2] == i[0]:
continue
elif (i[0] + i[1]) > i[2]:
count += 1
print(count) | 19 | 18 | 353 | 288 | import itertools as it
N = int(eval(input()))
s = list(map(int, input().split()))
s.sort()
count = 0
c = it.combinations(s, 3)
for i in c:
listed = list(i)
if listed[0] == listed[1] or listed[1] == listed[2] or listed[2] == listed[0]:
continue
if (listed[0] + listed[1]) > listed[2]:
count +... | import itertools as it
N = int(eval(input()))
s = list(map(int, input().split()))
s.sort()
count = 0
c = it.combinations(s, 3)
for i in c:
if i[0] == i[1] or i[1] == i[2] or i[2] == i[0]:
continue
elif (i[0] + i[1]) > i[2]:
count += 1
print(count)
| false | 5.263158 | [
"- listed = list(i)",
"- if listed[0] == listed[1] or listed[1] == listed[2] or listed[2] == listed[0]:",
"+ if i[0] == i[1] or i[1] == i[2] or i[2] == i[0]:",
"- if (listed[0] + listed[1]) > listed[2]:",
"+ elif (i[0] + i[1]) > i[2]:"
] | false | 0.135586 | 0.047441 | 2.857988 | [
"s066014764",
"s346169327"
] |
u084261177 | p02813 | python | s889261208 | s089413327 | 49 | 37 | 8,052 | 10,228 | Accepted | Accepted | 24.49 | import itertools
if __name__ == '__main__':
# P and Q are both rearrangements of (1, 2, ..., N)).
# N! possible permutations of size N
# among them, let P and Q be the a-th and the b-th
n = int(eval(input()))
p = input().split(' ')
q = input().split(' ')
for i in range(0, len(q))... | import itertools
if __name__ == '__main__':
# P and Q are both rearrangements of (1, 2, ..., N)).
# N! possible permutations of size N
# among them, let P and Q be the a-th and the b-th
n = int(eval(input()))
p = list(map(int, input().split(' ')))
q = list(map(int, input().split(' ')))
... | 32 | 17 | 692 | 476 | import itertools
if __name__ == "__main__":
# P and Q are both rearrangements of (1, 2, ..., N)).
# N! possible permutations of size N
# among them, let P and Q be the a-th and the b-th
n = int(eval(input()))
p = input().split(" ")
q = input().split(" ")
for i in range(0, len(q)):
p... | import itertools
if __name__ == "__main__":
# P and Q are both rearrangements of (1, 2, ..., N)).
# N! possible permutations of size N
# among them, let P and Q be the a-th and the b-th
n = int(eval(input()))
p = list(map(int, input().split(" ")))
q = list(map(int, input().split(" ")))
real... | false | 46.875 | [
"- p = input().split(\" \")",
"- q = input().split(\" \")",
"- for i in range(0, len(q)):",
"- p[i] = int(p[i])",
"- q[i] = int(q[i])",
"+ p = list(map(int, input().split(\" \")))",
"+ q = list(map(int, input().split(\" \")))",
"- perm = list(itertools.permutations(real... | false | 0.093042 | 0.037616 | 2.473488 | [
"s889261208",
"s089413327"
] |
u345966487 | p02900 | python | s770951582 | s822627564 | 282 | 196 | 65,640 | 5,712 | Accepted | Accepted | 30.5 | import math
from fractions import gcd
a,b = list(map(int,input().split()))
g = gcd(a,b)
gr = int(math.ceil(math.sqrt(g)))
facs = [1]
i = 2
while i*i <= g:
if g == 1:
break
if g % i == 0:
facs.append(i)
while g % i == 0:
g //= i
i += 1
if g != 1:
fa... | import sys
import fractions
sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inm = lambda: list(map(int, sys.stdin.readline().split()))
inl = lambda: list(inm())
ins = lambda: sys.stdin.readline().rstrip()
# debug = lambda *a, **kw: print(*a, **kw, file=sys.stderr)
A, B = inm()
de... | 21 | 31 | 347 | 639 | import math
from fractions import gcd
a, b = list(map(int, input().split()))
g = gcd(a, b)
gr = int(math.ceil(math.sqrt(g)))
facs = [1]
i = 2
while i * i <= g:
if g == 1:
break
if g % i == 0:
facs.append(i)
while g % i == 0:
g //= i
i += 1
if g != 1:
facs.append(g)
p... | import sys
import fractions
sys.setrecursionlimit(10**8)
ini = lambda: int(sys.stdin.readline())
inm = lambda: list(map(int, sys.stdin.readline().split()))
inl = lambda: list(inm())
ins = lambda: sys.stdin.readline().rstrip()
# debug = lambda *a, **kw: print(*a, **kw, file=sys.stderr)
A, B = inm()
def solve():
x... | false | 32.258065 | [
"-import math",
"-from fractions import gcd",
"+import sys",
"+import fractions",
"-a, b = list(map(int, input().split()))",
"-g = gcd(a, b)",
"-gr = int(math.ceil(math.sqrt(g)))",
"-facs = [1]",
"-i = 2",
"-while i * i <= g:",
"- if g == 1:",
"- break",
"- if g % i == 0:",
"-... | false | 0.057457 | 0.057694 | 0.995881 | [
"s770951582",
"s822627564"
] |
u044952145 | p03215 | python | s028881277 | s138390401 | 684 | 625 | 55,692 | 27,816 | Accepted | Accepted | 8.63 | import itertools
N, K = list(map(int, input().split()))
a = list(map(int, input().split()))
beautiful_num = []
for i in range(N):
temp = 0
for n in a[i:]:
temp += n
beautiful_num.append("{:040b}".format(temp))
ma_b_cnt = 0
target_set = None
result = 0
for i in range(40):
... | import itertools
N, K = list(map(int, input().split()))
a = list(map(int, input().split()))
beautiful_num = []
for i in range(N):
temp = 0
for n in a[i:]:
temp += n
beautiful_num.append(temp)
ma_b_cnt = 0
target_set = None
result = 0
for i in range(40, -1, -1):
for b... | 26 | 26 | 574 | 565 | import itertools
N, K = list(map(int, input().split()))
a = list(map(int, input().split()))
beautiful_num = []
for i in range(N):
temp = 0
for n in a[i:]:
temp += n
beautiful_num.append("{:040b}".format(temp))
ma_b_cnt = 0
target_set = None
result = 0
for i in range(40):
for b in beautiful_... | import itertools
N, K = list(map(int, input().split()))
a = list(map(int, input().split()))
beautiful_num = []
for i in range(N):
temp = 0
for n in a[i:]:
temp += n
beautiful_num.append(temp)
ma_b_cnt = 0
target_set = None
result = 0
for i in range(40, -1, -1):
for b in beautiful_num:
... | false | 0 | [
"- beautiful_num.append(\"{:040b}\".format(temp))",
"+ beautiful_num.append(temp)",
"-for i in range(40):",
"+for i in range(40, -1, -1):",
"- if b[i] == \"1\":",
"+ if b & 1 << i != 0:",
"- result += 2 ** (40 - i - 1)",
"- beautiful_num = [b for b in beautifu... | false | 0.047045 | 0.048287 | 0.974271 | [
"s028881277",
"s138390401"
] |
u071269360 | p03448 | python | s801016178 | s164781454 | 32 | 29 | 9,228 | 9,196 | Accepted | Accepted | 9.38 | a = int(eval(input()))
b = int(eval(input()))
c = int(eval(input()))
x = int(eval(input()))
cnt = 0
a_min = min( int(x/500) ,a)
for ai in range(a_min+1):
rem_a = x - (ai * 500)
if rem_a == 0:
cnt+=1
break
b_min = min( int(rem_a/100) ,b)
for bi in range(b_min+1):
re... | a = int(eval(input()))
b = int(eval(input()))
c = int(eval(input()))
x = int(eval(input()))
cnt = 0
a_min = min( x//500 ,a)
for ai in range(a_min+1):
rem_a = x - (ai * 500)
if rem_a == 0:
cnt+=1
break
b_min = min( rem_a//100 ,b)
for bi in range(b_min+1):
rem_b = re... | 26 | 22 | 586 | 483 | a = int(eval(input()))
b = int(eval(input()))
c = int(eval(input()))
x = int(eval(input()))
cnt = 0
a_min = min(int(x / 500), a)
for ai in range(a_min + 1):
rem_a = x - (ai * 500)
if rem_a == 0:
cnt += 1
break
b_min = min(int(rem_a / 100), b)
for bi in range(b_min + 1):
rem_b = r... | a = int(eval(input()))
b = int(eval(input()))
c = int(eval(input()))
x = int(eval(input()))
cnt = 0
a_min = min(x // 500, a)
for ai in range(a_min + 1):
rem_a = x - (ai * 500)
if rem_a == 0:
cnt += 1
break
b_min = min(rem_a // 100, b)
for bi in range(b_min + 1):
rem_b = rem_a - (... | false | 15.384615 | [
"-a_min = min(int(x / 500), a)",
"+a_min = min(x // 500, a)",
"- b_min = min(int(rem_a / 100), b)",
"+ b_min = min(rem_a // 100, b)",
"- c_min = min(int(rem_b / 50), c)",
"- for ci in range(c_min + 1):",
"- rem_c = rem_b - (ci * 50)",
"- if rem_c == 0:",
"- ... | false | 0.113089 | 0.038637 | 2.926936 | [
"s801016178",
"s164781454"
] |
u128282559 | p03037 | python | s257516886 | s753431422 | 335 | 263 | 38,316 | 27,112 | Accepted | Accepted | 21.49 | n, m = list(map(int, input().split()))
a = []
for i in range(m):
a.append(input().split())
haba = a[0]
for i in a:
if int(haba[0]) <= int(i[0]) <= int(haba[1]):
haba[0] = i[0]
elif int(haba[1]) < int(i[0]):
print((0))
exit()
if int(haba[0]) <= int(i[1]) <= int(haba[1])... | n, m = list(map(int, input().split()))
a = []
for i in range(m):
a.append(list(map(int, input().split())))
haba = a[0]
for i in a:
if haba[0] <= i[0] <= haba[1]:
haba[0] = i[0]
elif haba[1] < i[0]:
print((0))
exit()
if haba[0] <= i[1] <= haba[1]:
haba[1] = i[1... | 23 | 23 | 577 | 513 | n, m = list(map(int, input().split()))
a = []
for i in range(m):
a.append(input().split())
haba = a[0]
for i in a:
if int(haba[0]) <= int(i[0]) <= int(haba[1]):
haba[0] = i[0]
elif int(haba[1]) < int(i[0]):
print((0))
exit()
if int(haba[0]) <= int(i[1]) <= int(haba[1]):
h... | n, m = list(map(int, input().split()))
a = []
for i in range(m):
a.append(list(map(int, input().split())))
haba = a[0]
for i in a:
if haba[0] <= i[0] <= haba[1]:
haba[0] = i[0]
elif haba[1] < i[0]:
print((0))
exit()
if haba[0] <= i[1] <= haba[1]:
haba[1] = i[1]
elif i... | false | 0 | [
"- a.append(input().split())",
"+ a.append(list(map(int, input().split())))",
"- if int(haba[0]) <= int(i[0]) <= int(haba[1]):",
"+ if haba[0] <= i[0] <= haba[1]:",
"- elif int(haba[1]) < int(i[0]):",
"+ elif haba[1] < i[0]:",
"- if int(haba[0]) <= int(i[1]) <= int(haba[1]):",
"+ ... | false | 0.122839 | 0.045701 | 2.687889 | [
"s257516886",
"s753431422"
] |
u652656291 | p03013 | python | s711380067 | s259987664 | 191 | 77 | 12,652 | 13,940 | Accepted | Accepted | 59.69 | MOD = 10**9 + 7
N,M = list(map(int,input().split()))
dp = [0]*(N+1)
dp[0] = 1
A = set(int(eval(input())) for _ in range(M)) # 禁止地帯
for i in range(1,N+1):
if i in A:
continue
x = dp[i-1]
if i > 1:
x += dp[i-2]
dp[i] = x%MOD
answer = dp[N]
print(answer)
| n,m,*a=list(map(int,open(0).read().split()))
b=[1]*(n+1)
for i in a:
b[i]=0
for i in range(2,n+1):
b[i]=(b[i-1]+b[i-2])%1000000007*b[i]
print((b[-1]))
| 17 | 7 | 275 | 157 | MOD = 10**9 + 7
N, M = list(map(int, input().split()))
dp = [0] * (N + 1)
dp[0] = 1
A = set(int(eval(input())) for _ in range(M)) # 禁止地帯
for i in range(1, N + 1):
if i in A:
continue
x = dp[i - 1]
if i > 1:
x += dp[i - 2]
dp[i] = x % MOD
answer = dp[N]
print(answer)
| n, m, *a = list(map(int, open(0).read().split()))
b = [1] * (n + 1)
for i in a:
b[i] = 0
for i in range(2, n + 1):
b[i] = (b[i - 1] + b[i - 2]) % 1000000007 * b[i]
print((b[-1]))
| false | 58.823529 | [
"-MOD = 10**9 + 7",
"-N, M = list(map(int, input().split()))",
"-dp = [0] * (N + 1)",
"-dp[0] = 1",
"-A = set(int(eval(input())) for _ in range(M)) # 禁止地帯",
"-for i in range(1, N + 1):",
"- if i in A:",
"- continue",
"- x = dp[i - 1]",
"- if i > 1:",
"- x += dp[i - 2]",
... | false | 0.041908 | 0.115546 | 0.362692 | [
"s711380067",
"s259987664"
] |
u170201762 | p03504 | python | s507742677 | s360700473 | 734 | 567 | 52,156 | 21,376 | Accepted | Accepted | 22.75 | N,C = list(map(int,input().split()))
cum = [0]*(10**5+1)
tail = {}
head = {}
for i in range(10**5+1):
tail[i] = []
head[i] = []
for i in range(N):
s,t,c = list(map(int,input().split()))
if c not in tail[s] and c not in head[t-1]:
cum[s-1] += 1
cum[t] -= 1
elif c not in he... | N,C = list(map(int,input().split()))
cum = [0]*(10**5+1)
st = [[] for _ in range(C)]
for _ in range(N):
s,t,c = list(map(int,input().split()))
st[c-1].append([s,t])
for c in range(C):
st[c].sort()
st_concat = [[] for _ in range(C)]
for c in range(C):
if len(st[c]) != 0:
s0,t0 = st[c... | 26 | 30 | 590 | 712 | N, C = list(map(int, input().split()))
cum = [0] * (10**5 + 1)
tail = {}
head = {}
for i in range(10**5 + 1):
tail[i] = []
head[i] = []
for i in range(N):
s, t, c = list(map(int, input().split()))
if c not in tail[s] and c not in head[t - 1]:
cum[s - 1] += 1
cum[t] -= 1
elif c not in... | N, C = list(map(int, input().split()))
cum = [0] * (10**5 + 1)
st = [[] for _ in range(C)]
for _ in range(N):
s, t, c = list(map(int, input().split()))
st[c - 1].append([s, t])
for c in range(C):
st[c].sort()
st_concat = [[] for _ in range(C)]
for c in range(C):
if len(st[c]) != 0:
s0, t0 = st[c... | false | 13.333333 | [
"-tail = {}",
"-head = {}",
"-for i in range(10**5 + 1):",
"- tail[i] = []",
"- head[i] = []",
"-for i in range(N):",
"+st = [[] for _ in range(C)]",
"+for _ in range(N):",
"- if c not in tail[s] and c not in head[t - 1]:",
"+ st[c - 1].append([s, t])",
"+for c in range(C):",
"+ ... | false | 0.768951 | 0.224104 | 3.431223 | [
"s507742677",
"s360700473"
] |
u687044304 | p03031 | python | s085946687 | s960922164 | 26 | 22 | 3,064 | 3,064 | Accepted | Accepted | 15.38 | # -*- coding:utf-8 -*-
from itertools import product
def solve():
N, M = list(map(int, input().split()))
K, S = [], []
for _ in range(M):
_in = list(map(int, input().split()))
K.append(_in[0])
S.append(_in[1:])
P = list(map(int, input().split()))
all_stats = pro... | # -*- coding:utf-8 -*-
import itertools
def solve():
N, M = list(map(int, input().split()))
Ks, Ss = [], []
for i in range(M):
_in = list(map(int, input().split()))
Ks.append(_in[0])
Ss.append(_in[1:])
Ps = list(map(int, input().split()))
# 全探索でいける
switches... | 30 | 36 | 790 | 785 | # -*- coding:utf-8 -*-
from itertools import product
def solve():
N, M = list(map(int, input().split()))
K, S = [], []
for _ in range(M):
_in = list(map(int, input().split()))
K.append(_in[0])
S.append(_in[1:])
P = list(map(int, input().split()))
all_stats = product((0, 1),... | # -*- coding:utf-8 -*-
import itertools
def solve():
N, M = list(map(int, input().split()))
Ks, Ss = [], []
for i in range(M):
_in = list(map(int, input().split()))
Ks.append(_in[0])
Ss.append(_in[1:])
Ps = list(map(int, input().split()))
# 全探索でいける
switches = itertools.... | false | 16.666667 | [
"-from itertools import product",
"+import itertools",
"- K, S = [], []",
"- for _ in range(M):",
"+ Ks, Ss = [], []",
"+ for i in range(M):",
"- K.append(_in[0])",
"- S.append(_in[1:])",
"- P = list(map(int, input().split()))",
"- all_stats = product((0, 1), repeat... | false | 0.06423 | 0.120163 | 0.534522 | [
"s085946687",
"s960922164"
] |
u330039499 | p03814 | python | s624747487 | s907557217 | 86 | 11 | 6,400 | 2,924 | Accepted | Accepted | 87.21 | s = input()
print(len(s) - "".join(reversed(s)).index('Z') - s.index('A'))
| s = input()
print((s).rindex('Z') - s.index('A') + 1)
| 2 | 2 | 79 | 58 | s = input()
print(len(s) - "".join(reversed(s)).index("Z") - s.index("A"))
| s = input()
print((s).rindex("Z") - s.index("A") + 1)
| false | 0 | [
"-print(len(s) - \"\".join(reversed(s)).index(\"Z\") - s.index(\"A\"))",
"+print((s).rindex(\"Z\") - s.index(\"A\") + 1)"
] | false | 0.069585 | 0.037322 | 1.864473 | [
"s624747487",
"s907557217"
] |
u331327289 | p02693 | python | s589094213 | s016503560 | 701 | 530 | 109,212 | 106,264 | Accepted | Accepted | 24.39 | import sys
from numba import njit, void, i8
input = sys.stdin.buffer.readline
K = int(eval(input()))
A, B = list(map(int, input().split()))
@njit(i8(i8, i8, i8), cache=True)
def main(K, A, B):
for i in range(A, B + 1):
if i % K == 0:
print('OK')
return 0
print(... | import sys
from numba import njit, b1, i8
@njit(b1(i8, i8, i8), cache=True)
def solve(K, A, B):
for i in range(A, B + 1):
if i % K == 0:
return True
return False
def main():
input = sys.stdin.buffer.readline
K = int(eval(input()))
A, B = list(map(int, input()... | 21 | 23 | 379 | 410 | import sys
from numba import njit, void, i8
input = sys.stdin.buffer.readline
K = int(eval(input()))
A, B = list(map(int, input().split()))
@njit(i8(i8, i8, i8), cache=True)
def main(K, A, B):
for i in range(A, B + 1):
if i % K == 0:
print("OK")
return 0
print("NG")
return... | import sys
from numba import njit, b1, i8
@njit(b1(i8, i8, i8), cache=True)
def solve(K, A, B):
for i in range(A, B + 1):
if i % K == 0:
return True
return False
def main():
input = sys.stdin.buffer.readline
K = int(eval(input()))
A, B = list(map(int, input().split()))
pr... | false | 8.695652 | [
"-from numba import njit, void, i8",
"-",
"-input = sys.stdin.buffer.readline",
"-K = int(eval(input()))",
"-A, B = list(map(int, input().split()))",
"+from numba import njit, b1, i8",
"-@njit(i8(i8, i8, i8), cache=True)",
"-def main(K, A, B):",
"+@njit(b1(i8, i8, i8), cache=True)",
"+def solve(K,... | false | 0.036495 | 0.067283 | 0.54241 | [
"s589094213",
"s016503560"
] |
u887207211 | p03479 | python | s524598544 | s595966879 | 20 | 17 | 2,940 | 2,940 | Accepted | Accepted | 15 | X, Y = list(map(int,input().split()))
ans = 0
while X <= Y:
X *= 2
ans += 1
print(ans) | X, Y = list(map(int,input().split()))
cnt = 0
while X <= Y:
X *= 2
cnt += 1
print(cnt) | 6 | 6 | 89 | 89 | X, Y = list(map(int, input().split()))
ans = 0
while X <= Y:
X *= 2
ans += 1
print(ans)
| X, Y = list(map(int, input().split()))
cnt = 0
while X <= Y:
X *= 2
cnt += 1
print(cnt)
| false | 0 | [
"-ans = 0",
"+cnt = 0",
"- ans += 1",
"-print(ans)",
"+ cnt += 1",
"+print(cnt)"
] | false | 0.048136 | 0.047974 | 1.003375 | [
"s524598544",
"s595966879"
] |
u437638594 | p03420 | python | s836229274 | s905524216 | 105 | 79 | 2,940 | 2,940 | Accepted | Accepted | 24.76 | n, k = list(map(int, input().split()))
ans = 0
for b in range(k + 1, n + 1):
ans += ((n // b) * max(0, b - k)) + max(0, (n % b) - k + 1)
if k == 0:
ans = n ** 2
print(ans)
| n, k = list(map(int, input().split()))
ans = 0
for b in range(k + 1, n + 1):
ans += ((n // b) * (b - k)) + max(0, (n % b) - k + 1)
if k == 0:
ans = n ** 2
print(ans)
| 7 | 7 | 180 | 174 | n, k = list(map(int, input().split()))
ans = 0
for b in range(k + 1, n + 1):
ans += ((n // b) * max(0, b - k)) + max(0, (n % b) - k + 1)
if k == 0:
ans = n**2
print(ans)
| n, k = list(map(int, input().split()))
ans = 0
for b in range(k + 1, n + 1):
ans += ((n // b) * (b - k)) + max(0, (n % b) - k + 1)
if k == 0:
ans = n**2
print(ans)
| false | 0 | [
"- ans += ((n // b) * max(0, b - k)) + max(0, (n % b) - k + 1)",
"+ ans += ((n // b) * (b - k)) + max(0, (n % b) - k + 1)"
] | false | 0.04196 | 0.043309 | 0.968862 | [
"s836229274",
"s905524216"
] |
u477343425 | p03136 | python | s509080145 | s141349612 | 19 | 17 | 2,940 | 3,064 | Accepted | Accepted | 10.53 | n = eval(input())
L = list(map(int, input().split()))
print(('Yes' if sum(L) > 2 * max(L) else 'No'))
| n = int(eval(input()))
l = list(map(int, input().split()))
if sum(l) > 2 * max(l):
print('Yes')
else:
print('No') | 4 | 6 | 98 | 116 | n = eval(input())
L = list(map(int, input().split()))
print(("Yes" if sum(L) > 2 * max(L) else "No"))
| n = int(eval(input()))
l = list(map(int, input().split()))
if sum(l) > 2 * max(l):
print("Yes")
else:
print("No")
| false | 33.333333 | [
"-n = eval(input())",
"-L = list(map(int, input().split()))",
"-print((\"Yes\" if sum(L) > 2 * max(L) else \"No\"))",
"+n = int(eval(input()))",
"+l = list(map(int, input().split()))",
"+if sum(l) > 2 * max(l):",
"+ print(\"Yes\")",
"+else:",
"+ print(\"No\")"
] | false | 0.071516 | 0.068442 | 1.04491 | [
"s509080145",
"s141349612"
] |
u788137651 | p03713 | python | s783832818 | s613610954 | 260 | 231 | 43,484 | 42,716 | Accepted | Accepted | 11.15 | #
# ⋀_⋀
# (・ω・)
# ./ U ∽ U\
# │* 合 *│
# │* 格 *│
# │* 祈 *│
# │* 願 *│
# │* *│
#  ̄
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial,log #log2ないyp
from heapq import heappop, heappush, heappushpop
from collections import ... | #
# ⋀_⋀
# (・ω・)
# ./ U ∽ U\
# │* 合 *│
# │* 格 *│
# │* 祈 *│
# │* 願 *│
# │* *│
#  ̄
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial,log #log2ないyp
from heapq import heappop, heappush, heappushpop
from collections import ... | 66 | 61 | 2,023 | 1,856 | #
# ⋀_⋀
# (・ω・)
# ./ U ∽ U\
# │* 合 *│
# │* 格 *│
# │* 祈 *│
# │* 願 *│
# │* *│
#  ̄
#
import sys
sys.setrecursionlimit(10**6)
input = sys.stdin.readline
from math import floor, ceil, sqrt, factorial, log # log2ないyp
from heapq import heappop, heappush, heappushpop
from collections import Counter, defau... | #
# ⋀_⋀
# (・ω・)
# ./ U ∽ U\
# │* 合 *│
# │* 格 *│
# │* 祈 *│
# │* 願 *│
# │* *│
#  ̄
#
import sys
sys.setrecursionlimit(10**6)
input = sys.stdin.readline
from math import floor, ceil, sqrt, factorial, log # log2ないyp
from heapq import heappop, heappush, heappushpop
from collections import Counter, defau... | false | 7.575758 | [
"- S = H * W",
"- piece = [h * W]",
"- piece.append(W * (H - h) / 2)",
"+ piece = [h * W, (W * (H - h)) // 2]",
"- piece = [h * W]",
"- piece.append((H - h - 1) * W / 2)",
"- piece.append((H - h + 1)... | false | 0.313674 | 0.256313 | 1.223793 | [
"s783832818",
"s613610954"
] |
u638456847 | p02744 | python | s691390223 | s565517278 | 128 | 88 | 15,164 | 15,128 | Accepted | Accepted | 31.25 | import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
def dfs(N):
"""
param N:文字列の長さ
"""
result = []
stack = [("a", 1)]
while stack:
s, max_ = stack.pop()
if len(s) == N:
result.append(s)
c... | # 深さ優先探索による全探索
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
def dfs(N):
"""
param N:文字列の長さ
"""
S = "abcdefghij"
result = []
stack = ["a"]
while stack:
s = stack.pop()
if len(s) == N:
resu... | 35 | 37 | 619 | 624 | import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
def dfs(N):
"""
param N:文字列の長さ
"""
result = []
stack = [("a", 1)]
while stack:
s, max_ = stack.pop()
if len(s) == N:
result.append(s)
continue
else:
... | # 深さ優先探索による全探索
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
def dfs(N):
"""
param N:文字列の長さ
"""
S = "abcdefghij"
result = []
stack = ["a"]
while stack:
s = stack.pop()
if len(s) == N:
result.append(s)
... | false | 5.405405 | [
"+# 深さ優先探索による全探索",
"+ S = \"abcdefghij\"",
"- stack = [(\"a\", 1)]",
"+ stack = [\"a\"]",
"- s, max_ = stack.pop()",
"+ s = stack.pop()",
"- for i in range(max_ + 1):",
"- stack.append((s + chr(97 + i), max(max_, i + 1)))",
"+ for i in S[: ... | false | 0.038838 | 0.040742 | 0.953268 | [
"s691390223",
"s565517278"
] |
u546285759 | p00028 | python | s357834593 | s437483195 | 30 | 20 | 7,596 | 7,564 | Accepted | Accepted | 33.33 | import sys
from itertools import dropwhile
a = []
for v in sys.stdin:
a.append(int(v))
m = max([a.count(v) for v in set(a)])
try:
next(dropwhile(lambda x: True, (print(v) for v in set(a) if a.count(v) == m)))
except StopIteration:
pass
| a = [0] * 101
while True:
try:
a[int(eval(input()))] += 1
except:
break
maxv = max(a)
for i, v in enumerate(a):
if maxv == v:
print(i) | 11 | 10 | 258 | 173 | import sys
from itertools import dropwhile
a = []
for v in sys.stdin:
a.append(int(v))
m = max([a.count(v) for v in set(a)])
try:
next(dropwhile(lambda x: True, (print(v) for v in set(a) if a.count(v) == m)))
except StopIteration:
pass
| a = [0] * 101
while True:
try:
a[int(eval(input()))] += 1
except:
break
maxv = max(a)
for i, v in enumerate(a):
if maxv == v:
print(i)
| false | 9.090909 | [
"-import sys",
"-from itertools import dropwhile",
"-",
"-a = []",
"-for v in sys.stdin:",
"- a.append(int(v))",
"-m = max([a.count(v) for v in set(a)])",
"-try:",
"- next(dropwhile(lambda x: True, (print(v) for v in set(a) if a.count(v) == m)))",
"-except StopIteration:",
"- pass",
"... | false | 0.068322 | 0.05013 | 1.362894 | [
"s357834593",
"s437483195"
] |
u028973125 | p03959 | python | s611311153 | s755810635 | 331 | 137 | 89,160 | 25,324 | Accepted | Accepted | 58.61 | import sys
N = int(sys.stdin.readline().strip())
T = list(map(int, sys.stdin.readline().strip().split()))
A = list(map(int, sys.stdin.readline().strip().split()))
# i番目の山が取りうる高さの下限、上限
cand = [[1, float("inf")] for _ in range(N)]
l_max = 0
for i in range(N):
if l_max < T[i]:
l_max = T[i]
... | import sys
input = sys.stdin.readline
N = int(eval(input()))
T = list(map(int, input().split()))
A = list(map(int, input().split()))
if N == 1:
if T[0] == A[0]:
print((1))
else:
print((0))
sys.exit()
mod = 10**9 + 7
ans = 1
for i in range(N):
if i == 0:
if ... | 46 | 44 | 1,117 | 948 | import sys
N = int(sys.stdin.readline().strip())
T = list(map(int, sys.stdin.readline().strip().split()))
A = list(map(int, sys.stdin.readline().strip().split()))
# i番目の山が取りうる高さの下限、上限
cand = [[1, float("inf")] for _ in range(N)]
l_max = 0
for i in range(N):
if l_max < T[i]:
l_max = T[i]
if cand[i][... | import sys
input = sys.stdin.readline
N = int(eval(input()))
T = list(map(int, input().split()))
A = list(map(int, input().split()))
if N == 1:
if T[0] == A[0]:
print((1))
else:
print((0))
sys.exit()
mod = 10**9 + 7
ans = 1
for i in range(N):
if i == 0:
if A[i] < T[i]:
... | false | 4.347826 | [
"-N = int(sys.stdin.readline().strip())",
"-T = list(map(int, sys.stdin.readline().strip().split()))",
"-A = list(map(int, sys.stdin.readline().strip().split()))",
"-# i番目の山が取りうる高さの下限、上限",
"-cand = [[1, float(\"inf\")] for _ in range(N)]",
"-l_max = 0",
"+input = sys.stdin.readline",
"+N = int(eval(in... | false | 0.029857 | 0.031621 | 0.944214 | [
"s611311153",
"s755810635"
] |
u238940874 | p02713 | python | s145263998 | s576483080 | 1,978 | 1,155 | 9,176 | 9,060 | Accepted | Accepted | 41.61 | from math import gcd
k=int(eval(input()))
ans=0
for a in range(1,k+1):
for b in range(1,k+1):
for c in range(1,k+1):
ans+=gcd(gcd(a,b),c)
print(ans) | from math import gcd
k=int(eval(input()))
ans=0
for i in range(1,k+1):
for j in range(1,k+1):
x=gcd(i,j)
for l in range(1,k+1):
ans+=gcd(x,l)
print(ans) | 8 | 9 | 173 | 186 | from math import gcd
k = int(eval(input()))
ans = 0
for a in range(1, k + 1):
for b in range(1, k + 1):
for c in range(1, k + 1):
ans += gcd(gcd(a, b), c)
print(ans)
| from math import gcd
k = int(eval(input()))
ans = 0
for i in range(1, k + 1):
for j in range(1, k + 1):
x = gcd(i, j)
for l in range(1, k + 1):
ans += gcd(x, l)
print(ans)
| false | 11.111111 | [
"-for a in range(1, k + 1):",
"- for b in range(1, k + 1):",
"- for c in range(1, k + 1):",
"- ans += gcd(gcd(a, b), c)",
"+for i in range(1, k + 1):",
"+ for j in range(1, k + 1):",
"+ x = gcd(i, j)",
"+ for l in range(1, k + 1):",
"+ ans += gcd(x, l... | false | 0.105647 | 0.209883 | 0.503361 | [
"s145263998",
"s576483080"
] |
u849029577 | p02939 | python | s185045710 | s897749015 | 149 | 126 | 87,632 | 73,720 | Accepted | Accepted | 15.44 | s = eval(input())
ansL = [s[0]]
ans = ""
for i in s[1:]:
ans += i
if ansL[-1] != ans:
ansL.append(ans)
ans = ""
print((len(ansL)))
| s = eval(input())
a = b = ""
ans = 0
for i in s:
a += i
if a != b:
ans += 1
a, b = "", a
print(ans) | 9 | 9 | 155 | 126 | s = eval(input())
ansL = [s[0]]
ans = ""
for i in s[1:]:
ans += i
if ansL[-1] != ans:
ansL.append(ans)
ans = ""
print((len(ansL)))
| s = eval(input())
a = b = ""
ans = 0
for i in s:
a += i
if a != b:
ans += 1
a, b = "", a
print(ans)
| false | 0 | [
"-ansL = [s[0]]",
"-ans = \"\"",
"-for i in s[1:]:",
"- ans += i",
"- if ansL[-1] != ans:",
"- ansL.append(ans)",
"- ans = \"\"",
"-print((len(ansL)))",
"+a = b = \"\"",
"+ans = 0",
"+for i in s:",
"+ a += i",
"+ if a != b:",
"+ ans += 1",
"+ a, b ... | false | 0.054933 | 0.074763 | 0.734765 | [
"s185045710",
"s897749015"
] |
u380524497 | p02762 | python | s380404404 | s612647484 | 821 | 660 | 14,984 | 34,152 | Accepted | Accepted | 19.61 | import sys
input = sys.stdin.readline
class UnionFind:
def __init__(self, size):
self.parent = [-1] * size
self.rank = [1] * size
self.groups = size
def get_root(self, node):
parent = self.parent[node]
if parent == -1:
root = node
else... | def main():
import sys
from operator import itemgetter
buf = sys.stdin.buffer
class UnionFind:
def __init__(self, size):
self.parent = [-1] * size
self.rank = [1] * size
def get_root(self, node):
parent = self.parent[node]
if ... | 61 | 69 | 1,627 | 2,013 | import sys
input = sys.stdin.readline
class UnionFind:
def __init__(self, size):
self.parent = [-1] * size
self.rank = [1] * size
self.groups = size
def get_root(self, node):
parent = self.parent[node]
if parent == -1:
root = node
else:
... | def main():
import sys
from operator import itemgetter
buf = sys.stdin.buffer
class UnionFind:
def __init__(self, size):
self.parent = [-1] * size
self.rank = [1] * size
def get_root(self, node):
parent = self.parent[node]
if parent == -... | false | 11.594203 | [
"-import sys",
"+def main():",
"+ import sys",
"+ from operator import itemgetter",
"-input = sys.stdin.readline",
"+ buf = sys.stdin.buffer",
"+",
"+ class UnionFind:",
"+ def __init__(self, size):",
"+ self.parent = [-1] * size",
"+ self.rank = [1] * si... | false | 0.041193 | 0.038891 | 1.0592 | [
"s380404404",
"s612647484"
] |
u506858457 | p03455 | python | s434550949 | s042754645 | 22 | 17 | 2,940 | 2,940 | Accepted | Accepted | 22.73 | a,b=list(map(int,input().split()))
if a*b%2:
print('Odd')
else:
print('Even') | a,b=list(map(int,input().split()))
if a*b%2==0:
print('Even')
else:
print('Odd') | 5 | 5 | 79 | 82 | a, b = list(map(int, input().split()))
if a * b % 2:
print("Odd")
else:
print("Even")
| a, b = list(map(int, input().split()))
if a * b % 2 == 0:
print("Even")
else:
print("Odd")
| false | 0 | [
"-if a * b % 2:",
"+if a * b % 2 == 0:",
"+ print(\"Even\")",
"+else:",
"-else:",
"- print(\"Even\")"
] | false | 0.041964 | 0.0713 | 0.588557 | [
"s434550949",
"s042754645"
] |
u133936772 | p02811 | python | s106538449 | s447403124 | 160 | 17 | 38,384 | 2,940 | Accepted | Accepted | 89.38 | k, x = list(map(int, input().split()))
print(('Yes' if x <= 500 * k else 'No')) | k,x=list(map(int,input().split()))
print(('YNeos'[x>500*k::2])) | 2 | 2 | 72 | 56 | k, x = list(map(int, input().split()))
print(("Yes" if x <= 500 * k else "No"))
| k, x = list(map(int, input().split()))
print(("YNeos"[x > 500 * k :: 2]))
| false | 0 | [
"-print((\"Yes\" if x <= 500 * k else \"No\"))",
"+print((\"YNeos\"[x > 500 * k :: 2]))"
] | false | 0.099192 | 0.032863 | 3.018359 | [
"s106538449",
"s447403124"
] |
u768559443 | p02801 | python | s198811734 | s803262115 | 169 | 17 | 38,384 | 2,940 | Accepted | Accepted | 89.94 | list=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
ans=eval(input())
for i in list:
if i==ans:
print((list[list.index(i)+1])) | C=eval(input())
i=ord(C)
print((chr(i+1))) | 6 | 3 | 186 | 36 | list = [
"a",
"b",
"c",
"d",
"e",
"f",
"g",
"h",
"i",
"j",
"k",
"l",
"m",
"n",
"o",
"p",
"q",
"r",
"s",
"t",
"u",
"v",
"w",
"x",
"y",
"z",
]
ans = eval(input())
for i in list:
if i == ans:
print((list[lis... | C = eval(input())
i = ord(C)
print((chr(i + 1)))
| false | 50 | [
"-list = [",
"- \"a\",",
"- \"b\",",
"- \"c\",",
"- \"d\",",
"- \"e\",",
"- \"f\",",
"- \"g\",",
"- \"h\",",
"- \"i\",",
"- \"j\",",
"- \"k\",",
"- \"l\",",
"- \"m\",",
"- \"n\",",
"- \"o\",",
"- \"p\",",
"- \"q\",",
"- \"r\",... | false | 0.086731 | 0.034549 | 2.510369 | [
"s198811734",
"s803262115"
] |
u994988729 | p03108 | python | s153224500 | s243639469 | 771 | 592 | 37,168 | 25,576 | Accepted | Accepted | 23.22 | class UF_tree:
def __init__(self, n):
self.root = [-1] * (n + 1) # -1ならそのノードが根,で絶対値が木の要素数
self.rank = [0] * (n + 1)
def find(self, x): # xの根となる要素番号を返す
if self.root[x] < 0:
return x
else:
self.root[x] = self.find(self.root[x])
retur... | import sys
input = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 7)
class UF_tree:
def __init__(self, n):
self.root = [-1] * (n + 1) # -1ならそのノードが根,で絶対値が木の要素数
self.rank = [0] * (n + 1)
def find(self, x): # xの根となる要素番号を返す
if self.root[x] < 0:
return x
... | 53 | 56 | 1,341 | 1,475 | class UF_tree:
def __init__(self, n):
self.root = [-1] * (n + 1) # -1ならそのノードが根,で絶対値が木の要素数
self.rank = [0] * (n + 1)
def find(self, x): # xの根となる要素番号を返す
if self.root[x] < 0:
return x
else:
self.root[x] = self.find(self.root[x])
return self.roo... | import sys
input = sys.stdin.buffer.readline
sys.setrecursionlimit(10**7)
class UF_tree:
def __init__(self, n):
self.root = [-1] * (n + 1) # -1ならそのノードが根,で絶対値が木の要素数
self.rank = [0] * (n + 1)
def find(self, x): # xの根となる要素番号を返す
if self.root[x] < 0:
return x
else:
... | false | 5.357143 | [
"+import sys",
"+",
"+input = sys.stdin.buffer.readline",
"+sys.setrecursionlimit(10**7)",
"+",
"+",
"-n, m = map(int, input().split())",
"-bridge = [list(map(int, input().split())) for _ in range(m)]",
"-bridge = bridge[::-1]",
"-uf = UF_tree(n)",
"-ans = [0] * (m + 1)",
"-ans[0] = n * (n - 1... | false | 0.04658 | 0.047031 | 0.990412 | [
"s153224500",
"s243639469"
] |
u904811150 | p02570 | python | s866261646 | s240735502 | 31 | 26 | 9,160 | 9,092 | Accepted | Accepted | 16.13 | X = input().split()
D = int(X[0])
T = int(X[1])
S = int(X[2])
time = D/S
if time <= T:
print('Yes')
else:
print('No') | INPUT = input().split()
D = int(INPUT[0])
T = int(INPUT[1])
S = int(INPUT[2])
if D/S <= T:
print("Yes")
else:
print("No") | 11 | 9 | 137 | 138 | X = input().split()
D = int(X[0])
T = int(X[1])
S = int(X[2])
time = D / S
if time <= T:
print("Yes")
else:
print("No")
| INPUT = input().split()
D = int(INPUT[0])
T = int(INPUT[1])
S = int(INPUT[2])
if D / S <= T:
print("Yes")
else:
print("No")
| false | 18.181818 | [
"-X = input().split()",
"-D = int(X[0])",
"-T = int(X[1])",
"-S = int(X[2])",
"-time = D / S",
"-if time <= T:",
"+INPUT = input().split()",
"+D = int(INPUT[0])",
"+T = int(INPUT[1])",
"+S = int(INPUT[2])",
"+if D / S <= T:"
] | false | 0.047317 | 0.165141 | 0.286523 | [
"s866261646",
"s240735502"
] |
u380524497 | p02863 | python | s353096201 | s178499428 | 659 | 248 | 117,592 | 12,772 | Accepted | Accepted | 62.37 | from collections import defaultdict
n, t = list(map(int, input().split()))
dish = []
for _ in range(n):
time, point = list(map(int, input().split()))
dish.append([time, point])
dish.sort()
DP = [[0]*t for i in range(n+1)]
ans = defaultdict(int)
for i in range(1, n+1):
time, point = dis... | import numpy as np
import sys
input = sys.stdin.readline
n, t = list(map(int, input().split()))
dish = [list(map(int, input().split())) for _ in range(n)]
dish.sort()
ans = 0
dp = np.zeros(t, dtype=int)
for time, point in dish:
ans = max(ans, dp.max()+point)
np.maximum(dp[time:], dp[:-time]+poin... | 27 | 15 | 594 | 343 | from collections import defaultdict
n, t = list(map(int, input().split()))
dish = []
for _ in range(n):
time, point = list(map(int, input().split()))
dish.append([time, point])
dish.sort()
DP = [[0] * t for i in range(n + 1)]
ans = defaultdict(int)
for i in range(1, n + 1):
time, point = dish[i - 1]
fo... | import numpy as np
import sys
input = sys.stdin.readline
n, t = list(map(int, input().split()))
dish = [list(map(int, input().split())) for _ in range(n)]
dish.sort()
ans = 0
dp = np.zeros(t, dtype=int)
for time, point in dish:
ans = max(ans, dp.max() + point)
np.maximum(dp[time:], dp[:-time] + point, out=dp[t... | false | 44.444444 | [
"-from collections import defaultdict",
"+import numpy as np",
"+import sys",
"+input = sys.stdin.readline",
"-dish = []",
"-for _ in range(n):",
"- time, point = list(map(int, input().split()))",
"- dish.append([time, point])",
"+dish = [list(map(int, input().split())) for _ in range(n)]",
... | false | 0.037849 | 0.240289 | 0.157514 | [
"s353096201",
"s178499428"
] |
u353797797 | p03111 | python | s519074262 | s317451244 | 246 | 45 | 43,372 | 5,628 | Accepted | Accepted | 81.71 | from itertools import product
import sys
sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_... | import sys
sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in ... | 37 | 41 | 943 | 1,085 | from itertools import product
import sys
sys.setrecursionlimit(10**6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II():
return int(sys.stdin.readline())
def MI():
return map(int, sys.stdin.readline().split())
def LI():
return list(map(int, sys.stdin.readline().split()))
def ... | import sys
sys.setrecursionlimit(10**6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II():
return int(sys.stdin.readline())
def MI():
return map(int, sys.stdin.readline().split())
def LI():
return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number):
return [... | false | 9.756098 | [
"-from itertools import product",
"- inf = 10**16",
"+ inf = 10**9",
"- ll = [II() for _ in range(n)]",
"+ abc.sort()",
"+ a, b, c = abc",
"+ dp = {(0, 0, 0): 0}",
"+ for _ in range(n):",
"+ l = II()",
"+ ndp = {}",
"+ for xyz, s in dp.items():",
"+ ... | false | 0.134066 | 0.090016 | 1.489358 | [
"s519074262",
"s317451244"
] |
u644907318 | p03380 | python | s013836795 | s383814500 | 234 | 105 | 62,704 | 86,032 | Accepted | Accepted | 55.13 | N = int(eval(input()))
A = sorted(list(map(int,input().split())))
n = A[-1]
k = A[0]
for i in range(1,N-1):
j = A[i]
if k<=n//2 and j<=n//2:
k = max(k,j)
elif k<=n//2 and j>n//2:
if k<n-j:
k = j
elif k>n//2 and j<=n//2:
if n-k<j:
k = j
el... | n = int(eval(input()))
A = sorted(list(map(int,input().split())))
for i in range(n):
if A[i]*2>A[-1]:
ind = i
break
ind -= 1
a = A[ind]
b = A[-1]-A[ind+1]
if a>=b:
print((A[-1],a))
else:
print((A[-1],A[ind+1]))
| 18 | 13 | 387 | 241 | N = int(eval(input()))
A = sorted(list(map(int, input().split())))
n = A[-1]
k = A[0]
for i in range(1, N - 1):
j = A[i]
if k <= n // 2 and j <= n // 2:
k = max(k, j)
elif k <= n // 2 and j > n // 2:
if k < n - j:
k = j
elif k > n // 2 and j <= n // 2:
if n - k < j:
... | n = int(eval(input()))
A = sorted(list(map(int, input().split())))
for i in range(n):
if A[i] * 2 > A[-1]:
ind = i
break
ind -= 1
a = A[ind]
b = A[-1] - A[ind + 1]
if a >= b:
print((A[-1], a))
else:
print((A[-1], A[ind + 1]))
| false | 27.777778 | [
"-N = int(eval(input()))",
"+n = int(eval(input()))",
"-n = A[-1]",
"-k = A[0]",
"-for i in range(1, N - 1):",
"- j = A[i]",
"- if k <= n // 2 and j <= n // 2:",
"- k = max(k, j)",
"- elif k <= n // 2 and j > n // 2:",
"- if k < n - j:",
"- k = j",
"- elif ... | false | 0.032244 | 0.031479 | 1.024286 | [
"s013836795",
"s383814500"
] |
u878654696 | p02553 | python | s074939612 | s275804977 | 35 | 26 | 9,172 | 9,092 | Accepted | Accepted | 25.71 | a, b, c, d = list(map(int, input().split()))
minx = min(a, b)
miny = min(c, d)
maxx = max(a, b)
maxy = max(c, d)
print((max(miny * minx, maxx * maxy, maxx * miny, minx * maxy)))
| a, b, c, d = list(map(int, input().split()))
print((max(a * c, b * d, b * c, a * d))) | 8 | 3 | 179 | 80 | a, b, c, d = list(map(int, input().split()))
minx = min(a, b)
miny = min(c, d)
maxx = max(a, b)
maxy = max(c, d)
print((max(miny * minx, maxx * maxy, maxx * miny, minx * maxy)))
| a, b, c, d = list(map(int, input().split()))
print((max(a * c, b * d, b * c, a * d)))
| false | 62.5 | [
"-minx = min(a, b)",
"-miny = min(c, d)",
"-maxx = max(a, b)",
"-maxy = max(c, d)",
"-print((max(miny * minx, maxx * maxy, maxx * miny, minx * maxy)))",
"+print((max(a * c, b * d, b * c, a * d)))"
] | false | 0.037295 | 0.037371 | 0.997986 | [
"s074939612",
"s275804977"
] |
u076917070 | p03339 | python | s413904581 | s193980113 | 200 | 139 | 29,472 | 29,472 | Accepted | Accepted | 30.5 | import sys
input=sys.stdin.readline
def main():
N = int(eval(input()))
S = input().strip()
E = [0]*N
W = [0]*N
for i in range(1,N):
E[i] = E[i-1]
if S[i-1] == "W":
E[i] += 1
for i in range(N-2,-1,-1):
W[i] = W[i+1]
if S[i+1] == "E"... | import sys
input=sys.stdin.readline
def main():
N = int(eval(input()))
S = input().strip()
E = [0]*N
e = 0
for i in range(0,N):
E[i] = e
if S[i] == "W":
e += 1
W = [0]*N
w = 0
for i in range(N-1,-1,-1):
W[i] = w
if S[i] =... | 24 | 26 | 467 | 469 | import sys
input = sys.stdin.readline
def main():
N = int(eval(input()))
S = input().strip()
E = [0] * N
W = [0] * N
for i in range(1, N):
E[i] = E[i - 1]
if S[i - 1] == "W":
E[i] += 1
for i in range(N - 2, -1, -1):
W[i] = W[i + 1]
if S[i + 1] == "E... | import sys
input = sys.stdin.readline
def main():
N = int(eval(input()))
S = input().strip()
E = [0] * N
e = 0
for i in range(0, N):
E[i] = e
if S[i] == "W":
e += 1
W = [0] * N
w = 0
for i in range(N - 1, -1, -1):
W[i] = w
if S[i] == "E":
... | false | 7.692308 | [
"+ e = 0",
"+ for i in range(0, N):",
"+ E[i] = e",
"+ if S[i] == \"W\":",
"+ e += 1",
"- for i in range(1, N):",
"- E[i] = E[i - 1]",
"- if S[i - 1] == \"W\":",
"- E[i] += 1",
"- for i in range(N - 2, -1, -1):",
"- W[i] = W[i ... | false | 0.044236 | 0.043209 | 1.023766 | [
"s413904581",
"s193980113"
] |
u227020436 | p03291 | python | s339830139 | s602001032 | 210 | 186 | 11,124 | 11,124 | Accepted | Accepted | 11.43 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
modulo = 10 ** 9 + 7
S = eval(input())
def nleft(S, c):
"""各位置について,それより左の文字列に含まれる文字 c の総数.
左に'?'が含まれるときは,それらに文字を入れて得られるすべての
文字列に渡って,文字 c の個数を合計する. """
# c の個数
n = [0 for c in S]
for i in range(1, len(S)):
n[i] = ... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
modulo = 10 ** 9 + 7
S = eval(input())
def nleft(S, a, reverse=False):
"""各位置について,それより左の文字列に含まれる文字 a の総数.
左に'?'が含まれるときは,それらに文字を入れて得られるすべての
文字列に渡って,文字 a の個数を合計する. """
def rng():
if reverse: return list(range(len(S) - 1, -1,... | 61 | 48 | 1,431 | 1,042 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
modulo = 10**9 + 7
S = eval(input())
def nleft(S, c):
"""各位置について,それより左の文字列に含まれる文字 c の総数.
左に'?'が含まれるときは,それらに文字を入れて得られるすべての
文字列に渡って,文字 c の個数を合計する."""
# c の個数
n = [0 for c in S]
for i in range(1, len(S)):
n[i] = n[i - 1] + (1 if S[i - 1] == c... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
modulo = 10**9 + 7
S = eval(input())
def nleft(S, a, reverse=False):
"""各位置について,それより左の文字列に含まれる文字 a の総数.
左に'?'が含まれるときは,それらに文字を入れて得られるすべての
文字列に渡って,文字 a の個数を合計する."""
def rng():
if reverse:
return list(range(len(S) - 1, -1, -1))
r... | false | 21.311475 | [
"-def nleft(S, c):",
"- \"\"\"各位置について,それより左の文字列に含まれる文字 c の総数.",
"+def nleft(S, a, reverse=False):",
"+ \"\"\"各位置について,それより左の文字列に含まれる文字 a の総数.",
"- 文字列に渡って,文字 c の個数を合計する.\"\"\"",
"- # c の個数",
"- n = [0 for c in S]",
"- for i in range(1, len(S)):",
"- n[i] = n[i - 1] + (1 if S[... | false | 0.038738 | 0.067999 | 0.569692 | [
"s339830139",
"s602001032"
] |
u945181840 | p02861 | python | s392887073 | s778803200 | 416 | 17 | 21,528 | 3,064 | Accepted | Accepted | 95.91 | import sys
import numpy as np
from math import factorial, sqrt
from itertools import permutations
read = sys.stdin.read
readline = sys.stdin.readline
N = int(readline())
xy = np.array(read().split(), np.int64).reshape(N, 2)
distance = [[0.0] * N for _ in range(N)]
for i in range(N - 1):
for j in range... | import sys
from math import sqrt
read = sys.stdin.read
N, *xy = list(map(int, read().split()))
x = xy[::2]; y = xy[1::2]
distance = []
for i in range(N - 1):
for j in range(i + 1, N):
distance.append(sqrt((x[i] - x[j]) ** 2 + (y[i] - y[j]) ** 2))
print((sum(distance) / N * 2)) | 23 | 14 | 593 | 298 | import sys
import numpy as np
from math import factorial, sqrt
from itertools import permutations
read = sys.stdin.read
readline = sys.stdin.readline
N = int(readline())
xy = np.array(read().split(), np.int64).reshape(N, 2)
distance = [[0.0] * N for _ in range(N)]
for i in range(N - 1):
for j in range(i + 1, N):
... | import sys
from math import sqrt
read = sys.stdin.read
N, *xy = list(map(int, read().split()))
x = xy[::2]
y = xy[1::2]
distance = []
for i in range(N - 1):
for j in range(i + 1, N):
distance.append(sqrt((x[i] - x[j]) ** 2 + (y[i] - y[j]) ** 2))
print((sum(distance) / N * 2))
| false | 39.130435 | [
"-import numpy as np",
"-from math import factorial, sqrt",
"-from itertools import permutations",
"+from math import sqrt",
"-readline = sys.stdin.readline",
"-N = int(readline())",
"-xy = np.array(read().split(), np.int64).reshape(N, 2)",
"-distance = [[0.0] * N for _ in range(N)]",
"+N, *xy = lis... | false | 0.208751 | 0.037812 | 5.520763 | [
"s392887073",
"s778803200"
] |
u077291787 | p02925 | python | s991822152 | s832761813 | 878 | 775 | 104,788 | 36,096 | Accepted | Accepted | 11.73 | # ABC139E - League
from collections import deque
def main():
N, *A = list(map(int, open(0).read().split()))
B = {}
for i in range(N):
x = i * (N - 1)
B[i + 1] = deque(A[x : x + N - 1])
cnt, cur, days = 0, [0] * (N + 1), [0] * (N + 1)
q = deque(list(range(1, N + 1)))
... | # ABC139E - League
from collections import deque
def main():
N = int(eval(input()))
A = [0] + list(deque(list(map(int, input().split()))) for _ in range(N))
cnt, cur, days = 0, [0] * (N + 1), [0] * (N + 1)
q = deque(list(range(1, N + 1)))
while q:
x = q.popleft()
if not ... | 30 | 27 | 942 | 970 | # ABC139E - League
from collections import deque
def main():
N, *A = list(map(int, open(0).read().split()))
B = {}
for i in range(N):
x = i * (N - 1)
B[i + 1] = deque(A[x : x + N - 1])
cnt, cur, days = 0, [0] * (N + 1), [0] * (N + 1)
q = deque(list(range(1, N + 1)))
while q:
... | # ABC139E - League
from collections import deque
def main():
N = int(eval(input()))
A = [0] + list(deque(list(map(int, input().split()))) for _ in range(N))
cnt, cur, days = 0, [0] * (N + 1), [0] * (N + 1)
q = deque(list(range(1, N + 1)))
while q:
x = q.popleft()
if not A[x]: # pl... | false | 10 | [
"- N, *A = list(map(int, open(0).read().split()))",
"- B = {}",
"- for i in range(N):",
"- x = i * (N - 1)",
"- B[i + 1] = deque(A[x : x + N - 1])",
"+ N = int(eval(input()))",
"+ A = [0] + list(deque(list(map(int, input().split()))) for _ in range(N))",
"- if not B... | false | 0.067137 | 0.035564 | 1.887785 | [
"s991822152",
"s832761813"
] |
u440566786 | p02888 | python | s336094988 | s784397015 | 239 | 194 | 42,604 | 40,688 | Accepted | Accepted | 18.83 | import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda :sys.stdin.readline().rstrip()
def resolve():
n=int(eval(input()))
L=list(map(int,input().split()))
L.sort()
ans=0
for b in range(1,n-1):
c=b+1
for a in range(b):
while(c<n... | import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda :sys.stdin.readline().rstrip()
def resolve():
n=int(eval(input()))
L=list(map(int,input().split()))
L.sort()
C=[0]*(3001)
for l in L: C[l]+=1
for i in range(3000): C[i+1]+=C[i]
ans=0
for i... | 17 | 18 | 391 | 423 | import sys
sys.setrecursionlimit(2147483647)
INF = float("inf")
MOD = 10**9 + 7
input = lambda: sys.stdin.readline().rstrip()
def resolve():
n = int(eval(input()))
L = list(map(int, input().split()))
L.sort()
ans = 0
for b in range(1, n - 1):
c = b + 1
for a in range(b):
... | import sys
sys.setrecursionlimit(2147483647)
INF = float("inf")
MOD = 10**9 + 7
input = lambda: sys.stdin.readline().rstrip()
def resolve():
n = int(eval(input()))
L = list(map(int, input().split()))
L.sort()
C = [0] * (3001)
for l in L:
C[l] += 1
for i in range(3000):
C[i + 1... | false | 5.555556 | [
"+ C = [0] * (3001)",
"+ for l in L:",
"+ C[l] += 1",
"+ for i in range(3000):",
"+ C[i + 1] += C[i]",
"- for b in range(1, n - 1):",
"- c = b + 1",
"- for a in range(b):",
"- while c < n and L[a] + L[b] > L[c]:",
"- c += 1",
"- ... | false | 0.035647 | 0.040715 | 0.875527 | [
"s336094988",
"s784397015"
] |
u282228874 | p03645 | python | s102832035 | s598756020 | 616 | 561 | 4,596 | 6,132 | Accepted | Accepted | 8.93 | n,m = list(map(int,input().split()))
route = [0]*(n+10)
for i in range(m):
a,b = list(map(int,input().split()))
if a == 1:
route[b] += 1
if b == n:
route[a] += 1
if 2 in route:
print("POSSIBLE")
else:
print("IMPOSSIBLE") | n,m = list(map(int,input().split()))
s = [0]*n
g = [0]*n
for i in range(m):
a,b = list(map(int,input().split()))
if a == 1:
s[b] = 1
if b == n:
g[a] = 1
for i in range(n):
if s[i] and g[i]:
print("POSSIBLE")
exit()
print("IMPOSSIBLE") | 12 | 17 | 255 | 289 | n, m = list(map(int, input().split()))
route = [0] * (n + 10)
for i in range(m):
a, b = list(map(int, input().split()))
if a == 1:
route[b] += 1
if b == n:
route[a] += 1
if 2 in route:
print("POSSIBLE")
else:
print("IMPOSSIBLE")
| n, m = list(map(int, input().split()))
s = [0] * n
g = [0] * n
for i in range(m):
a, b = list(map(int, input().split()))
if a == 1:
s[b] = 1
if b == n:
g[a] = 1
for i in range(n):
if s[i] and g[i]:
print("POSSIBLE")
exit()
print("IMPOSSIBLE")
| false | 29.411765 | [
"-route = [0] * (n + 10)",
"+s = [0] * n",
"+g = [0] * n",
"- route[b] += 1",
"+ s[b] = 1",
"- route[a] += 1",
"-if 2 in route:",
"- print(\"POSSIBLE\")",
"-else:",
"- print(\"IMPOSSIBLE\")",
"+ g[a] = 1",
"+for i in range(n):",
"+ if s[i] and g[i]:",
"... | false | 0.041684 | 0.042037 | 0.991595 | [
"s102832035",
"s598756020"
] |
u954153335 | p02681 | python | s013853075 | s218781067 | 23 | 21 | 9,036 | 8,796 | Accepted | Accepted | 8.7 | S=eval(input(""))
T=eval(input(""))
l=len(S)
if 1<=l and l<=10 and S.islower()==True and S==T[:-1]:
print("Yes")
else:
print("No") | S=eval(input())
T=eval(input())
l=len(S)
if S==T[:-1] and S.islower()==True and 1<=l and l<=10:
print("Yes")
else:
print("No") | 7 | 7 | 130 | 124 | S = eval(input(""))
T = eval(input(""))
l = len(S)
if 1 <= l and l <= 10 and S.islower() == True and S == T[:-1]:
print("Yes")
else:
print("No")
| S = eval(input())
T = eval(input())
l = len(S)
if S == T[:-1] and S.islower() == True and 1 <= l and l <= 10:
print("Yes")
else:
print("No")
| false | 0 | [
"-S = eval(input(\"\"))",
"-T = eval(input(\"\"))",
"+S = eval(input())",
"+T = eval(input())",
"-if 1 <= l and l <= 10 and S.islower() == True and S == T[:-1]:",
"+if S == T[:-1] and S.islower() == True and 1 <= l and l <= 10:"
] | false | 0.045069 | 0.071144 | 0.633494 | [
"s013853075",
"s218781067"
] |
u047796752 | p02616 | python | s514448802 | s319950023 | 197 | 140 | 113,004 | 115,320 | Accepted | Accepted | 28.93 | import sys
input = sys.stdin.readline
from collections import *
N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
MOD = 10**9+7
p, n = [], []
for Ai in A:
if Ai>=0:
p.append(Ai)
else:
n.append(Ai)
if len(p)==0 and K%2==1:
if 0 in A:
print(... | import sys
input = sys.stdin.readline
N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
MOD = 10**9+7
p, n = [], []
for Ai in A:
if Ai>=0:
p.append(Ai)
else:
n.append(Ai)
if len(n)==N and K%2==1:
n.sort(reverse=True)
ans = 1
for ni i... | 75 | 58 | 1,311 | 875 | import sys
input = sys.stdin.readline
from collections import *
N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
MOD = 10**9 + 7
p, n = [], []
for Ai in A:
if Ai >= 0:
p.append(Ai)
else:
n.append(Ai)
if len(p) == 0 and K % 2 == 1:
if 0 in A:
print((0))
... | import sys
input = sys.stdin.readline
N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
MOD = 10**9 + 7
p, n = [], []
for Ai in A:
if Ai >= 0:
p.append(Ai)
else:
n.append(Ai)
if len(n) == N and K % 2 == 1:
n.sort(reverse=True)
ans = 1
for ni in n[:K]:
... | false | 22.666667 | [
"-from collections import *",
"-",
"-if len(p) == 0 and K % 2 == 1:",
"- if 0 in A:",
"- print((0))",
"- else:",
"- n.sort(reverse=True)",
"- ans = 1",
"- for ni in n[:K]:",
"- ans *= ni",
"- ans %= MOD",
"- print(ans)",
"+if len... | false | 0.208559 | 0.035483 | 5.877694 | [
"s514448802",
"s319950023"
] |
u271934630 | p03262 | python | s070588431 | s265348422 | 355 | 132 | 89,364 | 17,180 | Accepted | Accepted | 62.82 | from functools import reduce
from fractions import gcd
N, X = list(map(int, input().split()))
x = list(map(int, input().split()))
x.append(X)
town = sorted(x)
print((reduce(gcd, [town[i+1] - town[i] for i in range(len(town)-1)])))
| 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 gcd_list(l):
return red... | 9 | 27 | 233 | 483 | from functools import reduce
from fractions import gcd
N, X = list(map(int, input().split()))
x = list(map(int, input().split()))
x.append(X)
town = sorted(x)
print((reduce(gcd, [town[i + 1] - town[i] for i in range(len(town) - 1)])))
| 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 gcd_list(l):
return reduce(gcd, l)... | false | 66.666667 | [
"+import sys",
"+",
"+stdin = sys.stdin",
"+sys.setrecursionlimit(10**7)",
"-from fractions import gcd",
"-N, X = list(map(int, input().split()))",
"-x = list(map(int, input().split()))",
"-x.append(X)",
"-town = sorted(x)",
"-print((reduce(gcd, [town[i + 1] - town[i] for i in range(len(town) - 1)... | false | 0.04676 | 0.141696 | 0.330004 | [
"s070588431",
"s265348422"
] |
u997521090 | p03128 | python | s225188170 | s671136738 | 62 | 43 | 3,448 | 3,576 | Accepted | Accepted | 30.65 | #!/usr/bin/env python
from collections import deque
import itertools as it
import sys
import math
sys.setrecursionlimit(1000000)
INF = 10 ** 18
N, M = list(map(int, input().split()))
cost = {1:2, 2:5, 3:5, 4:4, 5:5, 6:6, 7:3, 8:7, 9:6}
A = list(map(int, input().split()))
DP = [0] + [-1] * N
ans = [... | #!/usr/bin/env python
from collections import deque
import itertools as it
import sys
import math
sys.setrecursionlimit(1000000)
INF = 10 ** 18
N, M = list(map(int, input().split()))
cost = {1:2, 2:5, 3:5, 4:4, 5:5, 6:6, 7:3, 8:7, 9:6}
A = sorted(map(int, input().split()))
DP = [0] + [-1] * N
ans =... | 37 | 34 | 740 | 648 | #!/usr/bin/env python
from collections import deque
import itertools as it
import sys
import math
sys.setrecursionlimit(1000000)
INF = 10**18
N, M = list(map(int, input().split()))
cost = {1: 2, 2: 5, 3: 5, 4: 4, 5: 5, 6: 6, 7: 3, 8: 7, 9: 6}
A = list(map(int, input().split()))
DP = [0] + [-1] * N
ans = [0] * N + [0]
... | #!/usr/bin/env python
from collections import deque
import itertools as it
import sys
import math
sys.setrecursionlimit(1000000)
INF = 10**18
N, M = list(map(int, input().split()))
cost = {1: 2, 2: 5, 3: 5, 4: 4, 5: 5, 6: 6, 7: 3, 8: 7, 9: 6}
A = sorted(map(int, input().split()))
DP = [0] + [-1] * N
ans = [0, 0] * N
f... | false | 8.108108 | [
"-A = list(map(int, input().split()))",
"+A = sorted(map(int, input().split()))",
"-ans = [0] * N + [0]",
"+ans = [0, 0] * N",
"- for j in range(10)[::-1]:",
"- if not j in A:",
"+ for j in A:",
"+ pos = i - cost[j]",
"+ if pos < 0 or DP[pos] < 0:",
"- if cost[j] ... | false | 0.036031 | 0.041871 | 0.860527 | [
"s225188170",
"s671136738"
] |
u596505843 | p02579 | python | s973100650 | s089064477 | 1,401 | 543 | 123,920 | 100,472 | Accepted | Accepted | 61.24 | import sys, math
from collections import defaultdict, deque, Counter
from bisect import bisect_left, bisect_right
from itertools import combinations, permutations, product
#from heapq import heappush, heappop
from functools import lru_cache
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: in... | import sys, math
from collections import defaultdict, deque, Counter
from bisect import bisect_left, bisect_right
from itertools import combinations, permutations, product
from heapq import heappush, heappop
from functools import lru_cache
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int... | 67 | 58 | 1,704 | 1,499 | import sys, math
from collections import defaultdict, deque, Counter
from bisect import bisect_left, bisect_right
from itertools import combinations, permutations, product
# from heapq import heappush, heappop
from functools import lru_cache
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(eva... | import sys, math
from collections import defaultdict, deque, Counter
from bisect import bisect_left, bisect_right
from itertools import combinations, permutations, product
from heapq import heappush, heappop
from functools import lru_cache
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(eval(i... | false | 13.432836 | [
"-",
"-# from heapq import heappush, heappop",
"+from heapq import heappush, heappop",
"+narr = (",
"+ lambda d, f: narr(d[:-1], lambda: [f() for _ in range(d[-1])]) if d else f()",
"+) # narr((2,3), int)",
"-import heapq",
"-",
"-",
"-def dijkstra(start, end):",
"- # dist = defaultdict(l... | false | 0.071612 | 0.070364 | 1.017744 | [
"s973100650",
"s089064477"
] |
u343675824 | p04014 | python | s020916796 | s789079615 | 353 | 216 | 3,188 | 41,584 | Accepted | Accepted | 38.81 | import math
import sys
n = int(eval(input()))
s = int(eval(input()))
def f(b, n):
if n == 0:
return 0
return f(b, n//b) + n % b
if s > n:
print((-1))
sys.exit(0)
sn = math.ceil(math.sqrt(n))
for i in range(2, sn+1):
if f(i, n) == s:
print(i)
sys.exit(0)... | import sys
n = int(eval(input()))
s = int(eval(input()))
def f(b, n):
if n < b:
return n
else:
return f(b, n//b) + n % b
if s == n:
print((n+1))
sys.exit(0)
if n < s:
print((-1))
sys.exit(0)
ans = None
for i in range(2, n):
if i * i > n:
brea... | 33 | 39 | 565 | 698 | import math
import sys
n = int(eval(input()))
s = int(eval(input()))
def f(b, n):
if n == 0:
return 0
return f(b, n // b) + n % b
if s > n:
print((-1))
sys.exit(0)
sn = math.ceil(math.sqrt(n))
for i in range(2, sn + 1):
if f(i, n) == s:
print(i)
sys.exit(0)
ans = n + 1
f... | import sys
n = int(eval(input()))
s = int(eval(input()))
def f(b, n):
if n < b:
return n
else:
return f(b, n // b) + n % b
if s == n:
print((n + 1))
sys.exit(0)
if n < s:
print((-1))
sys.exit(0)
ans = None
for i in range(2, n):
if i * i > n:
break
if f(i, n) ... | false | 15.384615 | [
"-import math",
"- if n == 0:",
"- return 0",
"- return f(b, n // b) + n % b",
"+ if n < b:",
"+ return n",
"+ else:",
"+ return f(b, n // b) + n % b",
"-if s > n:",
"+if s == n:",
"+ print((n + 1))",
"+ sys.exit(0)",
"+if n < s:",
"-sn = math.ceil(ma... | false | 0.06664 | 0.093506 | 0.712679 | [
"s020916796",
"s789079615"
] |
u761989513 | p03805 | python | s600280120 | s706317582 | 68 | 30 | 3,064 | 3,064 | Accepted | Accepted | 55.88 | import itertools
def sonzai(path, start, goal):
for i in path:
if start in i:
if start > goal:
if i[0] == goal:
return True
else:
if i[1] == goal:
return True
return False
n, m = list(map(int, ... | import itertools
n, m = list(map(int, input().split()))
graph = [[0 for i in range(n)] for j in range(n)]
for i in range(m):
a, b = list(map(int, input().split()))
graph[a - 1][b - 1] = 1
graph[b - 1][a - 1] = 1
ans = 0
for i in itertools.permutations(list(range(2, n + 1))):
if not graph[0][i... | 29 | 19 | 708 | 500 | import itertools
def sonzai(path, start, goal):
for i in path:
if start in i:
if start > goal:
if i[0] == goal:
return True
else:
if i[1] == goal:
return True
return False
n, m = list(map(int, input().spl... | import itertools
n, m = list(map(int, input().split()))
graph = [[0 for i in range(n)] for j in range(n)]
for i in range(m):
a, b = list(map(int, input().split()))
graph[a - 1][b - 1] = 1
graph[b - 1][a - 1] = 1
ans = 0
for i in itertools.permutations(list(range(2, n + 1))):
if not graph[0][i[0] - 1]:
... | false | 34.482759 | [
"-",
"-def sonzai(path, start, goal):",
"- for i in path:",
"- if start in i:",
"- if start > goal:",
"- if i[0] == goal:",
"- return True",
"- else:",
"- if i[1] == goal:",
"- return True",
"- ... | false | 0.100439 | 0.041904 | 2.396905 | [
"s600280120",
"s706317582"
] |
u878389297 | p02647 | python | s813203334 | s856277091 | 1,161 | 294 | 138,732 | 157,872 | Accepted | Accepted | 74.68 | from numba import njit
@njit(cache=True)
def aaa(n,k,a):
for f in range(k):
a1=[0]*(n+1)
for x in range(n):
y=max(0,x-a[x])
a1[y]=a1[y]+1
z=min(n-1,x+a[x])
a1[z+1]=a1[z+1]-1
a[0]=a1[0]
for x in range(1,n):
... | def aaa(n,k,a):
for f in range(k):
a1=[0]*(n+1)
for x in range(n):
y=max(0,x-a[x])
a1[y]=a1[y]+1
z=min(n-1,x+a[x])
a1[z+1]=a1[z+1]-1
a[0]=a1[0]
for x in range(1,n):
a[x]=a[x-1]+a1[x]
if a==[n]*n:
... | 29 | 26 | 555 | 511 | from numba import njit
@njit(cache=True)
def aaa(n, k, a):
for f in range(k):
a1 = [0] * (n + 1)
for x in range(n):
y = max(0, x - a[x])
a1[y] = a1[y] + 1
z = min(n - 1, x + a[x])
a1[z + 1] = a1[z + 1] - 1
a[0] = a1[0]
for x in range(... | def aaa(n, k, a):
for f in range(k):
a1 = [0] * (n + 1)
for x in range(n):
y = max(0, x - a[x])
a1[y] = a1[y] + 1
z = min(n - 1, x + a[x])
a1[z + 1] = a1[z + 1] - 1
a[0] = a1[0]
for x in range(1, n):
a[x] = a[x - 1] + a1[x]
... | false | 10.344828 | [
"-from numba import njit",
"-",
"-",
"-@njit(cache=True)"
] | false | 0.116511 | 0.10863 | 1.072549 | [
"s813203334",
"s856277091"
] |
u190405389 | p03206 | python | s877978253 | s948689974 | 182 | 163 | 38,256 | 38,256 | Accepted | Accepted | 10.44 | d = int(eval(input()))
print(('Christmas' + (25-d)*' Eve')) | print(('Christmas'+(25-int(eval(input())))*' Eve')) | 2 | 1 | 52 | 43 | d = int(eval(input()))
print(("Christmas" + (25 - d) * " Eve"))
| print(("Christmas" + (25 - int(eval(input()))) * " Eve"))
| false | 50 | [
"-d = int(eval(input()))",
"-print((\"Christmas\" + (25 - d) * \" Eve\"))",
"+print((\"Christmas\" + (25 - int(eval(input()))) * \" Eve\"))"
] | false | 0.062443 | 0.063205 | 0.987951 | [
"s877978253",
"s948689974"
] |
u133936772 | p02796 | python | s799665636 | s361155713 | 492 | 455 | 20,876 | 22,104 | Accepted | Accepted | 7.52 | n = int(eval(input()))
ll = []
for i in range(n):
x, l = list(map(int, input().split()))
ll.append([x-l, x+l])
ll = sorted(ll)
ans = n
r = ll.pop()[0]
while ll:
while ll and ll[-1][1] > r:
ans -= 1
ll.pop()
if ll:
r = ll.pop()[0]
print(ans) | n = int(eval(input()))
ll = []
for i in range(n):
x, l = list(map(int, input().split()))
ll.append([x-l, x+l])
ll = sorted(ll, key=lambda x: x[1])
ans = 0
tmp = -10**9
for s, t in ll:
if s >= tmp:
ans += 1
tmp = t
print(ans) | 18 | 16 | 268 | 244 | n = int(eval(input()))
ll = []
for i in range(n):
x, l = list(map(int, input().split()))
ll.append([x - l, x + l])
ll = sorted(ll)
ans = n
r = ll.pop()[0]
while ll:
while ll and ll[-1][1] > r:
ans -= 1
ll.pop()
if ll:
r = ll.pop()[0]
print(ans)
| n = int(eval(input()))
ll = []
for i in range(n):
x, l = list(map(int, input().split()))
ll.append([x - l, x + l])
ll = sorted(ll, key=lambda x: x[1])
ans = 0
tmp = -(10**9)
for s, t in ll:
if s >= tmp:
ans += 1
tmp = t
print(ans)
| false | 11.111111 | [
"-ll = sorted(ll)",
"-ans = n",
"-r = ll.pop()[0]",
"-while ll:",
"- while ll and ll[-1][1] > r:",
"- ans -= 1",
"- ll.pop()",
"- if ll:",
"- r = ll.pop()[0]",
"+ll = sorted(ll, key=lambda x: x[1])",
"+ans = 0",
"+tmp = -(10**9)",
"+for s, t in ll:",
"+ if s >... | false | 0.048667 | 0.036464 | 1.334658 | [
"s799665636",
"s361155713"
] |
u968166680 | p02971 | python | s469013233 | s995073165 | 332 | 141 | 42,980 | 33,440 | Accepted | Accepted | 57.53 | import sys
from operator import itemgetter
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007
def main():
N, *A = map(int, read().split())
B = [(i, a) for i, a in enumerate(A)]
B.sort(key=it... | import sys
from operator import itemgetter
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007
def main():
N, *A = list(map(int, read().split()))
a_max = max(A)
max_count = A.count(a_max)
fo... | 29 | 31 | 539 | 580 | import sys
from operator import itemgetter
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10**9)
INF = 1 << 60
MOD = 1000000007
def main():
N, *A = map(int, read().split())
B = [(i, a) for i, a in enumerate(A)]
B.sort(key=itemgetter(1))
ans =... | import sys
from operator import itemgetter
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10**9)
INF = 1 << 60
MOD = 1000000007
def main():
N, *A = list(map(int, read().split()))
a_max = max(A)
max_count = A.count(a_max)
for a in A:
i... | false | 6.451613 | [
"- N, *A = map(int, read().split())",
"- B = [(i, a) for i, a in enumerate(A)]",
"- B.sort(key=itemgetter(1))",
"- ans = [0] * N",
"- for i, a in B[:-1]:",
"- ans[i] = B[-1][1]",
"- ans[B[-1][0]] = B[-2][1]",
"- print(*ans, sep=\"\\n\")",
"+ N, *A = list(map(int, read(... | false | 0.034353 | 0.041865 | 0.820578 | [
"s469013233",
"s995073165"
] |
u491550356 | p02608 | python | s441215421 | s091981959 | 441 | 223 | 9,320 | 9,144 | Accepted | Accepted | 49.43 | N = int(eval(input()))
ans = [0] * (N+1)
for a in range(1, 105):
if a*a > N :
continue
for b in range(1, 105):
if a*a + b*b > N:
continue
for c in range(1, 105):
if a*a + b*b + c*c + a*b + b*c + c*a > N:
continue
ans[a*a + b*b + c*c + a*b + b*c + c*a] += 1
... | N = int(eval(input()))
ans = [0] * (N+1)
for a in range(1, 105):
if a*a > N :
break
for b in range(1, 105):
if a*a + b*b > N:
break
for c in range(1, 105):
if a*a + b*b + c*c + a*b + b*c + c*a > N:
break
ans[a*a + b*b + c*c + a*b + b*c + c*a] += 1
for i in... | 16 | 16 | 355 | 347 | N = int(eval(input()))
ans = [0] * (N + 1)
for a in range(1, 105):
if a * a > N:
continue
for b in range(1, 105):
if a * a + b * b > N:
continue
for c in range(1, 105):
if a * a + b * b + c * c + a * b + b * c + c * a > N:
continue
ans[... | N = int(eval(input()))
ans = [0] * (N + 1)
for a in range(1, 105):
if a * a > N:
break
for b in range(1, 105):
if a * a + b * b > N:
break
for c in range(1, 105):
if a * a + b * b + c * c + a * b + b * c + c * a > N:
break
ans[a * a + b... | false | 0 | [
"- continue",
"+ break",
"- continue",
"+ break",
"- continue",
"+ break"
] | false | 0.051483 | 0.047278 | 1.088944 | [
"s441215421",
"s091981959"
] |
u401487574 | p03835 | python | s760576709 | s142373879 | 1,382 | 1,273 | 3,060 | 2,940 | Accepted | Accepted | 7.89 | k,s = list(map(int,input().split()))
Xm = k
Ym = k
Zm = k #使わない
count = 0
for i in range(Xm+1):
for j in range(Ym+1):
if 0<= s - (i+j) <= k:
count += 1
print(count) | k,s = list(map(int,input().split()))
x,y,z = k,k,k
cnt = 0
for i in range(k+1):
for j in range(k+1):
if 0<= s - (i+j) <= k:
cnt +=1
print(cnt)
| 10 | 8 | 181 | 168 | k, s = list(map(int, input().split()))
Xm = k
Ym = k
Zm = k # 使わない
count = 0
for i in range(Xm + 1):
for j in range(Ym + 1):
if 0 <= s - (i + j) <= k:
count += 1
print(count)
| k, s = list(map(int, input().split()))
x, y, z = k, k, k
cnt = 0
for i in range(k + 1):
for j in range(k + 1):
if 0 <= s - (i + j) <= k:
cnt += 1
print(cnt)
| false | 20 | [
"-Xm = k",
"-Ym = k",
"-Zm = k # 使わない",
"-count = 0",
"-for i in range(Xm + 1):",
"- for j in range(Ym + 1):",
"+x, y, z = k, k, k",
"+cnt = 0",
"+for i in range(k + 1):",
"+ for j in range(k + 1):",
"- count += 1",
"-print(count)",
"+ cnt += 1",
"+print(cnt)"
... | false | 0.035789 | 0.096551 | 0.370669 | [
"s760576709",
"s142373879"
] |
u759412327 | p03644 | python | s099492914 | s721652636 | 19 | 17 | 3,060 | 2,940 | Accepted | Accepted | 10.53 | a = int(eval(input()))
if a<=1:
print((1))
elif a<=3:
print((2))
elif a<=7:
print((4))
elif a<=15:
print((8))
elif a<=31:
print((16))
elif a<=63:
print((32))
else:
print((64))
| N = int(eval(input()))
a = 1
while a*2<=N:
a*=2
print(a)
| 15 | 7 | 184 | 63 | a = int(eval(input()))
if a <= 1:
print((1))
elif a <= 3:
print((2))
elif a <= 7:
print((4))
elif a <= 15:
print((8))
elif a <= 31:
print((16))
elif a <= 63:
print((32))
else:
print((64))
| N = int(eval(input()))
a = 1
while a * 2 <= N:
a *= 2
print(a)
| false | 53.333333 | [
"-a = int(eval(input()))",
"-if a <= 1:",
"- print((1))",
"-elif a <= 3:",
"- print((2))",
"-elif a <= 7:",
"- print((4))",
"-elif a <= 15:",
"- print((8))",
"-elif a <= 31:",
"- print((16))",
"-elif a <= 63:",
"- print((32))",
"-else:",
"- print((64))",
"+N = int(... | false | 0.051555 | 0.051265 | 1.005656 | [
"s099492914",
"s721652636"
] |
u644907318 | p03048 | python | s048128850 | s186611656 | 86 | 61 | 67,356 | 66,256 | Accepted | Accepted | 29.07 | R,G,B,N = list(map(int,input().split()))
cnt = 0
for r in range(N//R+1):
for g in range(N//G+1):
n = N-r*R-g*G
if n>=0 and n%B==0:
cnt += 1
print(cnt) | R,G,B,N = list(map(int,input().split()))
cnt = 0
for r in range(N//R+1):
for g in range((N-r*R)//G+1):
if (N-r*R-g*G)%B==0:
cnt += 1
print(cnt) | 8 | 7 | 183 | 167 | R, G, B, N = list(map(int, input().split()))
cnt = 0
for r in range(N // R + 1):
for g in range(N // G + 1):
n = N - r * R - g * G
if n >= 0 and n % B == 0:
cnt += 1
print(cnt)
| R, G, B, N = list(map(int, input().split()))
cnt = 0
for r in range(N // R + 1):
for g in range((N - r * R) // G + 1):
if (N - r * R - g * G) % B == 0:
cnt += 1
print(cnt)
| false | 12.5 | [
"- for g in range(N // G + 1):",
"- n = N - r * R - g * G",
"- if n >= 0 and n % B == 0:",
"+ for g in range((N - r * R) // G + 1):",
"+ if (N - r * R - g * G) % B == 0:"
] | false | 0.121555 | 0.055677 | 2.183197 | [
"s048128850",
"s186611656"
] |
u934442292 | p03164 | python | s744040297 | s938942653 | 1,141 | 162 | 198,232 | 106,636 | Accepted | Accepted | 85.8 | import sys
import numba as nb
import numpy as np
input = sys.stdin.readline
@nb.njit("i8(i8,i8,i8[:],i8[:])")
def solve(N, W, w, v):
dp = np.full(shape=(N + 1, np.sum(v) + 1), fill_value=(N * W), dtype=np.int64)
dp[:, 0] = 0
for i in range(N):
np.minimum(w[i], dp[i][:v[i]], dp[i + 1... | import sys
# import numba as nb
import numpy as np
input = sys.stdin.readline
# @nb.njit("i8(i8,i8,i8[:],i8[:])")
def solve(N, W, w, v):
dp = np.full(shape=(N + 1, np.sum(v) + 1), fill_value=(N * W), dtype=np.int64)
dp[:, 0] = 0
for i in range(N):
np.minimum(w[i], dp[i][:v[i]], dp[i... | 32 | 32 | 753 | 757 | import sys
import numba as nb
import numpy as np
input = sys.stdin.readline
@nb.njit("i8(i8,i8,i8[:],i8[:])")
def solve(N, W, w, v):
dp = np.full(shape=(N + 1, np.sum(v) + 1), fill_value=(N * W), dtype=np.int64)
dp[:, 0] = 0
for i in range(N):
np.minimum(w[i], dp[i][: v[i]], dp[i + 1][: v[i]])
... | import sys
# import numba as nb
import numpy as np
input = sys.stdin.readline
# @nb.njit("i8(i8,i8,i8[:],i8[:])")
def solve(N, W, w, v):
dp = np.full(shape=(N + 1, np.sum(v) + 1), fill_value=(N * W), dtype=np.int64)
dp[:, 0] = 0
for i in range(N):
np.minimum(w[i], dp[i][: v[i]], dp[i + 1][: v[i]])... | false | 0 | [
"-import numba as nb",
"+",
"+# import numba as nb",
"-",
"-",
"-@nb.njit(\"i8(i8,i8,i8[:],i8[:])\")",
"+# @nb.njit(\"i8(i8,i8,i8[:],i8[:])\")"
] | false | 0.04665 | 0.201703 | 0.23128 | [
"s744040297",
"s938942653"
] |
u929996201 | p02601 | python | s540340910 | s090835806 | 35 | 26 | 9,288 | 9,188 | Accepted | Accepted | 25.71 | import copy
def magic(arr,i,k):
if(k==0):
if(arr[0] < arr[1] and arr[1] < arr[2]):
return True
else:
return False
k-=1
arr[i]*=2
return magic(arr.copy(),0,k) or magic(arr.copy(),1,k) or magic(arr.copy(),2,k)
if __name__ == "__main__":
arr = list(map(int,input().split()))
... | a,b,c = list(map(int,input().split()))
k = int(eval(input()))
for i in range(k):
if(a >= b):
b*=2
continue
if(b >= c):
c*=2
continue
if(a<b and b<c):
print("Yes")
exit()
else:
print("No") | 19 | 16 | 472 | 222 | import copy
def magic(arr, i, k):
if k == 0:
if arr[0] < arr[1] and arr[1] < arr[2]:
return True
else:
return False
k -= 1
arr[i] *= 2
return magic(arr.copy(), 0, k) or magic(arr.copy(), 1, k) or magic(arr.copy(), 2, k)
if __name__ == "__main__":
arr = lis... | a, b, c = list(map(int, input().split()))
k = int(eval(input()))
for i in range(k):
if a >= b:
b *= 2
continue
if b >= c:
c *= 2
continue
if a < b and b < c:
print("Yes")
exit()
else:
print("No")
| false | 15.789474 | [
"-import copy",
"-",
"-",
"-def magic(arr, i, k):",
"- if k == 0:",
"- if arr[0] < arr[1] and arr[1] < arr[2]:",
"- return True",
"- else:",
"- return False",
"- k -= 1",
"- arr[i] *= 2",
"- return magic(arr.copy(), 0, k) or magic(arr.copy(), 1, ... | false | 0.038895 | 0.037499 | 1.037218 | [
"s540340910",
"s090835806"
] |
u466161487 | p02708 | python | s259374489 | s367365523 | 92 | 73 | 9,160 | 9,164 | Accepted | Accepted | 20.65 | a,b=(int(x) for x in input().split())
z=0
for i in range(b,a+2):
z=(z+(a-i+1)*i+1)%int(1e9+7)
print(z) | a,b=(int(x) for x in input().split())
z=0
for i in range(b,a+2):z=(z+(a-i+1)*i+1)%(10**9+7)
print(z) | 5 | 4 | 108 | 103 | a, b = (int(x) for x in input().split())
z = 0
for i in range(b, a + 2):
z = (z + (a - i + 1) * i + 1) % int(1e9 + 7)
print(z)
| a, b = (int(x) for x in input().split())
z = 0
for i in range(b, a + 2):
z = (z + (a - i + 1) * i + 1) % (10**9 + 7)
print(z)
| false | 20 | [
"- z = (z + (a - i + 1) * i + 1) % int(1e9 + 7)",
"+ z = (z + (a - i + 1) * i + 1) % (10**9 + 7)"
] | false | 0.058117 | 0.041586 | 1.397533 | [
"s259374489",
"s367365523"
] |
u002459665 | p03625 | python | s872018535 | s791313028 | 101 | 88 | 14,636 | 14,636 | Accepted | Accepted | 12.87 | from collections import Counter
N = int(eval(input()))
A = list(map(int, input().split()))
A.sort(reverse=True)
# print(A)
lines = []
cnt = 1
before = 'XXX'
for ai in A + ['YYY']:
if ai == before:
cnt += 1
else:
if cnt >= 4:
lines.append(before)
lines.... | def main():
N = int(eval(input()))
A = list(map(int, input().split()))
A.sort(reverse=True)
lines = []
prev = ''
for ai in A:
if ai == prev:
lines.append(ai)
prev = ''
else:
prev = ai
if len(lines) >= 2:
print((... | 32 | 22 | 561 | 408 | from collections import Counter
N = int(eval(input()))
A = list(map(int, input().split()))
A.sort(reverse=True)
# print(A)
lines = []
cnt = 1
before = "XXX"
for ai in A + ["YYY"]:
if ai == before:
cnt += 1
else:
if cnt >= 4:
lines.append(before)
lines.append(before)
... | def main():
N = int(eval(input()))
A = list(map(int, input().split()))
A.sort(reverse=True)
lines = []
prev = ""
for ai in A:
if ai == prev:
lines.append(ai)
prev = ""
else:
prev = ai
if len(lines) >= 2:
print((lines[0] * lines[1]))... | false | 31.25 | [
"-from collections import Counter",
"+def main():",
"+ N = int(eval(input()))",
"+ A = list(map(int, input().split()))",
"+ A.sort(reverse=True)",
"+ lines = []",
"+ prev = \"\"",
"+ for ai in A:",
"+ if ai == prev:",
"+ lines.append(ai)",
"+ prev =... | false | 0.040374 | 0.044982 | 0.897565 | [
"s872018535",
"s791313028"
] |
u638282348 | p02675 | python | s209747082 | s071957524 | 24 | 20 | 9,164 | 8,944 | Accepted | Accepted | 16.67 | N = int(eval(input())) % 10
print(("hon" if N in [2, 4, 5, 7, 9] else "pon" if N in [0, 1, 6, 8] else "bon")) | N = input()[-1]
print(("hon" if N in "24579" else "pon" if N in "0168" else "bon")) | 2 | 2 | 102 | 82 | N = int(eval(input())) % 10
print(("hon" if N in [2, 4, 5, 7, 9] else "pon" if N in [0, 1, 6, 8] else "bon"))
| N = input()[-1]
print(("hon" if N in "24579" else "pon" if N in "0168" else "bon"))
| false | 0 | [
"-N = int(eval(input())) % 10",
"-print((\"hon\" if N in [2, 4, 5, 7, 9] else \"pon\" if N in [0, 1, 6, 8] else \"bon\"))",
"+N = input()[-1]",
"+print((\"hon\" if N in \"24579\" else \"pon\" if N in \"0168\" else \"bon\"))"
] | false | 0.044774 | 0.041583 | 1.07676 | [
"s209747082",
"s071957524"
] |
u057964173 | p02971 | python | s037768599 | s825925257 | 462 | 425 | 61,024 | 61,280 | Accepted | Accepted | 8.01 | import sys
def input(): return sys.stdin.readline().strip()
def resolve():
n=int(eval(input()))
l=[int(eval(input())) for i in range(n)]
biggest = max(l)
lsort=sorted(l)
niban=lsort[-2]
for j in range(n):
if l[j]!=biggest:
print(biggest)
else:
... | import sys
def input(): return sys.stdin.readline().strip()
def resolve():
n=int(eval(input()))
l=[int(eval(input())) for i in range(n)]
l1=sorted(l,reverse=True)
for j in range(n):
if l[j]!=l1[0]:
print((l1[0]))
else:
print((l1[1]))
resolve() | 15 | 12 | 333 | 294 | import sys
def input():
return sys.stdin.readline().strip()
def resolve():
n = int(eval(input()))
l = [int(eval(input())) for i in range(n)]
biggest = max(l)
lsort = sorted(l)
niban = lsort[-2]
for j in range(n):
if l[j] != biggest:
print(biggest)
else:
... | import sys
def input():
return sys.stdin.readline().strip()
def resolve():
n = int(eval(input()))
l = [int(eval(input())) for i in range(n)]
l1 = sorted(l, reverse=True)
for j in range(n):
if l[j] != l1[0]:
print((l1[0]))
else:
print((l1[1]))
resolve()
| false | 20 | [
"- biggest = max(l)",
"- lsort = sorted(l)",
"- niban = lsort[-2]",
"+ l1 = sorted(l, reverse=True)",
"- if l[j] != biggest:",
"- print(biggest)",
"+ if l[j] != l1[0]:",
"+ print((l1[0]))",
"- print(niban)",
"+ print((l1[1]))"
] | false | 0.033223 | 0.037726 | 0.880635 | [
"s037768599",
"s825925257"
] |
u859987056 | p03545 | python | s390180574 | s936043480 | 29 | 26 | 8,840 | 9,124 | Accepted | Accepted | 10.34 | s = eval(input())
for bit in range(1 << 3):
ans = s[0]
value = int(s[0])
for i in range(3):
if bit & (1 << i):
ans += "+" + s[i+1]
value += int(s[i+1])
else:
ans += "-" + s[i+1]
value -= int(s[i+1])
if value == 7:
... | s = eval(input())
def dfs(i,f,sum):
if i == 3:
if sum == 7:
print((f + "=7"))
exit()
else:
dfs(i+1,f + "+" + s[i+1],sum + int(s[i+1]))
dfs(i+1,f + "-" + s[i+1],sum - int(s[i+1]))
dfs(0,s[0],int(s[0])) | 16 | 13 | 349 | 270 | s = eval(input())
for bit in range(1 << 3):
ans = s[0]
value = int(s[0])
for i in range(3):
if bit & (1 << i):
ans += "+" + s[i + 1]
value += int(s[i + 1])
else:
ans += "-" + s[i + 1]
value -= int(s[i + 1])
if value == 7:
print((ans... | s = eval(input())
def dfs(i, f, sum):
if i == 3:
if sum == 7:
print((f + "=7"))
exit()
else:
dfs(i + 1, f + "+" + s[i + 1], sum + int(s[i + 1]))
dfs(i + 1, f + "-" + s[i + 1], sum - int(s[i + 1]))
dfs(0, s[0], int(s[0]))
| false | 18.75 | [
"-for bit in range(1 << 3):",
"- ans = s[0]",
"- value = int(s[0])",
"- for i in range(3):",
"- if bit & (1 << i):",
"- ans += \"+\" + s[i + 1]",
"- value += int(s[i + 1])",
"- else:",
"- ans += \"-\" + s[i + 1]",
"- value -= int(s... | false | 0.044845 | 0.043501 | 1.030885 | [
"s390180574",
"s936043480"
] |
u488401358 | p02710 | python | s730147385 | s762628346 | 1,961 | 1,794 | 293,300 | 427,228 | Accepted | Accepted | 8.52 | import sys
input=sys.stdin.readline
sys.setrecursionlimit(10**7)
N=int(eval(input()))
c=list(map(int,input().split()))
for i in range(N):
c[i]-=1
edge=[[] for i in range(N)]
for i in range(N-1):
a,b=list(map(int,input().split()))
edge[a-1].append(b-1)
edge[b-1].append(a-1)
subtree=[1]*... | import sys
from collections import deque
input = sys.stdin.buffer.readline
sys.setrecursionlimit(2*10**5)
N = int(eval(input()))
c = list(map(int,input().split()))
edge = [[] for i in range(N+1)]
for _ in range(N-1):
a,b = list(map(int,input().split()))
edge[a].append(b)
edge[b].append(a)
... | 48 | 89 | 968 | 1,990 | import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
N = int(eval(input()))
c = list(map(int, input().split()))
for i in range(N):
c[i] -= 1
edge = [[] for i in range(N)]
for i in range(N - 1):
a, b = list(map(int, input().split()))
edge[a - 1].append(b - 1)
edge[b - 1].append(a - 1)
subt... | import sys
from collections import deque
input = sys.stdin.buffer.readline
sys.setrecursionlimit(2 * 10**5)
N = int(eval(input()))
c = list(map(int, input().split()))
edge = [[] for i in range(N + 1)]
for _ in range(N - 1):
a, b = list(map(int, input().split()))
edge[a].append(b)
edge[b].append(a)
# 合流点の検出... | false | 46.067416 | [
"+from collections import deque",
"-input = sys.stdin.readline",
"-sys.setrecursionlimit(10**7)",
"+input = sys.stdin.buffer.readline",
"+sys.setrecursionlimit(2 * 10**5)",
"-for i in range(N):",
"- c[i] -= 1",
"-edge = [[] for i in range(N)]",
"-for i in range(N - 1):",
"+edge = [[] for i in r... | false | 0.09014 | 0.071523 | 1.260295 | [
"s730147385",
"s762628346"
] |
u463655976 | p03053 | python | s147691550 | s067151352 | 961 | 820 | 153,308 | 153,308 | Accepted | Accepted | 14.67 | from collections import deque
H,W = list(map(int, input().split()))
A = 0
dp = [None] * H
mat = deque()
for h in range(H):
s = list(eval(input()))
for w, x in zip(list(range(W)), s):
if x == "#":
mat.append((h, w, 0))
dp[h] = s
while len(mat):
h, w, cnt = mat.popleft()
... | from collections import deque
H,W = list(map(int, input().split()))
A = 0
dp = [None] * H
mat = deque(maxlen=W*H)
for h in range(H):
s = list(eval(input()))
for w, x in zip(list(range(W)), s):
if x == "#":
mat.append((h, w, 0))
dp[h] = s
while len(mat):
h, w, cnt = mat.... | 21 | 21 | 546 | 556 | from collections import deque
H, W = list(map(int, input().split()))
A = 0
dp = [None] * H
mat = deque()
for h in range(H):
s = list(eval(input()))
for w, x in zip(list(range(W)), s):
if x == "#":
mat.append((h, w, 0))
dp[h] = s
while len(mat):
h, w, cnt = mat.popleft()
for t, h... | from collections import deque
H, W = list(map(int, input().split()))
A = 0
dp = [None] * H
mat = deque(maxlen=W * H)
for h in range(H):
s = list(eval(input()))
for w, x in zip(list(range(W)), s):
if x == "#":
mat.append((h, w, 0))
dp[h] = s
while len(mat):
h, w, cnt = mat.popleft()
... | false | 0 | [
"-mat = deque()",
"+mat = deque(maxlen=W * H)",
"- for t, h, w, cnt in [",
"+ for t, h, w, cnt in (",
"- ]:",
"+ ):"
] | false | 0.113328 | 0.041418 | 2.736189 | [
"s147691550",
"s067151352"
] |
u562935282 | p03161 | python | s654326233 | s319608783 | 530 | 427 | 56,544 | 58,308 | Accepted | Accepted | 19.43 | inf = float('inf')
n, k = list(map(int, input().split()))
h = list(map(int, input().split()))
dp = [inf] * n
dp[0] = 0
for i in range(1, n):
dp[i] = min(dp[i - j] + abs(h[i] - h[i - j]) for j in range(1, k + 1) if i - j >= 0)
print((dp[n - 1]))
| inf = float('inf')
n, k = list(map(int, input().split()))
h = list(map(int, input().split())) + [inf] * k
dp = [inf] * (n + k)
dp[0] = 0
# 配る
for i in range(n - 1):
for j in range(1, k + 1):
dp[i + j] = min(dp[i + j], dp[i] + abs(h[i + j] - h[i]))
print((dp[n - 1]))
| 12 | 13 | 256 | 286 | inf = float("inf")
n, k = list(map(int, input().split()))
h = list(map(int, input().split()))
dp = [inf] * n
dp[0] = 0
for i in range(1, n):
dp[i] = min(dp[i - j] + abs(h[i] - h[i - j]) for j in range(1, k + 1) if i - j >= 0)
print((dp[n - 1]))
| inf = float("inf")
n, k = list(map(int, input().split()))
h = list(map(int, input().split())) + [inf] * k
dp = [inf] * (n + k)
dp[0] = 0
# 配る
for i in range(n - 1):
for j in range(1, k + 1):
dp[i + j] = min(dp[i + j], dp[i] + abs(h[i + j] - h[i]))
print((dp[n - 1]))
| false | 7.692308 | [
"-h = list(map(int, input().split()))",
"-dp = [inf] * n",
"+h = list(map(int, input().split())) + [inf] * k",
"+dp = [inf] * (n + k)",
"-for i in range(1, n):",
"- dp[i] = min(dp[i - j] + abs(h[i] - h[i - j]) for j in range(1, k + 1) if i - j >= 0)",
"+# 配る",
"+for i in range(n - 1):",
"+ for... | false | 0.038464 | 0.038228 | 1.006176 | [
"s654326233",
"s319608783"
] |
u197300773 | p02691 | python | s738087948 | s497620804 | 189 | 172 | 127,068 | 127,200 | Accepted | Accepted | 8.99 | from collections import defaultdict
n=int(eval(input()))
a=list(map(int,input().split()))
d=defaultdict(int)
for i in range(n):
d[i+1-a[i]]+=1
print((sum(d[i+1+a[i]] for i in range(n)))) | from collections import defaultdict
n=int(eval(input()))
a=list(map(int,input().split()))
d=defaultdict(int)
for i in range(n):
d[i-a[i]]+=1
ans=0
for i in range(n):
ans+=d[i+a[i]]
print(ans) | 7 | 10 | 188 | 202 | from collections import defaultdict
n = int(eval(input()))
a = list(map(int, input().split()))
d = defaultdict(int)
for i in range(n):
d[i + 1 - a[i]] += 1
print((sum(d[i + 1 + a[i]] for i in range(n))))
| from collections import defaultdict
n = int(eval(input()))
a = list(map(int, input().split()))
d = defaultdict(int)
for i in range(n):
d[i - a[i]] += 1
ans = 0
for i in range(n):
ans += d[i + a[i]]
print(ans)
| false | 30 | [
"- d[i + 1 - a[i]] += 1",
"-print((sum(d[i + 1 + a[i]] for i in range(n))))",
"+ d[i - a[i]] += 1",
"+ans = 0",
"+for i in range(n):",
"+ ans += d[i + a[i]]",
"+print(ans)"
] | false | 0.03873 | 0.067095 | 0.577246 | [
"s738087948",
"s497620804"
] |
u633068244 | p00263 | python | s372542698 | s891618875 | 310 | 40 | 4,580 | 4,524 | Accepted | Accepted | 87.1 | for i in range(eval(input())):
b=format(int(input(),16),"b").zfill(32)
a1=0
a2=0.0
for i in range(1,25):
a1+=int(b[i])*2**(24-i)
for i in range(25,32):
a2+=int(b[i])*2**(24-i)
print("-"*int(b[0])+str(a1)+str(a2)[1:]) | for i in range(eval(input())):
b=int(input(),16)
s=1<<31
p=""
if b&s!=0:
b^=s
p="-"
a=int(b*1.0/(1<<7))
print(p+str(a)+str(abs(b*1.0/(1<<7)-a))[1:]) | 9 | 9 | 232 | 167 | for i in range(eval(input())):
b = format(int(input(), 16), "b").zfill(32)
a1 = 0
a2 = 0.0
for i in range(1, 25):
a1 += int(b[i]) * 2 ** (24 - i)
for i in range(25, 32):
a2 += int(b[i]) * 2 ** (24 - i)
print("-" * int(b[0]) + str(a1) + str(a2)[1:])
| for i in range(eval(input())):
b = int(input(), 16)
s = 1 << 31
p = ""
if b & s != 0:
b ^= s
p = "-"
a = int(b * 1.0 / (1 << 7))
print(p + str(a) + str(abs(b * 1.0 / (1 << 7) - a))[1:])
| false | 0 | [
"- b = format(int(input(), 16), \"b\").zfill(32)",
"- a1 = 0",
"- a2 = 0.0",
"- for i in range(1, 25):",
"- a1 += int(b[i]) * 2 ** (24 - i)",
"- for i in range(25, 32):",
"- a2 += int(b[i]) * 2 ** (24 - i)",
"- print(\"-\" * int(b[0]) + str(a1) + str(a2)[1:])",
"+ ... | false | 0.094854 | 0.006925 | 13.697001 | [
"s372542698",
"s891618875"
] |
u057964173 | p03627 | python | s369871779 | s336653539 | 336 | 247 | 68,352 | 64,896 | Accepted | Accepted | 26.49 | import sys
def input(): return sys.stdin.readline().strip()
def resolve():
n=int(eval(input()))
l=list(map(int,input().split()))
from collections import Counter
c=Counter(l)# ()にカウンターの対象のリストの変数名
cl=list(c.items())
cl.sort(key=lambda x:x[0],reverse=True)
ans=[]
for key,value i... | import sys
def input(): return sys.stdin.readline().strip()
def resolve():
n=int(eval(input()))
l=list(map(int,input().split()))
from collections import Counter
c=Counter(l)# ()にカウンターの対象のリストの変数名
ans=[]
for key,value in list(c.items()):
if value>=4:
ans.append(key)... | 29 | 21 | 734 | 501 | import sys
def input():
return sys.stdin.readline().strip()
def resolve():
n = int(eval(input()))
l = list(map(int, input().split()))
from collections import Counter
c = Counter(l) # ()にカウンターの対象のリストの変数名
cl = list(c.items())
cl.sort(key=lambda x: x[0], reverse=True)
ans = []
for... | import sys
def input():
return sys.stdin.readline().strip()
def resolve():
n = int(eval(input()))
l = list(map(int, input().split()))
from collections import Counter
c = Counter(l) # ()にカウンターの対象のリストの変数名
ans = []
for key, value in list(c.items()):
if value >= 4:
ans.... | false | 27.586207 | [
"- cl = list(c.items())",
"- cl.sort(key=lambda x: x[0], reverse=True)",
"- for key, value in cl:",
"+ for key, value in list(c.items()):",
"- if len(ans) == 0:",
"- ans.append(key)",
"- ans.append(key)",
"- break",
"- el... | false | 0.041945 | 0.038396 | 1.092441 | [
"s369871779",
"s336653539"
] |
u129019798 | p03166 | python | s301297448 | s026017146 | 972 | 492 | 139,596 | 109,360 | Accepted | Accepted | 49.38 | def main():
import sys
sys.setrecursionlimit(10**7)
N,M=list(map(int,sys.stdin.readline().split()))
dic=[[] for _ in range(N)]
for i in range(M):
x,y=list(map(int,sys.stdin.readline().split()))
dic[x-1].append(y-1)
dp=[0]*(N)
def dfs(frm):
if dp[frm]:
... | def main():
import sys
sys.setrecursionlimit(10**7)
N,M=list(map(int,sys.stdin.readline().split()))
dic=[[] for _ in range(N)]
for i in range(M):
x,y=list(map(int,sys.stdin.readline().split()))
dic[x-1].append(y-1)
dp=[0]*(N)
def dfs(frm):
if dp[frm]:
... | 33 | 29 | 621 | 566 | def main():
import sys
sys.setrecursionlimit(10**7)
N, M = list(map(int, sys.stdin.readline().split()))
dic = [[] for _ in range(N)]
for i in range(M):
x, y = list(map(int, sys.stdin.readline().split()))
dic[x - 1].append(y - 1)
dp = [0] * (N)
def dfs(frm):
if dp[fr... | def main():
import sys
sys.setrecursionlimit(10**7)
N, M = list(map(int, sys.stdin.readline().split()))
dic = [[] for _ in range(N)]
for i in range(M):
x, y = list(map(int, sys.stdin.readline().split()))
dic[x - 1].append(y - 1)
dp = [0] * (N)
def dfs(frm):
if dp[fr... | false | 12.121212 | [
"- for val in dic[frm]:",
"- mx = max(mx, dfs(val) + 1)",
"- dp[frm] = mx",
"- return mx",
"+ dp[frm] = max(dfs(val) + 1 for val in dic[frm])",
"+ return dp[frm]",
"- for key in range(N):",
"- mx = max(mx, dfs(key))",
"- return mx",
"+ ... | false | 0.067061 | 0.091375 | 0.733911 | [
"s301297448",
"s026017146"
] |
u017415492 | p02971 | python | s178057087 | s935656606 | 676 | 352 | 14,568 | 19,028 | Accepted | Accepted | 47.93 | import copy
n=int(eval(input()))
a=[int(eval(input())) for i in range(n)]
t=copy.deepcopy(a)
t.sort()
for i in a:
if i==t[-1]:
print((t[-2]))
else:
print((t[-1])) | n=int(eval(input()))
a=[int(eval(input())) for i in range(n)]
sa=sorted(a)
for i in a:
if sa[-1]==i:
print((sa[-2]))
else:
print((sa[-1])) | 11 | 9 | 173 | 143 | import copy
n = int(eval(input()))
a = [int(eval(input())) for i in range(n)]
t = copy.deepcopy(a)
t.sort()
for i in a:
if i == t[-1]:
print((t[-2]))
else:
print((t[-1]))
| n = int(eval(input()))
a = [int(eval(input())) for i in range(n)]
sa = sorted(a)
for i in a:
if sa[-1] == i:
print((sa[-2]))
else:
print((sa[-1]))
| false | 18.181818 | [
"-import copy",
"-",
"-t = copy.deepcopy(a)",
"-t.sort()",
"+sa = sorted(a)",
"- if i == t[-1]:",
"- print((t[-2]))",
"+ if sa[-1] == i:",
"+ print((sa[-2]))",
"- print((t[-1]))",
"+ print((sa[-1]))"
] | false | 0.048029 | 0.046716 | 1.028109 | [
"s178057087",
"s935656606"
] |
u150641538 | p03304 | python | s691639636 | s125308090 | 302 | 17 | 21,088 | 3,060 | Accepted | Accepted | 94.37 | import numpy as np
n,m,d = list(map(int,input().split()))
"""
#kuso code
start = time.time()
a = [random.randrange(n) for i in range(m)]
a = np.array(a)
b = np.abs(a[1:]-a[:-1])
cnt = np.sum(b == d)
ave = cnt
i = 0
while(time.time() - start < 10):
a = [random.randrange(n) for i in range(m)]
a... | n,m,d = list(map(int,input().split()))
"""
#kuso code
start = time.time()
a = [random.randrange(n) for i in range(m)]
a = np.array(a)
b = np.abs(a[1:]-a[:-1])
cnt = np.sum(b == d)
ave = cnt
i = 0
while(time.time() - start < 10):
a = [random.randrange(n) for i in range(m)]
a = np.array(a)
b ... | 29 | 27 | 559 | 520 | import numpy as np
n, m, d = list(map(int, input().split()))
"""
#kuso code
start = time.time()
a = [random.randrange(n) for i in range(m)]
a = np.array(a)
b = np.abs(a[1:]-a[:-1])
cnt = np.sum(b == d)
ave = cnt
i = 0
while(time.time() - start < 10):
a = [random.randrange(n) for i in range(m)]
a = np.array(a)
... | n, m, d = list(map(int, input().split()))
"""
#kuso code
start = time.time()
a = [random.randrange(n) for i in range(m)]
a = np.array(a)
b = np.abs(a[1:]-a[:-1])
cnt = np.sum(b == d)
ave = cnt
i = 0
while(time.time() - start < 10):
a = [random.randrange(n) for i in range(m)]
a = np.array(a)
b = np.abs(a[1:]... | false | 6.896552 | [
"-import numpy as np",
"-",
"-oks_times_n = 2 * np.max(n - 2 * d, 0) + 2 * d",
"+oks_times_n = 2 * (n - d)"
] | false | 0.168838 | 0.035793 | 4.717012 | [
"s691639636",
"s125308090"
] |
u644907318 | p03324 | python | s029968392 | s093184947 | 163 | 30 | 38,256 | 9,176 | Accepted | Accepted | 81.6 | D,N = list(map(int,input().split()))
if D==0:
if N<100:
print(N)
else:
print((101))
else:
if N<100:
print((100**D*N))
else:
print((100**D*101)) | D,N = list(map(int,input().split()))
if D==0 and N<=99:
print((1+N-1))
elif D==0 and N==100:
print((101))
elif D==1 and N<=99:
print((100*N))
elif D==1 and N==100:
print((10100))
elif D==2 and N<=99:
print((10000*N))
elif D==2 and N==100:
print((10000*101)) | 11 | 13 | 189 | 275 | D, N = list(map(int, input().split()))
if D == 0:
if N < 100:
print(N)
else:
print((101))
else:
if N < 100:
print((100**D * N))
else:
print((100**D * 101))
| D, N = list(map(int, input().split()))
if D == 0 and N <= 99:
print((1 + N - 1))
elif D == 0 and N == 100:
print((101))
elif D == 1 and N <= 99:
print((100 * N))
elif D == 1 and N == 100:
print((10100))
elif D == 2 and N <= 99:
print((10000 * N))
elif D == 2 and N == 100:
print((10000 * 101))
| false | 15.384615 | [
"-if D == 0:",
"- if N < 100:",
"- print(N)",
"- else:",
"- print((101))",
"-else:",
"- if N < 100:",
"- print((100**D * N))",
"- else:",
"- print((100**D * 101))",
"+if D == 0 and N <= 99:",
"+ print((1 + N - 1))",
"+elif D == 0 and N == 100:",
"... | false | 0.03944 | 0.040006 | 0.985842 | [
"s029968392",
"s093184947"
] |
u057109575 | p02781 | python | s581390005 | s284238748 | 187 | 72 | 40,560 | 74,036 | Accepted | Accepted | 61.5 | N, K = list(map(int, open(0).read().split()))
X = str(N + 1)
dp = [[[0] * (K + 1) for _ in range(2)] for _ in range(len(X) + 1)]
dp[0][0][0] = 1
for i in range(len(X)):
D = int(X[i])
for j in range(2):
for k in range(K + 1):
for d in range((9 if j == 1 else D) + 1):
... | N = eval(input())
K = int(eval(input()))
dp = [[[0] * (K + 1) for _ in range(2)] for _ in range(len(N) + 1)]
dp[0][0][0] = 1
for i in range(len(N)):
n = int(N[i])
for j in range(2):
for k in range(K + 1):
for d in range((9 if j == 1 else n) + 1):
if k + int(d != ... | 15 | 16 | 444 | 463 | N, K = list(map(int, open(0).read().split()))
X = str(N + 1)
dp = [[[0] * (K + 1) for _ in range(2)] for _ in range(len(X) + 1)]
dp[0][0][0] = 1
for i in range(len(X)):
D = int(X[i])
for j in range(2):
for k in range(K + 1):
for d in range((9 if j == 1 else D) + 1):
if k + in... | N = eval(input())
K = int(eval(input()))
dp = [[[0] * (K + 1) for _ in range(2)] for _ in range(len(N) + 1)]
dp[0][0][0] = 1
for i in range(len(N)):
n = int(N[i])
for j in range(2):
for k in range(K + 1):
for d in range((9 if j == 1 else n) + 1):
if k + int(d != 0) <= K:
... | false | 6.25 | [
"-N, K = list(map(int, open(0).read().split()))",
"-X = str(N + 1)",
"-dp = [[[0] * (K + 1) for _ in range(2)] for _ in range(len(X) + 1)]",
"+N = eval(input())",
"+K = int(eval(input()))",
"+dp = [[[0] * (K + 1) for _ in range(2)] for _ in range(len(N) + 1)]",
"-for i in range(len(X)):",
"- D = in... | false | 0.043218 | 0.039842 | 1.084731 | [
"s581390005",
"s284238748"
] |
u285443936 | p03361 | python | s910813940 | s855041964 | 25 | 19 | 3,064 | 3,064 | Accepted | Accepted | 24 | H, W = list(map(int, input().split()))
sw = [list(str(eval(input()))) for i in range(H)]
dx = [1,0,-1,0]
dy = [0,1,0,-1]
for i in range(H):
for j in range(W):
if sw[i][j] == "#":
counter = 0
for k in range(4):
if i+dx[k] < 0 or i+dx[k] >= H or j+dy[k] < 0 or j+dy[k] >= W:
... | H, W = list(map(int, input().split()))
C = [list(eval(input())) for i in range(H)]
X = [1,0,-1,0]
Y = [0,-1,0,1]
for y in range(H):
for x in range(W):
check = 0
if C[y][x] == "#":
for i in range(4):
nx = x + X[i]
ny = y + Y[i]
if 0 <= nx < W and 0 <= ny < H and C[ny][n... | 18 | 19 | 463 | 437 | H, W = list(map(int, input().split()))
sw = [list(str(eval(input()))) for i in range(H)]
dx = [1, 0, -1, 0]
dy = [0, 1, 0, -1]
for i in range(H):
for j in range(W):
if sw[i][j] == "#":
counter = 0
for k in range(4):
if i + dx[k] < 0 or i + dx[k] >= H or j + dy[k] < 0 ... | H, W = list(map(int, input().split()))
C = [list(eval(input())) for i in range(H)]
X = [1, 0, -1, 0]
Y = [0, -1, 0, 1]
for y in range(H):
for x in range(W):
check = 0
if C[y][x] == "#":
for i in range(4):
nx = x + X[i]
ny = y + Y[i]
if 0 <=... | false | 5.263158 | [
"-sw = [list(str(eval(input()))) for i in range(H)]",
"-dx = [1, 0, -1, 0]",
"-dy = [0, 1, 0, -1]",
"-for i in range(H):",
"- for j in range(W):",
"- if sw[i][j] == \"#\":",
"- counter = 0",
"- for k in range(4):",
"- if i + dx[k] < 0 or i + dx[k] >= H ... | false | 0.036277 | 0.035494 | 1.022069 | [
"s910813940",
"s855041964"
] |
u997648604 | p03253 | python | s097379093 | s603231336 | 91 | 83 | 74,288 | 74,528 | Accepted | Accepted | 8.79 | import sys
sys.setrecursionlimit(10**9)
def mi(): return list(map(int,input().split()))
def ii(): return int(eval(input()))
def isp(): return input().split()
def deb(text): print(("-------\n{}\n-------".format(text)))
INF=10**20
class Counting():
def __init__(self,maxim,mod):
maxim += 1
... | import sys
sys.setrecursionlimit(10**9)
def mi(): return list(map(int,input().split()))
def ii(): return int(eval(input()))
def isp(): return input().split()
def deb(text): print(("-------\n{}\n-------".format(text)))
INF=10**20
class Counting():
def __init__(self,maxim,mod):
maxim += 1
... | 81 | 82 | 1,832 | 1,842 | import sys
sys.setrecursionlimit(10**9)
def mi():
return list(map(int, input().split()))
def ii():
return int(eval(input()))
def isp():
return input().split()
def deb(text):
print(("-------\n{}\n-------".format(text)))
INF = 10**20
class Counting:
def __init__(self, maxim, mod):
... | import sys
sys.setrecursionlimit(10**9)
def mi():
return list(map(int, input().split()))
def ii():
return int(eval(input()))
def isp():
return input().split()
def deb(text):
print(("-------\n{}\n-------".format(text)))
INF = 10**20
class Counting:
def __init__(self, maxim, mod):
... | false | 1.219512 | [
"- def prime_array(n):",
"- a = []",
"- b = set()",
"+ def prime_factorize(n):",
"+ P = []",
"+ P_set = set()",
"- a.append(2)",
"- b.add(2)",
"+ P.append(2)",
"+ P_set.add(2)",
"- a.append(f)",
"- ... | false | 0.685291 | 0.789284 | 0.868243 | [
"s097379093",
"s603231336"
] |
u057415180 | p03107 | python | s163504156 | s561767530 | 39 | 35 | 3,188 | 3,188 | Accepted | Accepted | 10.26 | s = eval(input())
a,b = 0,0
for i in range(len(s)):
if s[i] == '0':
a += 1
else:
b += 1
if a == 0 or b == 0:
print((0))
else:
print((min(a,b)*2)) | s = eval(input())
a,b = 0,0
for i in range(len(s)):
if s[i] == '0':
a += 1
else:
b += 1
print((min(a,b)*2)) | 12 | 9 | 179 | 132 | s = eval(input())
a, b = 0, 0
for i in range(len(s)):
if s[i] == "0":
a += 1
else:
b += 1
if a == 0 or b == 0:
print((0))
else:
print((min(a, b) * 2))
| s = eval(input())
a, b = 0, 0
for i in range(len(s)):
if s[i] == "0":
a += 1
else:
b += 1
print((min(a, b) * 2))
| false | 25 | [
"-if a == 0 or b == 0:",
"- print((0))",
"-else:",
"- print((min(a, b) * 2))",
"+print((min(a, b) * 2))"
] | false | 0.045256 | 0.044595 | 1.014814 | [
"s163504156",
"s561767530"
] |
u623819879 | p03912 | python | s382116036 | s477359171 | 567 | 499 | 81,388 | 76,780 | Accepted | Accepted | 11.99 | from collections import Counter
n,m=list(map(int,input().split()))
x=[int(i) for i in input().split()]
v=[[] for i in range(m)]
for i in x:v[i%m].append(i)
a=0
for i in range(1,m//2+1*(m%2==1)):
x,y=v[i],v[m-i]
d=len(x)-len(y)
if d<0:
d=-d
x,y=y,x
c=sorted(list(Counter(x).items()),key=lambda... | from collections import Counter
n,m=list(map(int,input().split()))
x=[int(i) for i in input().split()]
v=[[] for i in range(m)]
for i in x:v[i%m].append(i)
a=0
for i in range(1,m//2+m%2):
x,y=v[i],v[m-i]
d=len(x)-len(y)
if d<0:
d=-d
x,y=y,x
c=sorted([p[1] for p in list(Counter(x).items())])
... | 19 | 19 | 445 | 433 | from collections import Counter
n, m = list(map(int, input().split()))
x = [int(i) for i in input().split()]
v = [[] for i in range(m)]
for i in x:
v[i % m].append(i)
a = 0
for i in range(1, m // 2 + 1 * (m % 2 == 1)):
x, y = v[i], v[m - i]
d = len(x) - len(y)
if d < 0:
d = -d
x, y = y,... | from collections import Counter
n, m = list(map(int, input().split()))
x = [int(i) for i in input().split()]
v = [[] for i in range(m)]
for i in x:
v[i % m].append(i)
a = 0
for i in range(1, m // 2 + m % 2):
x, y = v[i], v[m - i]
d = len(x) - len(y)
if d < 0:
d = -d
x, y = y, x
c = ... | false | 0 | [
"-for i in range(1, m // 2 + 1 * (m % 2 == 1)):",
"+for i in range(1, m // 2 + m % 2):",
"- c = sorted(list(Counter(x).items()), key=lambda x: x[1])",
"+ c = sorted([p[1] for p in list(Counter(x).items())])",
"- p += t[1] // 2",
"+ p += t // 2"
] | false | 0.051353 | 0.129736 | 0.395825 | [
"s382116036",
"s477359171"
] |
u489959379 | p02792 | python | s867406598 | s112589516 | 376 | 211 | 3,064 | 9,196 | Accepted | Accepted | 43.88 | import sys
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7
def resolve():
n = int(eval(input()))
cnt = [[0] * 10 for _ in range(10)]
for i in range(1, n + 1):
head = int(str(i)[0])
tale = int(str(i)[-1])
cnt[head][ta... | import sys
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7
def resolve():
n = int(eval(input()))
cnt = [[0] * 10 for _ in range(10)]
for i in range(1, n + 1):
i = str(i)
head = int(i[0])
foot = int(i[-1])
cn... | 28 | 29 | 537 | 547 | import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline
f_inf = float("inf")
mod = 10**9 + 7
def resolve():
n = int(eval(input()))
cnt = [[0] * 10 for _ in range(10)]
for i in range(1, n + 1):
head = int(str(i)[0])
tale = int(str(i)[-1])
cnt[head][tale] += 1
res = 0... | import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline
f_inf = float("inf")
mod = 10**9 + 7
def resolve():
n = int(eval(input()))
cnt = [[0] * 10 for _ in range(10)]
for i in range(1, n + 1):
i = str(i)
head = int(i[0])
foot = int(i[-1])
cnt[head][foot] += 1
... | false | 3.448276 | [
"- head = int(str(i)[0])",
"- tale = int(str(i)[-1])",
"- cnt[head][tale] += 1",
"+ i = str(i)",
"+ head = int(i[0])",
"+ foot = int(i[-1])",
"+ cnt[head][foot] += 1",
"- head = int(str(i)[0])",
"- tale = int(str(i)[-1])",
"- re... | false | 0.060488 | 0.057995 | 1.043003 | [
"s867406598",
"s112589516"
] |
u325956328 | p02780 | python | s686875697 | s148672177 | 256 | 225 | 25,572 | 33,996 | Accepted | Accepted | 12.11 | from collections import deque
N, K = list(map(int, input().split()))
p = list(map(int, input().split()))
mx = 0
s = 0
q = deque()
for i in range(N):
p[i] += 1
for i in range(N):
s += p[i]
q.append(p[i])
if len(q) > K:
s -= q.popleft()
if len(q) == K:
mx = max(mx... | import numpy as np
N, K = list(map(int, input().split()))
p = np.array(list(map(int, input().split())))
e = (p + 1) / 2
# print(e)
cum_e = np.zeros(N + 1)
cum_e[1:] = np.cumsum(e)
# print(cum_e)
s = cum_e[K:] - cum_e[:-K]
print((max(s)))
| 22 | 17 | 338 | 253 | from collections import deque
N, K = list(map(int, input().split()))
p = list(map(int, input().split()))
mx = 0
s = 0
q = deque()
for i in range(N):
p[i] += 1
for i in range(N):
s += p[i]
q.append(p[i])
if len(q) > K:
s -= q.popleft()
if len(q) == K:
mx = max(mx, s)
print((mx / 2))
| import numpy as np
N, K = list(map(int, input().split()))
p = np.array(list(map(int, input().split())))
e = (p + 1) / 2
# print(e)
cum_e = np.zeros(N + 1)
cum_e[1:] = np.cumsum(e)
# print(cum_e)
s = cum_e[K:] - cum_e[:-K]
print((max(s)))
| false | 22.727273 | [
"-from collections import deque",
"+import numpy as np",
"-p = list(map(int, input().split()))",
"-mx = 0",
"-s = 0",
"-q = deque()",
"-for i in range(N):",
"- p[i] += 1",
"-for i in range(N):",
"- s += p[i]",
"- q.append(p[i])",
"- if len(q) > K:",
"- s -= q.popleft()",
... | false | 0.034608 | 0.285507 | 0.121215 | [
"s686875697",
"s148672177"
] |
u695079172 | p03797 | python | s239810135 | s133327222 | 177 | 17 | 38,256 | 2,940 | Accepted | Accepted | 90.4 |
n,m=list(map(int,input().split()))
first=min(n,m//2)
n -=first
m-=first*2
second = m//4
print((second+first)) |
def main():
n,m = list(map(int,input().split()))
s = n
c = m
scc = 0
#sを全部使い切る
take = min(s,c//2) #Sの個数とcを2で割った個数。小さい方を選んでSを使い切る
scc += take
s -= take
c -= take * 2
#残ったCでsccを作る(s=cが2個 cc=cが2個 合計4個必要)
take = c // 4
scc += take
print(scc)
if _... | 7 | 22 | 108 | 349 | n, m = list(map(int, input().split()))
first = min(n, m // 2)
n -= first
m -= first * 2
second = m // 4
print((second + first))
| def main():
n, m = list(map(int, input().split()))
s = n
c = m
scc = 0
# sを全部使い切る
take = min(s, c // 2) # Sの個数とcを2で割った個数。小さい方を選んでSを使い切る
scc += take
s -= take
c -= take * 2
# 残ったCでsccを作る(s=cが2個 cc=cが2個 合計4個必要)
take = c // 4
scc += take
print(scc)
if __name__ == "__m... | false | 68.181818 | [
"-n, m = list(map(int, input().split()))",
"-first = min(n, m // 2)",
"-n -= first",
"-m -= first * 2",
"-second = m // 4",
"-print((second + first))",
"+def main():",
"+ n, m = list(map(int, input().split()))",
"+ s = n",
"+ c = m",
"+ scc = 0",
"+ # sを全部使い切る",
"+ take = m... | false | 0.080395 | 0.040308 | 1.994509 | [
"s239810135",
"s133327222"
] |
u903005414 | p03031 | python | s487264810 | s604067530 | 42 | 29 | 3,064 | 3,064 | Accepted | Accepted | 30.95 | N, M = list(map(int, input().split()))
S = []
for _ in range(M):
arr = list(map(int, input().split()))
bit = 0
for i in arr[1:]:
# print(i)
bit = bit | (1 << (i - 1))
# print('bit', bit, bin(bit))
S.append(bit)
# S.append(arr[1:])
P = list(map(int, input().split()))
#... | N, M = list(map(int, input().split()))
S = []
for _ in range(M):
arr = list(map(int, input().split()))
bit = 0
for i in arr[1:]:
bit = bit | (1 << (i - 1))
S.append(bit)
P = list(map(int, input().split()))
ans = 0
for bit in range(1 << N):
for i in range(M):
p = S[i] & ... | 36 | 23 | 915 | 507 | N, M = list(map(int, input().split()))
S = []
for _ in range(M):
arr = list(map(int, input().split()))
bit = 0
for i in arr[1:]:
# print(i)
bit = bit | (1 << (i - 1))
# print('bit', bit, bin(bit))
S.append(bit)
# S.append(arr[1:])
P = list(map(int, input().split()))
# print('S')
... | N, M = list(map(int, input().split()))
S = []
for _ in range(M):
arr = list(map(int, input().split()))
bit = 0
for i in arr[1:]:
bit = bit | (1 << (i - 1))
S.append(bit)
P = list(map(int, input().split()))
ans = 0
for bit in range(1 << N):
for i in range(M):
p = S[i] & bit
on... | false | 36.111111 | [
"- # print(i)",
"- # print('bit', bit, bin(bit))",
"- # S.append(arr[1:])",
"-# print('S')",
"-# print(S)",
"-# print('P', P)",
"- cnt = 0",
"- # print('S[i], bit', bin(S[i]), bin(bit))",
"- # print('p', bin(p))",
"- # print('judge', 1 << j, p & (1 << j))",... | false | 0.047691 | 0.047307 | 1.00813 | [
"s487264810",
"s604067530"
] |
u644907318 | p02848 | python | s356049719 | s607276360 | 218 | 77 | 41,580 | 73,088 | Accepted | Accepted | 64.68 | N = int(eval(input()))
S = input().strip()
x = ""
for i in range(len(S)):
a = ord(S[i])+N
if a<=90:
x += chr(a)
else:
x += chr(a-26)
print(x) | N = int(eval(input()))
S = input().strip()
N = N%26
x = ""
for i in range(len(S)):
k = ord(S[i])
j = (k-65+N)%26+65
x += chr(j)
print(x) | 10 | 9 | 172 | 150 | N = int(eval(input()))
S = input().strip()
x = ""
for i in range(len(S)):
a = ord(S[i]) + N
if a <= 90:
x += chr(a)
else:
x += chr(a - 26)
print(x)
| N = int(eval(input()))
S = input().strip()
N = N % 26
x = ""
for i in range(len(S)):
k = ord(S[i])
j = (k - 65 + N) % 26 + 65
x += chr(j)
print(x)
| false | 10 | [
"+N = N % 26",
"- a = ord(S[i]) + N",
"- if a <= 90:",
"- x += chr(a)",
"- else:",
"- x += chr(a - 26)",
"+ k = ord(S[i])",
"+ j = (k - 65 + N) % 26 + 65",
"+ x += chr(j)"
] | false | 0.085211 | 0.036262 | 2.349848 | [
"s356049719",
"s607276360"
] |
u392319141 | p02868 | python | s868067627 | s032092764 | 1,744 | 901 | 122,964 | 45,484 | Accepted | Accepted | 48.34 | class SegmentTree:
"""
0-indexed
query : [L, R)
"""
def __init__(self, size, initValue, cmpFunc):
self.size = 1 << (size.bit_length()) # 完全二分木にする
self.data = [initValue] * (2 * self.size - 1)
self.initValue = initValue
self.cmpFunc = cmpFunc
def build... | from heapq import heappush, heappop
N, M = list(map(int, input().split()))
edges = [[] for _ in range(N)]
for i in range(1, N):
edges[i].append((i - 1, 0))
for _ in range(M):
l, r, c = list(map(int, input().split()))
l -= 1
r -= 1
edges[l].append((r, c))
que = [(0, 0)]
minDist = [... | 52 | 28 | 1,625 | 627 | class SegmentTree:
"""
0-indexed
query : [L, R)
"""
def __init__(self, size, initValue, cmpFunc):
self.size = 1 << (size.bit_length()) # 完全二分木にする
self.data = [initValue] * (2 * self.size - 1)
self.initValue = initValue
self.cmpFunc = cmpFunc
def build(self, raw... | from heapq import heappush, heappop
N, M = list(map(int, input().split()))
edges = [[] for _ in range(N)]
for i in range(1, N):
edges[i].append((i - 1, 0))
for _ in range(M):
l, r, c = list(map(int, input().split()))
l -= 1
r -= 1
edges[l].append((r, c))
que = [(0, 0)]
minDist = [float("inf")] * N
... | false | 46.153846 | [
"-class SegmentTree:",
"- \"\"\"",
"- 0-indexed",
"- query : [L, R)",
"- \"\"\"",
"-",
"- def __init__(self, size, initValue, cmpFunc):",
"- self.size = 1 << (size.bit_length()) # 完全二分木にする",
"- self.data = [initValue] * (2 * self.size - 1)",
"- self.initValue =... | false | 0.100164 | 0.047513 | 2.108123 | [
"s868067627",
"s032092764"
] |
u243572357 | p03485 | python | s319250955 | s445272507 | 21 | 17 | 3,316 | 2,940 | Accepted | Accepted | 19.05 | a, b = list(map(int, input().split()))
print((-(-(a+b)//2))) | a, b = list(map(int, input().split()))
print((-((-a-b)//2))) | 2 | 2 | 53 | 53 | a, b = list(map(int, input().split()))
print((-(-(a + b) // 2)))
| a, b = list(map(int, input().split()))
print((-((-a - b) // 2)))
| false | 0 | [
"-print((-(-(a + b) // 2)))",
"+print((-((-a - b) // 2)))"
] | false | 0.043778 | 0.043309 | 1.010815 | [
"s319250955",
"s445272507"
] |
u201234972 | p02768 | python | s889365936 | s275076822 | 239 | 156 | 10,868 | 3,064 | Accepted | Accepted | 34.73 | Q = 10**9+7
def getInv(N):
inv = [0] * (N + 1)
inv[1] = 1
for i in range(2, N + 1):
inv[i] = (-(Q // i) * inv[Q % i]) % Q
return inv
def main():
n, a, b = list(map( int, input().split()))
Inv = getInv(2*10**5)
def cmb(n,r):
ret = 1
for i in range(r):... | Q = 10**9+7
def cmb(n,r):
if n-r < r: r = n-r
if r == 0: return 1
denominator = 1 #分母
numerator = 1 #分子
for i in range(r):
numerator *= n-i
numerator %= Q
denominator *= i+1
denominator %= Q
return numerat... | 24 | 19 | 523 | 499 | Q = 10**9 + 7
def getInv(N):
inv = [0] * (N + 1)
inv[1] = 1
for i in range(2, N + 1):
inv[i] = (-(Q // i) * inv[Q % i]) % Q
return inv
def main():
n, a, b = list(map(int, input().split()))
Inv = getInv(2 * 10**5)
def cmb(n, r):
ret = 1
for i in range(r):
... | Q = 10**9 + 7
def cmb(n, r):
if n - r < r:
r = n - r
if r == 0:
return 1
denominator = 1 # 分母
numerator = 1 # 分子
for i in range(r):
numerator *= n - i
numerator %= Q
denominator *= i + 1
denominator %= Q
return numerator * pow(denominator, Q - ... | false | 20.833333 | [
"-def getInv(N):",
"- inv = [0] * (N + 1)",
"- inv[1] = 1",
"- for i in range(2, N + 1):",
"- inv[i] = (-(Q // i) * inv[Q % i]) % Q",
"- return inv",
"+def cmb(n, r):",
"+ if n - r < r:",
"+ r = n - r",
"+ if r == 0:",
"+ return 1",
"+ denominator = 1 ... | false | 0.26546 | 0.113588 | 2.337039 | [
"s889365936",
"s275076822"
] |
u930705402 | p02838 | python | s505239004 | s118664316 | 1,821 | 1,296 | 122,936 | 122,808 | Accepted | Accepted | 28.83 | MOD=10**9+7
N=int(eval(input()))
A=list(map(int,input().split()))
ans=0
for j in range(60):
k=2**j
count=0
for i in range(N):
if(A[i]&k):
ans=(ans+(2**j)*(i-count))%MOD
count+=1
else:
ans=(ans+(2**j)*count)%MOD
print(ans) | MOD=10**9+7
N=int(eval(input()))
A=list(map(int,input().split()))
ans=0
for j in range(60):
k=2**j
count=0
for i in range(N):
if(A[i]&k):
ans=(ans+k*(i-count))%MOD
count+=1
else:
ans=(ans+k*count)%MOD
print(ans) | 14 | 14 | 292 | 282 | MOD = 10**9 + 7
N = int(eval(input()))
A = list(map(int, input().split()))
ans = 0
for j in range(60):
k = 2**j
count = 0
for i in range(N):
if A[i] & k:
ans = (ans + (2**j) * (i - count)) % MOD
count += 1
else:
ans = (ans + (2**j) * count) % MOD
print(ans... | MOD = 10**9 + 7
N = int(eval(input()))
A = list(map(int, input().split()))
ans = 0
for j in range(60):
k = 2**j
count = 0
for i in range(N):
if A[i] & k:
ans = (ans + k * (i - count)) % MOD
count += 1
else:
ans = (ans + k * count) % MOD
print(ans)
| false | 0 | [
"- ans = (ans + (2**j) * (i - count)) % MOD",
"+ ans = (ans + k * (i - count)) % MOD",
"- ans = (ans + (2**j) * count) % MOD",
"+ ans = (ans + k * count) % MOD"
] | false | 0.036169 | 0.035636 | 1.014957 | [
"s505239004",
"s118664316"
] |
u013756322 | p03088 | python | s485154083 | s464334734 | 63 | 56 | 4,468 | 4,468 | Accepted | Accepted | 11.11 | import pprint
n = int(eval(input()))
dp = [{} for i in range(n + 1)]
s = "AGCT"
M = 10 ** 9 + 7
for j in range(n + 1):
for c1 in s:
for c2 in s:
for c3 in s:
dp[j][c1 + c2 + c3] = 0
dp[0]["TTT"] = 1
for l in range(n):
for c1 in s:
for c2 in s:
for c3 in s:
fo... | import pprint
n = int(eval(input()))
dp = [{} for i in range(n + 1)]
s = "AGCT"
M = 10 ** 9 + 7
for j in range(n + 1):
for c1 in s:
for c2 in s:
for c3 in s:
dp[j][c1 + c2 + c3] = 0
dp[0]["TTT"] = 1
for l in range(n):
for c1 in s:
for c2 in s:
for c3 in s:
fo... | 39 | 39 | 940 | 919 | import pprint
n = int(eval(input()))
dp = [{} for i in range(n + 1)]
s = "AGCT"
M = 10**9 + 7
for j in range(n + 1):
for c1 in s:
for c2 in s:
for c3 in s:
dp[j][c1 + c2 + c3] = 0
dp[0]["TTT"] = 1
for l in range(n):
for c1 in s:
for c2 in s:
for c3 in s:
... | import pprint
n = int(eval(input()))
dp = [{} for i in range(n + 1)]
s = "AGCT"
M = 10**9 + 7
for j in range(n + 1):
for c1 in s:
for c2 in s:
for c3 in s:
dp[j][c1 + c2 + c3] = 0
dp[0]["TTT"] = 1
for l in range(n):
for c1 in s:
for c2 in s:
for c3 in s:
... | false | 0 | [
"- dp[l + 1][c2 + c3 + p] += dp[l][c1 + c2 + c3]",
"- dp[l + 1][c2 + c3 + p] = dp[l + 1][c2 + c3 + p] % M",
"+ dp[l + 1][c2 + c3 + p] = (",
"+ dp[l + 1][c2 + c3 + p] + dp[l][c1 + c2 + c3]",
"+ ) % M"
] | false | 0.18277 | 0.00841 | 21.731283 | [
"s485154083",
"s464334734"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.