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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
u747602774 | p03796 | python | s724739949 | s090795883 | 40 | 35 | 2,940 | 2,940 | Accepted | Accepted | 12.5 | N=int(eval(input()))
ans=1
BIG=1000000007
for n in range(1,N+1):
ans=ans*n
ans=ans%BIG
print(ans)
| n = int(eval(input()))
ans = 1
mod = 10**9+7
for i in range(1,n+1):
ans = ans*i%mod
print(ans) | 11 | 6 | 110 | 97 | N = int(eval(input()))
ans = 1
BIG = 1000000007
for n in range(1, N + 1):
ans = ans * n
ans = ans % BIG
print(ans)
| n = int(eval(input()))
ans = 1
mod = 10**9 + 7
for i in range(1, n + 1):
ans = ans * i % mod
print(ans)
| false | 45.454545 | [
"-N = int(eval(input()))",
"+n = int(eval(input()))",
"-BIG = 1000000007",
"-for n in range(1, N + 1):",
"- ans = ans * n",
"- ans = ans % BIG",
"+mod = 10**9 + 7",
"+for i in range(1, n + 1):",
"+ ans = ans * i % mod"
] | false | 0.045688 | 0.046169 | 0.989585 | [
"s724739949",
"s090795883"
] |
u627803856 | p03161 | python | s100272294 | s883903670 | 444 | 204 | 52,448 | 84,888 | Accepted | Accepted | 54.05 | n, k = list(map(int, input().split()))
h = list(map(int, input().split()))
dp = [1 << 30] * n
dp[0] = 0
for i in range(1, n):
mn = 1 << 30
for j in range(1, k + 1):
if i - j < 0:
continue
mn = min(mn, dp[i - j] + abs(h[i] - h[i - j]))
dp[i] = mn
print((dp[-1])) | n, k = list(map(int, input().split()))
h = list(map(int, input().split()))
def chmin(a, b):
if a > b: return b
else: return a
dp = [float('inf')] * (n + k)
dp[0] = 0
for i in range(n):
for j in range(1, k + 1):
if i + j < n:
dp[i + j] = chmin(dp[i + j], dp[i] + abs(h[i] - h... | 14 | 14 | 308 | 341 | n, k = list(map(int, input().split()))
h = list(map(int, input().split()))
dp = [1 << 30] * n
dp[0] = 0
for i in range(1, n):
mn = 1 << 30
for j in range(1, k + 1):
if i - j < 0:
continue
mn = min(mn, dp[i - j] + abs(h[i] - h[i - j]))
dp[i] = mn
print((dp[-1]))
| n, k = list(map(int, input().split()))
h = list(map(int, input().split()))
def chmin(a, b):
if a > b:
return b
else:
return a
dp = [float("inf")] * (n + k)
dp[0] = 0
for i in range(n):
for j in range(1, k + 1):
if i + j < n:
dp[i + j] = chmin(dp[i + j], dp[i] + abs(h[... | false | 0 | [
"-dp = [1 << 30] * n",
"+",
"+",
"+def chmin(a, b):",
"+ if a > b:",
"+ return b",
"+ else:",
"+ return a",
"+",
"+",
"+dp = [float(\"inf\")] * (n + k)",
"-for i in range(1, n):",
"- mn = 1 << 30",
"+for i in range(n):",
"- if i - j < 0:",
"- co... | false | 0.080901 | 0.032694 | 2.474509 | [
"s100272294",
"s883903670"
] |
u504836877 | p02852 | python | s017484477 | s069003644 | 160 | 91 | 11,932 | 87,784 | Accepted | Accepted | 43.12 | N,M = list(map(int ,input().split()))
S = eval(input())
ans = []
i = N
while i > 0:
prev = i
for j in range(max(0, i-M), i):
if S[j] == "0":
ans.append(str(i-j))
i = j
break
if i == prev:
ans = -1
break
if ans == -1:
print(an... | N,M = list(map(int, input().split()))
S = list(eval(input()))
S.reverse()
ans = []
i = 0
while i < N:
num = 0
for j in range(min(N, i+M), i, -1):
if S[j] == "0":
num = j-i
i = j
break
if num == 0:
ans = -1
break
ans.append(num)... | 21 | 23 | 353 | 384 | N, M = list(map(int, input().split()))
S = eval(input())
ans = []
i = N
while i > 0:
prev = i
for j in range(max(0, i - M), i):
if S[j] == "0":
ans.append(str(i - j))
i = j
break
if i == prev:
ans = -1
break
if ans == -1:
print(ans)
else:
a... | N, M = list(map(int, input().split()))
S = list(eval(input()))
S.reverse()
ans = []
i = 0
while i < N:
num = 0
for j in range(min(N, i + M), i, -1):
if S[j] == "0":
num = j - i
i = j
break
if num == 0:
ans = -1
break
ans.append(num)
if ans == -... | false | 8.695652 | [
"-S = eval(input())",
"+S = list(eval(input()))",
"+S.reverse()",
"-i = N",
"-while i > 0:",
"- prev = i",
"- for j in range(max(0, i - M), i):",
"+i = 0",
"+while i < N:",
"+ num = 0",
"+ for j in range(min(N, i + M), i, -1):",
"- ans.append(str(i - j))",
"+ ... | false | 0.048637 | 0.050539 | 0.962368 | [
"s017484477",
"s069003644"
] |
u753803401 | p03338 | python | s163029558 | s527939671 | 231 | 210 | 44,652 | 39,664 | Accepted | Accepted | 9.09 | def slove():
import sys
import collections
input = sys.stdin.readline
n = int(input().rstrip('\n'))
s = str(input().rstrip('\n'))
m_cnt = 0
for i in range(1, n):
t1 = s[:i]
t2 = s[i:]
t1 = collections.Counter(t1)
t2 = collections.Counter(t2)
... | def slove():
import sys
import collections
input = sys.stdin.readline
n = int(input().rstrip('\n'))
s = str(input().rstrip('\n'))
mc = 0
for i in range(1, n):
cnt = 0
ts1 = list(dict(collections.Counter(s[:i]).most_common()).keys())
ts2 = list(dict(collectio... | 21 | 20 | 493 | 512 | def slove():
import sys
import collections
input = sys.stdin.readline
n = int(input().rstrip("\n"))
s = str(input().rstrip("\n"))
m_cnt = 0
for i in range(1, n):
t1 = s[:i]
t2 = s[i:]
t1 = collections.Counter(t1)
t2 = collections.Counter(t2)
cnt = 0
... | def slove():
import sys
import collections
input = sys.stdin.readline
n = int(input().rstrip("\n"))
s = str(input().rstrip("\n"))
mc = 0
for i in range(1, n):
cnt = 0
ts1 = list(dict(collections.Counter(s[:i]).most_common()).keys())
ts2 = list(dict(collections.Counte... | false | 4.761905 | [
"- m_cnt = 0",
"+ mc = 0",
"- t1 = s[:i]",
"- t2 = s[i:]",
"- t1 = collections.Counter(t1)",
"- t2 = collections.Counter(t2)",
"- for k, v in list(t1.items()):",
"- cnt += min(1, t2[k])",
"- m_cnt = max(m_cnt, cnt)",
"- print(m_cnt)",
... | false | 0.112526 | 0.047351 | 2.376415 | [
"s163029558",
"s527939671"
] |
u888092736 | p02947 | python | s175850918 | s574832407 | 557 | 406 | 22,500 | 22,372 | Accepted | Accepted | 27.11 | from collections import defaultdict
N = int(eval(input()))
dic = defaultdict(int)
ans = 0
for _ in range(N):
elem = str(sorted(eval(input())))
ans += dic[elem]
dic[elem] += 1
print(ans)
| import sys
from collections import defaultdict
def input():
return sys.stdin.readline().strip()
N = int(eval(input()))
dic = defaultdict(int)
ans = 0
for _ in range(N):
elem = str(sorted(eval(input())))
ans += dic[elem]
dic[elem] += 1
print(ans)
| 11 | 16 | 198 | 269 | from collections import defaultdict
N = int(eval(input()))
dic = defaultdict(int)
ans = 0
for _ in range(N):
elem = str(sorted(eval(input())))
ans += dic[elem]
dic[elem] += 1
print(ans)
| import sys
from collections import defaultdict
def input():
return sys.stdin.readline().strip()
N = int(eval(input()))
dic = defaultdict(int)
ans = 0
for _ in range(N):
elem = str(sorted(eval(input())))
ans += dic[elem]
dic[elem] += 1
print(ans)
| false | 31.25 | [
"+import sys",
"+",
"+",
"+def input():",
"+ return sys.stdin.readline().strip()",
"+"
] | false | 0.035775 | 0.034791 | 1.02828 | [
"s175850918",
"s574832407"
] |
u627434558 | p02957 | python | s425732903 | s720704144 | 19 | 17 | 3,060 | 2,940 | Accepted | Accepted | 10.53 | a, b = list(map(int, input().split()))
diff = a - b
if diff < 0:
diff *= -1
if (diff % 2) == 0:
ans = int(max(a-(diff/2), b-(diff/2)))
print(ans)
else:
print('IMPOSSIBLE')
| a, b = list(map(int, input().split()))
if (a+b) % 2 == 0:
print(((a+b)//2))
else:
print('IMPOSSIBLE')
| 9 | 5 | 190 | 106 | a, b = list(map(int, input().split()))
diff = a - b
if diff < 0:
diff *= -1
if (diff % 2) == 0:
ans = int(max(a - (diff / 2), b - (diff / 2)))
print(ans)
else:
print("IMPOSSIBLE")
| a, b = list(map(int, input().split()))
if (a + b) % 2 == 0:
print(((a + b) // 2))
else:
print("IMPOSSIBLE")
| false | 44.444444 | [
"-diff = a - b",
"-if diff < 0:",
"- diff *= -1",
"-if (diff % 2) == 0:",
"- ans = int(max(a - (diff / 2), b - (diff / 2)))",
"- print(ans)",
"+if (a + b) % 2 == 0:",
"+ print(((a + b) // 2))"
] | false | 0.070306 | 0.06921 | 1.015829 | [
"s425732903",
"s720704144"
] |
u716529032 | p03557 | python | s631227626 | s237933781 | 365 | 306 | 27,428 | 22,848 | Accepted | Accepted | 16.16 | from bisect import bisect_right
N = int(eval(input()))
A = sorted(list(map(int, input().split())))
B = sorted(list(map(int, input().split())))
C = sorted(list(map(int, input().split())))
ca = [0] * N
cb = [0] * N
for i in range(N):
ca[i] = bisect_right(B, A[i])
cb[i] = N - bisect_right(C, B[i])
cb... | from bisect import bisect_right, bisect_left
N = int(eval(input()))
A = sorted(list(map(int, input().split())))
B = sorted(list(map(int, input().split())))
C = sorted(list(map(int, input().split())))
ans = 0
for b in B:
ans += bisect_left(A, b) * (N - bisect_right(C, b))
print(ans) | 19 | 12 | 406 | 292 | from bisect import bisect_right
N = int(eval(input()))
A = sorted(list(map(int, input().split())))
B = sorted(list(map(int, input().split())))
C = sorted(list(map(int, input().split())))
ca = [0] * N
cb = [0] * N
for i in range(N):
ca[i] = bisect_right(B, A[i])
cb[i] = N - bisect_right(C, B[i])
cb.append(0)
fo... | from bisect import bisect_right, bisect_left
N = int(eval(input()))
A = sorted(list(map(int, input().split())))
B = sorted(list(map(int, input().split())))
C = sorted(list(map(int, input().split())))
ans = 0
for b in B:
ans += bisect_left(A, b) * (N - bisect_right(C, b))
print(ans)
| false | 36.842105 | [
"-from bisect import bisect_right",
"+from bisect import bisect_right, bisect_left",
"-ca = [0] * N",
"-cb = [0] * N",
"-for i in range(N):",
"- ca[i] = bisect_right(B, A[i])",
"- cb[i] = N - bisect_right(C, B[i])",
"-cb.append(0)",
"-for i in range(N, 0, -1):",
"- cb[i - 1] += cb[i]",
... | false | 0.127785 | 0.049737 | 2.569231 | [
"s631227626",
"s237933781"
] |
u188827677 | p02819 | python | s530087671 | s689610974 | 235 | 207 | 10,868 | 10,868 | Accepted | Accepted | 11.91 | from math import sqrt
N = 10 ** 6
p = [True] * (N + 1)
p[0] = False
p[1] = False
n = int(sqrt(N) + 1)
for i in range(4, N+1, 2):
p[i] = False
for j in range(3, n+1, 2):
if p[j]:
for k in range(j+j, N+1, j):
p[k] = False
x = int(eval(input()))
for l in range(x, N+1):
if p[l]:
pri... | import math
x = int(eval(input()))
a = 10 ** 6
b = int(math.sqrt(a)+1)
p = [True]*(a+1)
p[0] = False
p[1] = False
for i in range(4, a+1, 2):
p[i] = False
for i in range(3, b+1, 2):
if p[i]:
for j in range(i+i, a+1, i):
p[j] = False
for i in range(x, a+1):
if p[i]:
print(i)
... | 20 | 21 | 330 | 323 | from math import sqrt
N = 10**6
p = [True] * (N + 1)
p[0] = False
p[1] = False
n = int(sqrt(N) + 1)
for i in range(4, N + 1, 2):
p[i] = False
for j in range(3, n + 1, 2):
if p[j]:
for k in range(j + j, N + 1, j):
p[k] = False
x = int(eval(input()))
for l in range(x, N + 1):
if p[l]:
... | import math
x = int(eval(input()))
a = 10**6
b = int(math.sqrt(a) + 1)
p = [True] * (a + 1)
p[0] = False
p[1] = False
for i in range(4, a + 1, 2):
p[i] = False
for i in range(3, b + 1, 2):
if p[i]:
for j in range(i + i, a + 1, i):
p[j] = False
for i in range(x, a + 1):
if p[i]:
... | false | 4.761905 | [
"-from math import sqrt",
"+import math",
"-N = 10**6",
"-p = [True] * (N + 1)",
"+x = int(eval(input()))",
"+a = 10**6",
"+b = int(math.sqrt(a) + 1)",
"+p = [True] * (a + 1)",
"-n = int(sqrt(N) + 1)",
"-for i in range(4, N + 1, 2):",
"+for i in range(4, a + 1, 2):",
"-for j in range(3, n + 1,... | false | 0.563178 | 0.621304 | 0.906445 | [
"s530087671",
"s689610974"
] |
u189806337 | p03475 | python | s993313504 | s441507381 | 77 | 71 | 9,184 | 9,100 | Accepted | Accepted | 7.79 | n = int(eval(input()))
T = [0]*n
c,s,f = [0]*(n-1),[0]*(n-1),[0]*(n-1)
for i in range(n-1):
c[i],s[i],f[i] = list(map(int,input().split()))
for i in range(n-1):
T[i] = s[i] + c[i]
for j in range(i+1,n-1):
if T[i] > s[j]:
T[i] = -((-T[i]//f[j]))*f[j] + c[j]
else:
T[i] = s[j] + c[j]
print((... | n = int(eval(input()))
T = [0]*n
c,s,f = [0]*(n-1),[0]*(n-1),[0]*(n-1)
for i in range(n-1):
c[i],s[i],f[i] = list(map(int,input().split()))
for i in range(n-1):
T[i] = s[i] + c[i]
for j in range(i+1,n-1):
if T[i] > s[j]:
T[i] += (-T[i])%f[j] + c[j]
else:
T[i] = s[j] + c[j]
print((T[i]))
... | 16 | 16 | 322 | 314 | n = int(eval(input()))
T = [0] * n
c, s, f = [0] * (n - 1), [0] * (n - 1), [0] * (n - 1)
for i in range(n - 1):
c[i], s[i], f[i] = list(map(int, input().split()))
for i in range(n - 1):
T[i] = s[i] + c[i]
for j in range(i + 1, n - 1):
if T[i] > s[j]:
T[i] = -((-T[i] // f[j])) * f[j] + c[... | n = int(eval(input()))
T = [0] * n
c, s, f = [0] * (n - 1), [0] * (n - 1), [0] * (n - 1)
for i in range(n - 1):
c[i], s[i], f[i] = list(map(int, input().split()))
for i in range(n - 1):
T[i] = s[i] + c[i]
for j in range(i + 1, n - 1):
if T[i] > s[j]:
T[i] += (-T[i]) % f[j] + c[j]
... | false | 0 | [
"- T[i] = -((-T[i] // f[j])) * f[j] + c[j]",
"+ T[i] += (-T[i]) % f[j] + c[j]"
] | false | 0.044724 | 0.127611 | 0.350468 | [
"s993313504",
"s441507381"
] |
u183754334 | p03478 | python | s668223164 | s208572052 | 34 | 29 | 3,292 | 3,064 | Accepted | Accepted | 14.71 | # coding: utf-8
"""this is python work script"""
def solve(N, A, B):
LIST_RESULT = []
for i in range(1, N + 1):
str_i = str(i)
l = len(str_i)
sum_tmp = 0
for x in range(l):
sum_tmp += int(str_i[x])
if A <= sum_tmp and sum_tmp <= B:
LIS... | # coding: utf-8
"""this is python work script"""
def sum_num(i):
sum_tmp = 0
p = i
for _ in range(5):
p, mod = divmod(p, 10)
sum_tmp += mod
if p == 0:
break
return sum_tmp
def solve(N, num_min, num_max):
"""solve problem"""
result = 0
for i ... | 23 | 28 | 561 | 631 | # coding: utf-8
"""this is python work script"""
def solve(N, A, B):
LIST_RESULT = []
for i in range(1, N + 1):
str_i = str(i)
l = len(str_i)
sum_tmp = 0
for x in range(l):
sum_tmp += int(str_i[x])
if A <= sum_tmp and sum_tmp <= B:
LIST_RESULT.ap... | # coding: utf-8
"""this is python work script"""
def sum_num(i):
sum_tmp = 0
p = i
for _ in range(5):
p, mod = divmod(p, 10)
sum_tmp += mod
if p == 0:
break
return sum_tmp
def solve(N, num_min, num_max):
"""solve problem"""
result = 0
for i in range(1,... | false | 17.857143 | [
"-def solve(N, A, B):",
"- LIST_RESULT = []",
"+def sum_num(i):",
"+ sum_tmp = 0",
"+ p = i",
"+ for _ in range(5):",
"+ p, mod = divmod(p, 10)",
"+ sum_tmp += mod",
"+ if p == 0:",
"+ break",
"+ return sum_tmp",
"+",
"+",
"+def solve(N, num_m... | false | 0.045753 | 0.045574 | 1.003918 | [
"s668223164",
"s208572052"
] |
u014333473 | p03943 | python | s176424872 | s837669883 | 26 | 23 | 9,160 | 9,088 | Accepted | Accepted | 11.54 | a,b,c=list(map(int,input().split()));print((['No','Yes'][max(a,b,c)==((a+b+c)-max(a,b,c))])) | a,b,c=list(map(int,input().split()))
print(('NYoe s'[a+b==c or a+c==b or a==b+c::2])) | 1 | 2 | 84 | 78 | a, b, c = list(map(int, input().split()))
print((["No", "Yes"][max(a, b, c) == ((a + b + c) - max(a, b, c))]))
| a, b, c = list(map(int, input().split()))
print(("NYoe s"[a + b == c or a + c == b or a == b + c :: 2]))
| false | 50 | [
"-print(([\"No\", \"Yes\"][max(a, b, c) == ((a + b + c) - max(a, b, c))]))",
"+print((\"NYoe s\"[a + b == c or a + c == b or a == b + c :: 2]))"
] | false | 0.042951 | 0.044526 | 0.96463 | [
"s176424872",
"s837669883"
] |
u657913472 | p03460 | python | s046106139 | s872332014 | 998 | 660 | 153,076 | 167,408 | Accepted | Accepted | 33.87 | from numpy import*;N,K=list(map(int,input().split()));m,L,o=zeros((3*K,3*K)),2*K,0
for _ in[0]*N:x,y,c=input().split();t=c=='W';m[int(x)%L,int(y)%L]+=2*t-1;o+=t
for _ in[0,0]:m[L:]=m[:K];m=cumsum(m,0);m[:L]-=m[K:];m=m.T
m=m[:L,:L];print((o-int((m+roll(roll(m,K,0),K,1)).min()))) | from numpy import*;N,K=list(map(int,input().split()));m,L,o=zeros((3*K,3*K)),2*K,0
for _ in[0]*N:x,y,c=input().split();t=c=='W';m[int(x)%L,int(y)%L]+=2*t-1;o+=t
for _ in"00":m[L:]=m[:K];m=cumsum(m,0);m[:L]-=m[K:];m=m.T
m=m[:L,:L];print((o-int((m+roll(roll(m,K,0),K,1)).min()))) | 4 | 4 | 273 | 272 | from numpy import *
N, K = list(map(int, input().split()))
m, L, o = zeros((3 * K, 3 * K)), 2 * K, 0
for _ in [0] * N:
x, y, c = input().split()
t = c == "W"
m[int(x) % L, int(y) % L] += 2 * t - 1
o += t
for _ in [0, 0]:
m[L:] = m[:K]
m = cumsum(m, 0)
m[:L] -= m[K:]
m = m.T
m = m[:L, :L... | from numpy import *
N, K = list(map(int, input().split()))
m, L, o = zeros((3 * K, 3 * K)), 2 * K, 0
for _ in [0] * N:
x, y, c = input().split()
t = c == "W"
m[int(x) % L, int(y) % L] += 2 * t - 1
o += t
for _ in "00":
m[L:] = m[:K]
m = cumsum(m, 0)
m[:L] -= m[K:]
m = m.T
m = m[:L, :L]
... | false | 0 | [
"-for _ in [0, 0]:",
"+for _ in \"00\":"
] | false | 0.186924 | 0.473776 | 0.394541 | [
"s046106139",
"s872332014"
] |
u645250356 | p03018 | python | s785356845 | s443665846 | 113 | 99 | 5,592 | 10,604 | Accepted | Accepted | 12.39 | from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
... | from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,fractions
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
s = ... | 26 | 28 | 655 | 652 | from collections import Counter, defaultdict, deque
from heapq import heappop, heappush, heapify
import sys, bisect, math, itertools, fractions, pprint
sys.setrecursionlimit(10**8)
mod = 10**9 + 7
INF = float("inf")
def inp():
return int(sys.stdin.readline())
def inpl():
return list(map(int, sys.stdin.read... | from collections import Counter, defaultdict, deque
from heapq import heappop, heappush, heapify
import sys, bisect, math, itertools, fractions
sys.setrecursionlimit(10**8)
mod = 10**9 + 7
INF = float("inf")
def inp():
return int(sys.stdin.readline())
def inpl():
return list(map(int, sys.stdin.readline().s... | false | 7.142857 | [
"-import sys, bisect, math, itertools, fractions, pprint",
"+import sys, bisect, math, itertools, fractions",
"-def inpln(n):",
"- return list(int(sys.stdin.readline()) for i in range(n))",
"-",
"-",
"+ind = n - 1",
"+cnt = 0",
"-bc = 0",
"-i = n - 1",
"-while i >= 0:",
"- if s[i] == \"A... | false | 0.048216 | 0.044885 | 1.074214 | [
"s785356845",
"s443665846"
] |
u528748570 | p02779 | python | s575042486 | s281611664 | 87 | 60 | 26,808 | 31,156 | Accepted | Accepted | 31.03 | def has_duplicates(seq):
return len(seq) != len(set(seq))
N = int(eval(input()))
A = list(map(int, input().split()))
if has_duplicates(A):
print("NO")
else:
print("YES")
| N = eval(input())
A = input().split()
n = len(A)
n_temp = len(set(A))
if n != n_temp:
print("NO")
else:
print("YES")
| 10 | 9 | 187 | 124 | def has_duplicates(seq):
return len(seq) != len(set(seq))
N = int(eval(input()))
A = list(map(int, input().split()))
if has_duplicates(A):
print("NO")
else:
print("YES")
| N = eval(input())
A = input().split()
n = len(A)
n_temp = len(set(A))
if n != n_temp:
print("NO")
else:
print("YES")
| false | 10 | [
"-def has_duplicates(seq):",
"- return len(seq) != len(set(seq))",
"-",
"-",
"-N = int(eval(input()))",
"-A = list(map(int, input().split()))",
"-if has_duplicates(A):",
"+N = eval(input())",
"+A = input().split()",
"+n = len(A)",
"+n_temp = len(set(A))",
"+if n != n_temp:"
] | false | 0.041462 | 0.042105 | 0.984726 | [
"s575042486",
"s281611664"
] |
u314906167 | p03474 | python | s249836179 | s736954489 | 20 | 17 | 2,940 | 2,940 | Accepted | Accepted | 15 | A, B = list(map(int, input().split()))
S = eval(input())
nums = ("0", "1", "2", "3", "4", "5", "6", "7", "8", "9")
isvalid = all(c in nums for c in S[:A] + S[-B:]) and S[A] == "-"
print(("Yes" if isvalid else "No"))
| A, B = list(map(int, input().split()))
S = eval(input())
isvalid = all("0" <= c <= "9" for c in S[:A] + S[-B:]) and S[A] == "-"
print(("Yes" if isvalid else "No"))
| 5 | 4 | 206 | 153 | A, B = list(map(int, input().split()))
S = eval(input())
nums = ("0", "1", "2", "3", "4", "5", "6", "7", "8", "9")
isvalid = all(c in nums for c in S[:A] + S[-B:]) and S[A] == "-"
print(("Yes" if isvalid else "No"))
| A, B = list(map(int, input().split()))
S = eval(input())
isvalid = all("0" <= c <= "9" for c in S[:A] + S[-B:]) and S[A] == "-"
print(("Yes" if isvalid else "No"))
| false | 20 | [
"-nums = (\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\")",
"-isvalid = all(c in nums for c in S[:A] + S[-B:]) and S[A] == \"-\"",
"+isvalid = all(\"0\" <= c <= \"9\" for c in S[:A] + S[-B:]) and S[A] == \"-\""
] | false | 0.043461 | 0.043323 | 1.003202 | [
"s249836179",
"s736954489"
] |
u895515293 | p03488 | python | s857294534 | s564041946 | 1,709 | 565 | 111,484 | 166,364 | Accepted | Accepted | 66.94 | import sys
sys.setrecursionlimit(10**7)
INTMAX = 9223372036854775807
INTMIN = -9223372036854775808
MOD = 1000000007
def POW(x, y): return pow(x, y, MOD)
def INV(x, m=MOD): return pow(x, m - 2, m)
def DIV(x, y, m=MOD): return (x * INV(y, m)) % m
def LI(): return [int(x) for x in input().split()]
def LF(): retur... | import sys
sys.setrecursionlimit(10**7)
INTMAX = 9223372036854775807
INTMIN = -9223372036854775808
MOD = 1000000007
def POW(x, y): return pow(x, y, MOD)
def INV(x, m=MOD): return pow(x, m - 2, m)
def DIV(x, y, m=MOD): return (x * INV(y, m)) % m
def LI(): return [int(x) for x in input().split()]
def LF(): retur... | 75 | 63 | 1,626 | 1,510 | import sys
sys.setrecursionlimit(10**7)
INTMAX = 9223372036854775807
INTMIN = -9223372036854775808
MOD = 1000000007
def POW(x, y):
return pow(x, y, MOD)
def INV(x, m=MOD):
return pow(x, m - 2, m)
def DIV(x, y, m=MOD):
return (x * INV(y, m)) % m
def LI():
return [int(x) for x in input().split()]... | import sys
sys.setrecursionlimit(10**7)
INTMAX = 9223372036854775807
INTMIN = -9223372036854775808
MOD = 1000000007
def POW(x, y):
return pow(x, y, MOD)
def INV(x, m=MOD):
return pow(x, m - 2, m)
def DIV(x, y, m=MOD):
return (x * INV(y, m)) % m
def LI():
return [int(x) for x in input().split()]... | false | 16 | [
"-X = abs(X)",
"-Y = abs(Y)",
"-xs.sort()",
"-ys.sort()",
"-xss = [0]",
"-yss = [0]",
"-for i in xs:",
"- xss.append(xss[-1] + i)",
"-for i in ys:",
"- yss.append(yss[-1] + i)",
"-memo1 = {}",
"-",
"-",
"-def dp1(x, i):",
"- if abs(x) > xss[i + 1]:",
"- return False",
... | false | 0.0571 | 0.039854 | 1.432724 | [
"s857294534",
"s564041946"
] |
u753803401 | p02948 | python | s014176209 | s880029631 | 810 | 741 | 75,484 | 68,316 | Accepted | Accepted | 8.52 | import sys
import heapq
def solve():
input = sys.stdin.readline
mod = 10 ** 9 + 7
n, m = list(map(int, input().rstrip('\n').split()))
ab = [list(map(int, input().rstrip('\n').split())) for _ in range(n)]
ab.sort(reverse=True)
ls = []
heapq.heapify(ls)
t = 0
for i in ra... | import sys
import collections
import heapq
def solve():
readline = sys.stdin.buffer.readline
mod = 10 ** 9 + 7
n, m = list(map(int, readline().split()))
ab = [list(map(int, readline().split())) for _ in range(n)]
ab.sort()
ab = collections.deque(ab)
hq = []
heapq.heapify(h... | 29 | 31 | 689 | 725 | import sys
import heapq
def solve():
input = sys.stdin.readline
mod = 10**9 + 7
n, m = list(map(int, input().rstrip("\n").split()))
ab = [list(map(int, input().rstrip("\n").split())) for _ in range(n)]
ab.sort(reverse=True)
ls = []
heapq.heapify(ls)
t = 0
for i in range(1, m + 1):
... | import sys
import collections
import heapq
def solve():
readline = sys.stdin.buffer.readline
mod = 10**9 + 7
n, m = list(map(int, readline().split()))
ab = [list(map(int, readline().split())) for _ in range(n)]
ab.sort()
ab = collections.deque(ab)
hq = []
heapq.heapify(hq)
t = 0
... | false | 6.451613 | [
"+import collections",
"- input = sys.stdin.readline",
"+ readline = sys.stdin.buffer.readline",
"- n, m = list(map(int, input().rstrip(\"\\n\").split()))",
"- ab = [list(map(int, input().rstrip(\"\\n\").split())) for _ in range(n)]",
"- ab.sort(reverse=True)",
"- ls = []",
"- hea... | false | 0.037255 | 0.034124 | 1.091742 | [
"s014176209",
"s880029631"
] |
u827448139 | p01712 | python | s362114055 | s281195424 | 1,280 | 1,140 | 68,816 | 34,820 | Accepted | Accepted | 10.94 | def read():
return list(map(int,input().split()))
while 1:
try:
n,w,h=read()
bases=[(0,0,0)]*n
for i in range(n):
bases[i]=read()
except: break
res1=True
ls,rs=list(zip(*sorted([(x-w,x+w) for x,y,w in bases],key=lambda lr:lr[0])))
x=0
for l,r in zip(ls,rs):
res1&=l... | def read():
return list(map(int,input().split()))
def ok(width,xs,ws):
x=0
for l,r in sorted((x-w,x+w) for x,w in zip(xs,ws)):
if x<l: return False
x=max(x,r)
return width<=x
while 1:
try:
n,w,h=read()
xs,ys,ws=([0]*n for _ in range(3))
for i in range(n):
xs[i],ys[i]... | 28 | 18 | 563 | 406 | def read():
return list(map(int, input().split()))
while 1:
try:
n, w, h = read()
bases = [(0, 0, 0)] * n
for i in range(n):
bases[i] = read()
except:
break
res1 = True
ls, rs = list(
zip(*sorted([(x - w, x + w) for x, y, w in bases], key=lambda ... | def read():
return list(map(int, input().split()))
def ok(width, xs, ws):
x = 0
for l, r in sorted((x - w, x + w) for x, w in zip(xs, ws)):
if x < l:
return False
x = max(x, r)
return width <= x
while 1:
try:
n, w, h = read()
xs, ys, ws = ([0] * n for ... | false | 35.714286 | [
"+",
"+",
"+def ok(width, xs, ws):",
"+ x = 0",
"+ for l, r in sorted((x - w, x + w) for x, w in zip(xs, ws)):",
"+ if x < l:",
"+ return False",
"+ x = max(x, r)",
"+ return width <= x",
"- bases = [(0, 0, 0)] * n",
"+ xs, ys, ws = ([0] * n for _ ... | false | 0.039181 | 0.105797 | 0.37034 | [
"s362114055",
"s281195424"
] |
u123849536 | p02675 | python | s199478819 | s166737943 | 21 | 19 | 9,100 | 9,172 | Accepted | Accepted | 9.52 | n = eval(input())
#print(n[len(n) - 1])
if n[len(n) - 1] in ['2','4','5','7','9']:
print('hon')
elif n[len(n) - 1] in ['0','1','6','8']:
print('pon')
else:
print('bon')
| n = int(eval(input())) % 10
if n in [2, 4, 5, 7, 9]:
print('hon')
elif n in [0, 1, 6, 8]:
print('pon')
else:
print('bon') | 8 | 7 | 176 | 127 | n = eval(input())
# print(n[len(n) - 1])
if n[len(n) - 1] in ["2", "4", "5", "7", "9"]:
print("hon")
elif n[len(n) - 1] in ["0", "1", "6", "8"]:
print("pon")
else:
print("bon")
| n = int(eval(input())) % 10
if n in [2, 4, 5, 7, 9]:
print("hon")
elif n in [0, 1, 6, 8]:
print("pon")
else:
print("bon")
| false | 12.5 | [
"-n = eval(input())",
"-# print(n[len(n) - 1])",
"-if n[len(n) - 1] in [\"2\", \"4\", \"5\", \"7\", \"9\"]:",
"+n = int(eval(input())) % 10",
"+if n in [2, 4, 5, 7, 9]:",
"-elif n[len(n) - 1] in [\"0\", \"1\", \"6\", \"8\"]:",
"+elif n in [0, 1, 6, 8]:"
] | false | 0.037254 | 0.036714 | 1.01469 | [
"s199478819",
"s166737943"
] |
u604774382 | p02396 | python | s005835572 | s365406536 | 40 | 30 | 4,192 | 4,188 | Accepted | Accepted | 25 | import sys
i=1
while True:
x = int( sys.stdin.readline() )
if 0 != x:
print(( "Case {}: {}".format( i, x) ))
else:
break
i += 1 | import sys
i=1
while True:
x = sys.stdin.readline().rstrip()
if "0" != x:
print(( "Case {}: {}".format( i, x) ))
else:
break
i += 1 | 10 | 10 | 143 | 172 | import sys
i = 1
while True:
x = int(sys.stdin.readline())
if 0 != x:
print(("Case {}: {}".format(i, x)))
else:
break
i += 1
| import sys
i = 1
while True:
x = sys.stdin.readline().rstrip()
if "0" != x:
print(("Case {}: {}".format(i, x)))
else:
break
i += 1
| false | 0 | [
"- x = int(sys.stdin.readline())",
"- if 0 != x:",
"+ x = sys.stdin.readline().rstrip()",
"+ if \"0\" != x:"
] | false | 0.035209 | 0.044699 | 0.787687 | [
"s005835572",
"s365406536"
] |
u285443936 | p02948 | python | s339064155 | s663891847 | 710 | 589 | 27,888 | 28,064 | Accepted | Accepted | 17.04 | from heapq import heappop, heappush
N, M = list(map(int, input().split()))
W = []
for i in range(N):
a = list(map(int, input().split()))
heappush(W, a)
ans = 0
C = []
for i in range(1,M+1):
j = -i
while W != [] and W[0][0] <= i:
a,b = heappop(W)
heappush(C,-b)
if C != []:
ans... | from heapq import heappop, heappush
import sys
input = sys.stdin.readline
N, M = list(map(int, input().split()))
W = []
for i in range(N):
a = list(map(int, input().split()))
heappush(W, a)
ans = 0
C = []
for i in range(1,M+1):
j = -i
while W != [] and W[0][0] <= i:
a,b = heappop(W)
... | 19 | 21 | 341 | 381 | from heapq import heappop, heappush
N, M = list(map(int, input().split()))
W = []
for i in range(N):
a = list(map(int, input().split()))
heappush(W, a)
ans = 0
C = []
for i in range(1, M + 1):
j = -i
while W != [] and W[0][0] <= i:
a, b = heappop(W)
heappush(C, -b)
if C != []:
... | from heapq import heappop, heappush
import sys
input = sys.stdin.readline
N, M = list(map(int, input().split()))
W = []
for i in range(N):
a = list(map(int, input().split()))
heappush(W, a)
ans = 0
C = []
for i in range(1, M + 1):
j = -i
while W != [] and W[0][0] <= i:
a, b = heappop(W)
... | false | 9.52381 | [
"+import sys",
"+input = sys.stdin.readline"
] | false | 0.041315 | 0.040163 | 1.02868 | [
"s339064155",
"s663891847"
] |
u690536347 | p02856 | python | s842389556 | s037288082 | 864 | 249 | 44,376 | 3,060 | Accepted | Accepted | 71.18 | M = int(eval(input()))
ans, s = 0, 0
for _ in range(M):
d, c = list(map(int, input().split()))
s += d*c
ans += c
ans += (s-1)//9 - 1
print(ans)
| import sys
input=sys.stdin.readline
def solve():
M = int(eval(input()))
ans, s = 0, 0
for _ in range(M):
d, c = list(map(int, input().split()))
s += d*c
ans += c
ans += (s-1)//9 - 1
print(ans)
solve()
| 10 | 17 | 155 | 254 | M = int(eval(input()))
ans, s = 0, 0
for _ in range(M):
d, c = list(map(int, input().split()))
s += d * c
ans += c
ans += (s - 1) // 9 - 1
print(ans)
| import sys
input = sys.stdin.readline
def solve():
M = int(eval(input()))
ans, s = 0, 0
for _ in range(M):
d, c = list(map(int, input().split()))
s += d * c
ans += c
ans += (s - 1) // 9 - 1
print(ans)
solve()
| false | 41.176471 | [
"-M = int(eval(input()))",
"-ans, s = 0, 0",
"-for _ in range(M):",
"- d, c = list(map(int, input().split()))",
"- s += d * c",
"- ans += c",
"-ans += (s - 1) // 9 - 1",
"-print(ans)",
"+import sys",
"+",
"+input = sys.stdin.readline",
"+",
"+",
"+def solve():",
"+ M = int(ev... | false | 0.07607 | 0.036843 | 2.06472 | [
"s842389556",
"s037288082"
] |
u952491523 | p02726 | python | s718892140 | s855202988 | 1,631 | 391 | 84,184 | 80,348 | Accepted | Accepted | 76.03 | n,x,y = list(map(int,input().split()))
x -= 1
y -= 1
array1 = [0] * n
array2 = [0] * n
for i in range(x, y+1):
array1[i] = min(i-x, y-i+1)
array2[i] = min(i-x+1, y-i)
ans = [0] * (n+1)
dis = [[0 for i in range(n)] for i in range(n)]
for i in range(n):
if i <= x:
for j in range(i+1,n):
... | n,x,y = list(map(int,input().split()))
x -= 1
y -= 1
array = [[-1 for i in range(n)] for j in range(n)]
for i in range(n):
for j in range(n):
array[i][j] = abs(j-i)
for i in range(n):
if array[i][x] == array[i][y]:
pass
elif array[i][x] > array[i][y]:
array[i][x] = array[i][y]... | 46 | 61 | 846 | 1,311 | n, x, y = list(map(int, input().split()))
x -= 1
y -= 1
array1 = [0] * n
array2 = [0] * n
for i in range(x, y + 1):
array1[i] = min(i - x, y - i + 1)
array2[i] = min(i - x + 1, y - i)
ans = [0] * (n + 1)
dis = [[0 for i in range(n)] for i in range(n)]
for i in range(n):
if i <= x:
for j in range(i +... | n, x, y = list(map(int, input().split()))
x -= 1
y -= 1
array = [[-1 for i in range(n)] for j in range(n)]
for i in range(n):
for j in range(n):
array[i][j] = abs(j - i)
for i in range(n):
if array[i][x] == array[i][y]:
pass
elif array[i][x] > array[i][y]:
array[i][x] = array[i][y] +... | false | 24.590164 | [
"-array1 = [0] * n",
"-array2 = [0] * n",
"-for i in range(x, y + 1):",
"- array1[i] = min(i - x, y - i + 1)",
"- array2[i] = min(i - x + 1, y - i)",
"+array = [[-1 for i in range(n)] for j in range(n)]",
"+for i in range(n):",
"+ for j in range(n):",
"+ array[i][j] = abs(j - i)",
... | false | 0.0367 | 0.103587 | 0.35429 | [
"s718892140",
"s855202988"
] |
u730769327 | p02861 | python | s734891636 | s821984347 | 102 | 62 | 74,184 | 62,292 | Accepted | Accepted | 39.22 | from itertools import permutations
n=int(eval(input()))
x=list(permutations([list(map(int,input().split())) for _ in range(n)]))
c=0.0
for i in x:
a=i[0][0]
b=i[0][1]
for j in i[1:]:
c+=((j[0]-a)**2+(j[1]-b)**2)**.5
a=j[0]
b=j[1]
print((c/len(x))) | n=int(eval(input()))
x=[]
y=[]
for i in range(n):
a,b=list(map(int,input().split()))
x.append(a)
y.append(b)
sm=0
for i in range(n):
for j in range(n):
sm+=((x[i]-x[j])**2+(y[i]-y[j])**2)**0.5
print((sm/n)) | 12 | 12 | 268 | 215 | from itertools import permutations
n = int(eval(input()))
x = list(permutations([list(map(int, input().split())) for _ in range(n)]))
c = 0.0
for i in x:
a = i[0][0]
b = i[0][1]
for j in i[1:]:
c += ((j[0] - a) ** 2 + (j[1] - b) ** 2) ** 0.5
a = j[0]
b = j[1]
print((c / len(x)))
| n = int(eval(input()))
x = []
y = []
for i in range(n):
a, b = list(map(int, input().split()))
x.append(a)
y.append(b)
sm = 0
for i in range(n):
for j in range(n):
sm += ((x[i] - x[j]) ** 2 + (y[i] - y[j]) ** 2) ** 0.5
print((sm / n))
| false | 0 | [
"-from itertools import permutations",
"-",
"-x = list(permutations([list(map(int, input().split())) for _ in range(n)]))",
"-c = 0.0",
"-for i in x:",
"- a = i[0][0]",
"- b = i[0][1]",
"- for j in i[1:]:",
"- c += ((j[0] - a) ** 2 + (j[1] - b) ** 2) ** 0.5",
"- a = j[0]",
... | false | 0.042845 | 0.040957 | 1.04609 | [
"s734891636",
"s821984347"
] |
u933341648 | p03673 | python | s953379086 | s950227518 | 230 | 110 | 25,156 | 25,668 | Accepted | Accepted | 52.17 | n = int(eval(input()))
a = [int(x) for x in input().split()]
b_even = [x for n, x in enumerate(a) if (n+1) % 2 == 0]
b_odd = [x for n, x in enumerate(a) if (n+1) % 2 == 1]
if n % 2 == 0:
b_even.reverse()
res = b_even + b_odd
else:
b_odd.reverse()
res = b_odd + b_even
print((*res)) | n = int(eval(input()))
a = input().split()
if n % 2 == 0:
b = a[::-2] + a[::2]
else:
b = a[::-2] + a[1::2]
print((*b)) | 14 | 9 | 305 | 128 | n = int(eval(input()))
a = [int(x) for x in input().split()]
b_even = [x for n, x in enumerate(a) if (n + 1) % 2 == 0]
b_odd = [x for n, x in enumerate(a) if (n + 1) % 2 == 1]
if n % 2 == 0:
b_even.reverse()
res = b_even + b_odd
else:
b_odd.reverse()
res = b_odd + b_even
print((*res))
| n = int(eval(input()))
a = input().split()
if n % 2 == 0:
b = a[::-2] + a[::2]
else:
b = a[::-2] + a[1::2]
print((*b))
| false | 35.714286 | [
"-a = [int(x) for x in input().split()]",
"-b_even = [x for n, x in enumerate(a) if (n + 1) % 2 == 0]",
"-b_odd = [x for n, x in enumerate(a) if (n + 1) % 2 == 1]",
"+a = input().split()",
"- b_even.reverse()",
"- res = b_even + b_odd",
"+ b = a[::-2] + a[::2]",
"- b_odd.reverse()",
"- ... | false | 0.056916 | 0.085398 | 0.66648 | [
"s953379086",
"s950227518"
] |
u022407960 | p02233 | python | s997699468 | s876768704 | 50 | 40 | 7,700 | 7,696 | Accepted | Accepted | 20 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
def fib_bad(n):
if not n or n == 1:
return 1
return fib_bad(n - 2) + fib_bad(n - 1)
def fib_dp(n):
fib_list[:1] = [1, 1]
for i in range(2, n + 1):
fib_list[i] = fib_list[i - 2] + fib_list[i - 1]
return fib_... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
# def fib_bad(n):
# if not n or n == 1:
# return 1
# return fib_bad(n - 2) + fib_bad(n - 1)
def fib_dp(n):
fib_list[:1] = [1, 1]
for i in range(2, n + 1):
fib_list[i] = fib_list[i - 2] + fib_list[i - 1]
ret... | 25 | 24 | 512 | 491 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
def fib_bad(n):
if not n or n == 1:
return 1
return fib_bad(n - 2) + fib_bad(n - 1)
def fib_dp(n):
fib_list[:1] = [1, 1]
for i in range(2, n + 1):
fib_list[i] = fib_list[i - 2] + fib_list[i - 1]
return fib_list.pop()
if _... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
# def fib_bad(n):
# if not n or n == 1:
# return 1
# return fib_bad(n - 2) + fib_bad(n - 1)
def fib_dp(n):
fib_list[:1] = [1, 1]
for i in range(2, n + 1):
fib_list[i] = fib_list[i - 2] + fib_list[i - 1]
return fib_list.pop()
... | false | 4 | [
"-",
"-def fib_bad(n):",
"- if not n or n == 1:",
"- return 1",
"- return fib_bad(n - 2) + fib_bad(n - 1)",
"-",
"-",
"+# def fib_bad(n):",
"+# if not n or n == 1:",
"+# return 1",
"+# return fib_bad(n - 2) + fib_bad(n - 1)",
"- # print(fib_bad(index))"
] | false | 0.078799 | 0.04127 | 1.90935 | [
"s997699468",
"s876768704"
] |
u583507988 | p03037 | python | s933433161 | s828569764 | 253 | 227 | 27,264 | 9,176 | Accepted | Accepted | 10.28 | n , m = list(map(int, input().split()))
lr = [list(map(int, input().split())) for i in range(m)]
mi = 0
ma = n
for i in range(m):
mi = max(mi, lr[i][0])
ma = min(ma, lr[i][1])
if ma-mi>=0:
print((ma-mi+1))
else:
print((0)) | n,m=list(map(int,input().split()))
lb=0
ub=n
for i in range(m):
l,r=list(map(int,input().split()))
lb=max(lb,l)
ub=min(ub,r)
if ub>=lb:
print((ub-lb+1))
else:
print((0)) | 14 | 12 | 240 | 177 | n, m = list(map(int, input().split()))
lr = [list(map(int, input().split())) for i in range(m)]
mi = 0
ma = n
for i in range(m):
mi = max(mi, lr[i][0])
ma = min(ma, lr[i][1])
if ma - mi >= 0:
print((ma - mi + 1))
else:
print((0))
| n, m = list(map(int, input().split()))
lb = 0
ub = n
for i in range(m):
l, r = list(map(int, input().split()))
lb = max(lb, l)
ub = min(ub, r)
if ub >= lb:
print((ub - lb + 1))
else:
print((0))
| false | 14.285714 | [
"-lr = [list(map(int, input().split())) for i in range(m)]",
"-mi = 0",
"-ma = n",
"+lb = 0",
"+ub = n",
"- mi = max(mi, lr[i][0])",
"- ma = min(ma, lr[i][1])",
"-if ma - mi >= 0:",
"- print((ma - mi + 1))",
"+ l, r = list(map(int, input().split()))",
"+ lb = max(lb, l)",
"+ ... | false | 0.048095 | 0.048477 | 0.992108 | [
"s933433161",
"s828569764"
] |
u873482706 | p00036 | python | s976531912 | s708228781 | 90 | 60 | 7,892 | 7,572 | Accepted | Accepted | 33.33 | A = [[1, 1], [1, 1]]
B = [[1], [1], [1], [1]]
C = [[1, 1, 1, 1]]
D = [[0, 1], [1, 1], [1, 0]]
E = [[1, 1, 0], [0, 1, 1]]
F = [[1, 0], [1, 1], [0, 1]]
G = [[0, 1, 1], [1, 1, 0]]
def f(_h, _w, flg):
for h in range(8-_h+1):
for w in range(8-_w+1):
big = f1(h, w, _h, _w)
i... | # -*- coding: utf-8 -*-
figures = {
'A': [['1', '1'], ['1', '1']],
'B': [['1'], ['1'], ['1'], ['1']],
'C': [['1', '1', '1', '1']],
'D': [['0', '1'], ['1', '1'], ['1', '0']],
'E': [['1', '1', '0'], ['0', '1', '1']],
'F': [['1', '0'], ['1', '1'], ['0', '1']],
'G': [['0', '1', '1'], ['1... | 69 | 43 | 1,488 | 1,078 | A = [[1, 1], [1, 1]]
B = [[1], [1], [1], [1]]
C = [[1, 1, 1, 1]]
D = [[0, 1], [1, 1], [1, 0]]
E = [[1, 1, 0], [0, 1, 1]]
F = [[1, 0], [1, 1], [0, 1]]
G = [[0, 1, 1], [1, 1, 0]]
def f(_h, _w, flg):
for h in range(8 - _h + 1):
for w in range(8 - _w + 1):
big = f1(h, w, _h, _w)
if f2(... | # -*- coding: utf-8 -*-
figures = {
"A": [["1", "1"], ["1", "1"]],
"B": [["1"], ["1"], ["1"], ["1"]],
"C": [["1", "1", "1", "1"]],
"D": [["0", "1"], ["1", "1"], ["1", "0"]],
"E": [["1", "1", "0"], ["0", "1", "1"]],
"F": [["1", "0"], ["1", "1"], ["0", "1"]],
"G": [["0", "1", "1"], ["1", "1", ... | false | 37.681159 | [
"-A = [[1, 1], [1, 1]]",
"-B = [[1], [1], [1], [1]]",
"-C = [[1, 1, 1, 1]]",
"-D = [[0, 1], [1, 1], [1, 0]]",
"-E = [[1, 1, 0], [0, 1, 1]]",
"-F = [[1, 0], [1, 1], [0, 1]]",
"-G = [[0, 1, 1], [1, 1, 0]]",
"+# -*- coding: utf-8 -*-",
"+figures = {",
"+ \"A\": [[\"1\", \"1\"], [\"1\", \"1\"]],",
... | false | 0.084421 | 0.080752 | 1.045441 | [
"s976531912",
"s708228781"
] |
u836737505 | p03315 | python | s560061771 | s128401398 | 23 | 17 | 2,940 | 2,940 | Accepted | Accepted | 26.09 | a = eval(input())
c = 0
for i in a:
if i =="+":c += 1
else: c -=1
print(c) | s = eval(input())
ans = 0
for i in range(4):
if s[i]=="+":
ans += 1
else:
ans -= 1
print(ans) | 6 | 8 | 77 | 118 | a = eval(input())
c = 0
for i in a:
if i == "+":
c += 1
else:
c -= 1
print(c)
| s = eval(input())
ans = 0
for i in range(4):
if s[i] == "+":
ans += 1
else:
ans -= 1
print(ans)
| false | 25 | [
"-a = eval(input())",
"-c = 0",
"-for i in a:",
"- if i == \"+\":",
"- c += 1",
"+s = eval(input())",
"+ans = 0",
"+for i in range(4):",
"+ if s[i] == \"+\":",
"+ ans += 1",
"- c -= 1",
"-print(c)",
"+ ans -= 1",
"+print(ans)"
] | false | 0.036177 | 0.03643 | 0.993037 | [
"s560061771",
"s128401398"
] |
u284109563 | p02729 | python | s858124371 | s826506242 | 22 | 18 | 3,064 | 2,940 | Accepted | Accepted | 18.18 | n, m = list(map(int, input().split()))
a = []
for i in range(1,n+1):
a.append(2*i)
for j in range(1, m+1):
a.append(2*j - 1)
counter = 0
for i in range(len(a)-1):
for j in range(i+1, len(a)):
if (a[i] + a[j]) % 2 == 0:
counter += 1
print(counter) | n, m = list(map(int, input().split()))
ans = n * (n-1) // 2 + m * (m-1) // 2
print(ans) | 15 | 4 | 279 | 85 | n, m = list(map(int, input().split()))
a = []
for i in range(1, n + 1):
a.append(2 * i)
for j in range(1, m + 1):
a.append(2 * j - 1)
counter = 0
for i in range(len(a) - 1):
for j in range(i + 1, len(a)):
if (a[i] + a[j]) % 2 == 0:
counter += 1
print(counter)
| n, m = list(map(int, input().split()))
ans = n * (n - 1) // 2 + m * (m - 1) // 2
print(ans)
| false | 73.333333 | [
"-a = []",
"-for i in range(1, n + 1):",
"- a.append(2 * i)",
"-for j in range(1, m + 1):",
"- a.append(2 * j - 1)",
"-counter = 0",
"-for i in range(len(a) - 1):",
"- for j in range(i + 1, len(a)):",
"- if (a[i] + a[j]) % 2 == 0:",
"- counter += 1",
"-print(counter)",... | false | 0.047873 | 0.045678 | 1.048051 | [
"s858124371",
"s826506242"
] |
u303039933 | p02786 | python | s355635083 | s558887096 | 188 | 42 | 38,512 | 10,772 | Accepted | Accepted | 77.66 | # -*- coding: utf-8 -*-
import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from functools import lru_cache
import bisect
import re
import queue
class Scanner():
@staticmethod
def... | # -*- coding: utf-8 -*-
import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from collections import deque
from functools import lru_cache
import bisect
import re
import queue
import copy
impo... | 138 | 65 | 2,660 | 1,246 | # -*- coding: utf-8 -*-
import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from functools import lru_cache
import bisect
import re
import queue
class Scanner:
@staticmethod
def int():
retu... | # -*- coding: utf-8 -*-
import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from collections import deque
from functools import lru_cache
import bisect
import re
import queue
import copy
import decimal
cla... | false | 52.898551 | [
"+from collections import deque",
"+import copy",
"+import decimal",
"- return [eval(input()) for i in range(n)]",
"+ return [Scanner.string() for i in range(n)]",
"- return [int(eval(input())) for i in range(n)]",
"+ return [Scanner.int() for i in range(n)]",
"-class Math:... | false | 0.037193 | 0.073312 | 0.507329 | [
"s355635083",
"s558887096"
] |
u006657459 | p04045 | python | s342166572 | s554966006 | 93 | 58 | 3,060 | 3,060 | Accepted | Accepted | 37.63 | N, K = list(map(int, input().split()))
D = [Di for Di in input().split()]
for n in range(N, 1000000000):
n = str(n)
flag = True
for i in range(len(str(n))):
if n[i] in D:
flag = False
break
if flag is True:
print(n)
exit() | N, K = list(map(int, input().split()))
D = [Di for Di in input().split()]
for n in range(N, 1000000000):
n = str(n)
flag = True
for ni in n:
if ni in D:
flag = False
break
if flag:
print(n)
exit() | 12 | 13 | 291 | 267 | N, K = list(map(int, input().split()))
D = [Di for Di in input().split()]
for n in range(N, 1000000000):
n = str(n)
flag = True
for i in range(len(str(n))):
if n[i] in D:
flag = False
break
if flag is True:
print(n)
exit()
| N, K = list(map(int, input().split()))
D = [Di for Di in input().split()]
for n in range(N, 1000000000):
n = str(n)
flag = True
for ni in n:
if ni in D:
flag = False
break
if flag:
print(n)
exit()
| false | 7.692308 | [
"- for i in range(len(str(n))):",
"- if n[i] in D:",
"+ for ni in n:",
"+ if ni in D:",
"- if flag is True:",
"+ if flag:"
] | false | 0.040411 | 0.044083 | 0.916693 | [
"s342166572",
"s554966006"
] |
u724732842 | p03379 | python | s219485336 | s887639720 | 682 | 359 | 71,836 | 25,224 | Accepted | Accepted | 47.36 | N = int(eval(input()))
x = {}
ans = {}
y = []
k = 1
l = 1
for i in list(map(int,input().split())):
x[k] = i
y.append(i)
k += 1
y.sort()
m_1 = y[int(N/2)]
m_2 = y[int(N/2)-1]
for i,j in sorted(list(x.items()),key = lambda x: x[1]):
if (int(N/2) >= l):
ans[i] = m_1
l+=1... | N = int(eval(input()))
A = [int(i) for i in input().split()]
sortA = sorted(A)
for i in range(N):
if A[i] < sortA[N//2]:
print((sortA[N//2]))
else:
print((sortA[N//2 - 1])) | 25 | 9 | 404 | 195 | N = int(eval(input()))
x = {}
ans = {}
y = []
k = 1
l = 1
for i in list(map(int, input().split())):
x[k] = i
y.append(i)
k += 1
y.sort()
m_1 = y[int(N / 2)]
m_2 = y[int(N / 2) - 1]
for i, j in sorted(list(x.items()), key=lambda x: x[1]):
if int(N / 2) >= l:
ans[i] = m_1
l += 1
else:
... | N = int(eval(input()))
A = [int(i) for i in input().split()]
sortA = sorted(A)
for i in range(N):
if A[i] < sortA[N // 2]:
print((sortA[N // 2]))
else:
print((sortA[N // 2 - 1]))
| false | 64 | [
"-x = {}",
"-ans = {}",
"-y = []",
"-k = 1",
"-l = 1",
"-for i in list(map(int, input().split())):",
"- x[k] = i",
"- y.append(i)",
"- k += 1",
"-y.sort()",
"-m_1 = y[int(N / 2)]",
"-m_2 = y[int(N / 2) - 1]",
"-for i, j in sorted(list(x.items()), key=lambda x: x[1]):",
"- if in... | false | 0.039897 | 0.039387 | 1.012936 | [
"s219485336",
"s887639720"
] |
u127499732 | p02690 | python | s515596030 | s297165469 | 29 | 26 | 9,104 | 8,988 | Accepted | Accepted | 10.34 | def main():
x = int(eval(input()))
for i in range(120):
for j in range(i, -i, -1):
cal = i ** 5 - j ** 5
if cal == x:
print((i, j))
exit()
if __name__ == '__main__':
main()
| def main():
x = int(eval(input()))
for i in range(120):
a = i ** 5
for j in range(i, -i, -1):
b = j ** 5
if a - b == x:
print((i, j))
exit()
if __name__ == '__main__':
main()
| 12 | 13 | 254 | 265 | def main():
x = int(eval(input()))
for i in range(120):
for j in range(i, -i, -1):
cal = i**5 - j**5
if cal == x:
print((i, j))
exit()
if __name__ == "__main__":
main()
| def main():
x = int(eval(input()))
for i in range(120):
a = i**5
for j in range(i, -i, -1):
b = j**5
if a - b == x:
print((i, j))
exit()
if __name__ == "__main__":
main()
| false | 7.692308 | [
"+ a = i**5",
"- cal = i**5 - j**5",
"- if cal == x:",
"+ b = j**5",
"+ if a - b == x:"
] | false | 0.047188 | 0.037528 | 1.257408 | [
"s515596030",
"s297165469"
] |
u739360929 | p04001 | python | s203659432 | s926188727 | 27 | 24 | 3,064 | 3,060 | Accepted | Accepted | 11.11 | def solve():
S = eval(input())
n = len(S) - 1
ieS = S[0]
for i in range(n):
ieS += '*'
ieS += S[i+1]
ans = 0
for i in range(2 ** n):
eS = ieS
for j in range(n):
if (i >> j) & 1:
eS = eS[:(j+1)*2-1] + '+' + eS[(j+1)*2:]
... | # def bit():
# S = input()
# n = len(S) - 1
# ieS = S[0]
# for i in range(n):
# ieS += '*'
# ieS += S[i+1]
# ans = 0
# for i in range(2 ** n):
# eS = ieS
# for j in range(n):
# if (i >> j) & 1:
# eS = eS[:(j+1)*2-1] + '+' + ... | 22 | 31 | 418 | 656 | def solve():
S = eval(input())
n = len(S) - 1
ieS = S[0]
for i in range(n):
ieS += "*"
ieS += S[i + 1]
ans = 0
for i in range(2**n):
eS = ieS
for j in range(n):
if (i >> j) & 1:
eS = eS[: (j + 1) * 2 - 1] + "+" + eS[(j + 1) * 2 :]
... | # def bit():
# S = input()
# n = len(S) - 1
# ieS = S[0]
# for i in range(n):
# ieS += '*'
# ieS += S[i+1]
# ans = 0
# for i in range(2 ** n):
# eS = ieS
# for j in range(n):
# if (i >> j) & 1:
# eS = eS[:(j+1)*2-1] + '+' + eS[(j+1)*2:]... | false | 29.032258 | [
"+# def bit():",
"+# S = input()",
"+# n = len(S) - 1",
"+# ieS = S[0]",
"+# for i in range(n):",
"+# ieS += '*'",
"+# ieS += S[i+1]",
"+# ans = 0",
"+# for i in range(2 ** n):",
"+# eS = ieS",
"+# for j in range(n):",
"+# if ... | false | 0.039965 | 0.046757 | 0.854734 | [
"s203659432",
"s926188727"
] |
u548123110 | p02689 | python | s537903969 | s351569441 | 330 | 219 | 20,124 | 20,060 | Accepted | Accepted | 33.64 | def main():
n,m = list(map(int,input().split()))
h = list(map(int,input().split()))
A = [0] * n
for i in range(m):
a,b = list(map(int,input().split()))
A[a-1] = max(A[a-1],h[b-1])
A[b-1] = max(A[b-1],h[a-1])
cnt = 0
for i in range(n):
if A[i] < h[i]:... | def main():
n,m = list(map(int,input().split()))
h = list(map(int,input().split()))
ans = [1]*n
for i in range(m):
a,b = list(map(int,input().split()))
if h[a-1] < h[b-1]:
ans[a-1] = 0
elif h[a-1] > h[b-1]:
ans[b-1] = 0
elif h[a-1] == h[b... | 19 | 20 | 395 | 446 | def main():
n, m = list(map(int, input().split()))
h = list(map(int, input().split()))
A = [0] * n
for i in range(m):
a, b = list(map(int, input().split()))
A[a - 1] = max(A[a - 1], h[b - 1])
A[b - 1] = max(A[b - 1], h[a - 1])
cnt = 0
for i in range(n):
if A[i] < ... | def main():
n, m = list(map(int, input().split()))
h = list(map(int, input().split()))
ans = [1] * n
for i in range(m):
a, b = list(map(int, input().split()))
if h[a - 1] < h[b - 1]:
ans[a - 1] = 0
elif h[a - 1] > h[b - 1]:
ans[b - 1] = 0
elif h[a ... | false | 5 | [
"- A = [0] * n",
"+ ans = [1] * n",
"- A[a - 1] = max(A[a - 1], h[b - 1])",
"- A[b - 1] = max(A[b - 1], h[a - 1])",
"- cnt = 0",
"- for i in range(n):",
"- if A[i] < h[i]:",
"- cnt += 1",
"- print(cnt)",
"+ if h[a - 1] < h[b - 1]:",
"+ ... | false | 0.036083 | 0.032288 | 1.117537 | [
"s537903969",
"s351569441"
] |
u644907318 | p03186 | python | s320788039 | s861456658 | 181 | 63 | 38,256 | 61,868 | Accepted | Accepted | 65.19 | A,B,C = list(map(int,input().split()))
if A+B>=C-1:
print((B+C))
else:
print(((A+B+B)+1)) | A,B,C = list(map(int,input().split()))
if B>=C:
print((C+B))
else:
a = 2*B+min(C-B,A)
if C-B-A>=1:
a += 1
print(a) | 5 | 8 | 91 | 137 | A, B, C = list(map(int, input().split()))
if A + B >= C - 1:
print((B + C))
else:
print(((A + B + B) + 1))
| A, B, C = list(map(int, input().split()))
if B >= C:
print((C + B))
else:
a = 2 * B + min(C - B, A)
if C - B - A >= 1:
a += 1
print(a)
| false | 37.5 | [
"-if A + B >= C - 1:",
"- print((B + C))",
"+if B >= C:",
"+ print((C + B))",
"- print(((A + B + B) + 1))",
"+ a = 2 * B + min(C - B, A)",
"+ if C - B - A >= 1:",
"+ a += 1",
"+ print(a)"
] | false | 0.035389 | 0.055288 | 0.640097 | [
"s320788039",
"s861456658"
] |
u474561976 | p04045 | python | s778270318 | s276032799 | 131 | 78 | 3,060 | 9,180 | Accepted | Accepted | 40.46 | def main():
from sys import stdin
n,k = list(map(int,stdin.readline().rstrip().split()))
Ds = set(map(int,stdin.readline().rstrip().split()))
ans = n
while True:
num = ans
numset = set()
while num != 0:
r = num%10
num = num//10
... | import io,sys
sys.setrecursionlimit(10**6)
def main():
n,k = list(map(int,input().split()))
D = list(map(int,input().split()))
while True:
temp = n
num = []
while temp > 0:
num.append(temp%10)
temp//=10
flag = True
for... | 20 | 25 | 449 | 506 | def main():
from sys import stdin
n, k = list(map(int, stdin.readline().rstrip().split()))
Ds = set(map(int, stdin.readline().rstrip().split()))
ans = n
while True:
num = ans
numset = set()
while num != 0:
r = num % 10
num = num // 10
nums... | import io, sys
sys.setrecursionlimit(10**6)
def main():
n, k = list(map(int, input().split()))
D = list(map(int, input().split()))
while True:
temp = n
num = []
while temp > 0:
num.append(temp % 10)
temp //= 10
flag = True
for i in num:
... | false | 20 | [
"+import io, sys",
"+",
"+sys.setrecursionlimit(10**6)",
"+",
"+",
"- from sys import stdin",
"-",
"- n, k = list(map(int, stdin.readline().rstrip().split()))",
"- Ds = set(map(int, stdin.readline().rstrip().split()))",
"- ans = n",
"+ n, k = list(map(int, input().split()))",
"+... | false | 0.126906 | 0.122105 | 1.039318 | [
"s778270318",
"s276032799"
] |
u073852194 | p03682 | python | s504031130 | s957637170 | 1,370 | 1,247 | 125,648 | 122,720 | Accepted | Accepted | 8.98 | class Graph(): #non-directed
def __init__(self, n, edge, indexed=1):
self.n = n
self.edge = edge
self.indexed = indexed
self.graph = [[] for _ in range(n)]
for e in edge:
self.graph[e[0] - indexed].append((e[1] - indexed, e[2]))
self.graph[e[1... | class Graph(): #non-directed
def __init__(self, n, edge, indexed=1):
self.n = n
self.edge = edge
self.indexed = indexed
self.graph = [[] for _ in range(n)]
for e in edge:
self.graph[e[0] - indexed].append((e[1] - indexed, e[2]))
self.graph[e[1... | 84 | 84 | 2,562 | 2,562 | class Graph: # non-directed
def __init__(self, n, edge, indexed=1):
self.n = n
self.edge = edge
self.indexed = indexed
self.graph = [[] for _ in range(n)]
for e in edge:
self.graph[e[0] - indexed].append((e[1] - indexed, e[2]))
self.graph[e[1] - index... | class Graph: # non-directed
def __init__(self, n, edge, indexed=1):
self.n = n
self.edge = edge
self.indexed = indexed
self.graph = [[] for _ in range(n)]
for e in edge:
self.graph[e[0] - indexed].append((e[1] - indexed, e[2]))
self.graph[e[1] - index... | false | 0 | [
"- edgemap = {self.edge[i]: i for i in range(len(self.edge))}",
"+ # edgemap = {self.edge[i]: i for i in range(len(self.edge))}",
"- restored.append(edgemap[e])",
"+ # restored.append(edgemap[e])",
"- return res, restored",
"+ return res # , resto... | false | 0.040706 | 0.047421 | 0.858387 | [
"s504031130",
"s957637170"
] |
u685983477 | p04034 | python | s529017576 | s895262572 | 364 | 216 | 4,852 | 10,284 | Accepted | Accepted | 40.66 | from collections import defaultdict
n,m=list(map(int, input().split()))
v = [0]*n
v[0]=1
ans = [1]*n
fi = 1
for i in range(m):
a,b=list(map(int, input().split()))
ans[a-1]-=1
ans[b-1]+=1
if v[a-1]:
v[b-1]=1
fi+=1
if ans[a-1]==0:
v[a-1]=0
fi-=1
print(... | n,m=list(map(int, input().split()))
aka = [0]*(n+1)
siroaka = [1]*(n+1)
aka[1] = 1
for i in range(m):
x,y=list(map(int, input().split()))
siroaka[x]-=1
siroaka[y]+=1
if(aka[x]):
aka[y]=1
if(siroaka[x]==0):
aka[x]=0
print((sum(aka)))
| 18 | 14 | 316 | 269 | from collections import defaultdict
n, m = list(map(int, input().split()))
v = [0] * n
v[0] = 1
ans = [1] * n
fi = 1
for i in range(m):
a, b = list(map(int, input().split()))
ans[a - 1] -= 1
ans[b - 1] += 1
if v[a - 1]:
v[b - 1] = 1
fi += 1
if ans[a - 1] == 0:
v[a - 1] = 0
... | n, m = list(map(int, input().split()))
aka = [0] * (n + 1)
siroaka = [1] * (n + 1)
aka[1] = 1
for i in range(m):
x, y = list(map(int, input().split()))
siroaka[x] -= 1
siroaka[y] += 1
if aka[x]:
aka[y] = 1
if siroaka[x] == 0:
aka[x] = 0
print((sum(aka)))
| false | 22.222222 | [
"-from collections import defaultdict",
"-",
"-v = [0] * n",
"-v[0] = 1",
"-ans = [1] * n",
"-fi = 1",
"+aka = [0] * (n + 1)",
"+siroaka = [1] * (n + 1)",
"+aka[1] = 1",
"- a, b = list(map(int, input().split()))",
"- ans[a - 1] -= 1",
"- ans[b - 1] += 1",
"- if v[a - 1]:",
"- ... | false | 0.079397 | 0.042997 | 1.846551 | [
"s529017576",
"s895262572"
] |
u065137691 | p02765 | python | s649539115 | s784120371 | 173 | 72 | 38,384 | 61,752 | Accepted | Accepted | 58.38 | N, R = list(map(int, input().split()))
if N >= 10:
print(R)
else:
print((R+(100*(10-N)))) | N, R= list(map(int, input().split()))
if N <= 10:
print((R+(100*(10-N))))
else:
print(R) | 5 | 6 | 93 | 94 | N, R = list(map(int, input().split()))
if N >= 10:
print(R)
else:
print((R + (100 * (10 - N))))
| N, R = list(map(int, input().split()))
if N <= 10:
print((R + (100 * (10 - N))))
else:
print(R)
| false | 16.666667 | [
"-if N >= 10:",
"+if N <= 10:",
"+ print((R + (100 * (10 - N))))",
"+else:",
"-else:",
"- print((R + (100 * (10 - N))))"
] | false | 0.221862 | 0.210747 | 1.052742 | [
"s649539115",
"s784120371"
] |
u729133443 | p03061 | python | s674118760 | s407231305 | 742 | 185 | 96,824 | 16,120 | Accepted | Accepted | 75.07 | from fractions import*
def update(k,x):
k+=N0-1
data[k]=x
while k+1:
k=~-k//2
data[k]=gcd(data[2*k+1],data[2*k+2])
def query(l,r):
L,R=l+N0,r+N0
s=0
while L<R:
if R&1:
R-=1
s=gcd(s,data[R-1])
if L&1:
s=gcd(s,data[... | from fractions import*
n,*a=list(map(int,open(0).read().split()))
b=a[:]
for i in range(1,n):
a[i]=gcd(a[i],a[i-1])
b[n-i-1]=gcd(b[n-i-1],b[n-i])
a=[0]+a
b+=0,
print((max(gcd(a[i],b[i+1])for i in range(n)))) | 26 | 9 | 565 | 215 | from fractions import *
def update(k, x):
k += N0 - 1
data[k] = x
while k + 1:
k = ~-k // 2
data[k] = gcd(data[2 * k + 1], data[2 * k + 2])
def query(l, r):
L, R = l + N0, r + N0
s = 0
while L < R:
if R & 1:
R -= 1
s = gcd(s, data[R - 1])
... | from fractions import *
n, *a = list(map(int, open(0).read().split()))
b = a[:]
for i in range(1, n):
a[i] = gcd(a[i], a[i - 1])
b[n - i - 1] = gcd(b[n - i - 1], b[n - i])
a = [0] + a
b += (0,)
print((max(gcd(a[i], b[i + 1]) for i in range(n))))
| false | 65.384615 | [
"-",
"-def update(k, x):",
"- k += N0 - 1",
"- data[k] = x",
"- while k + 1:",
"- k = ~-k // 2",
"- data[k] = gcd(data[2 * k + 1], data[2 * k + 2])",
"-",
"-",
"-def query(l, r):",
"- L, R = l + N0, r + N0",
"- s = 0",
"- while L < R:",
"- if R & 1:",... | false | 0.135413 | 0.052902 | 2.559709 | [
"s674118760",
"s407231305"
] |
u977389981 | p03325 | python | s150327417 | s673616859 | 139 | 99 | 4,148 | 4,148 | Accepted | Accepted | 28.78 | n = int(eval(input()))
A = [int(i) for i in input().split()]
count = 0
for i in range(n):
while A[i] % 2 == 0:
count += 1
A[i] /= 2
print(count) | n = int(eval(input()))
A = [int(i) for i in input().split()]
count = 0
for i in range(n):
while A[i] % 2 == 0:
A[i] //= 2
count += 1
print(count) | 10 | 9 | 177 | 176 | n = int(eval(input()))
A = [int(i) for i in input().split()]
count = 0
for i in range(n):
while A[i] % 2 == 0:
count += 1
A[i] /= 2
print(count)
| n = int(eval(input()))
A = [int(i) for i in input().split()]
count = 0
for i in range(n):
while A[i] % 2 == 0:
A[i] //= 2
count += 1
print(count)
| false | 10 | [
"+ A[i] //= 2",
"- A[i] /= 2"
] | false | 0.037419 | 0.043115 | 0.867876 | [
"s150327417",
"s673616859"
] |
u040533857 | p00008 | python | s235355146 | s232964347 | 180 | 150 | 6,724 | 6,728 | Accepted | Accepted | 16.67 | while True:
try:
n = int(eval(input()))
count = 0
for a in range(0,10):
for b in range(0,10):
for c in range(0,10):
for d in range(0,10):
if a+b+c+d==n:
count+=1
print(count)... | from itertools import product
while True:
try:
n = int(eval(input()))
except:
break
print((sum(a+b+c+d==n for a,b,c,d in product(list(range(10)), repeat=4)))) | 13 | 7 | 342 | 178 | while True:
try:
n = int(eval(input()))
count = 0
for a in range(0, 10):
for b in range(0, 10):
for c in range(0, 10):
for d in range(0, 10):
if a + b + c + d == n:
count += 1
print(co... | from itertools import product
while True:
try:
n = int(eval(input()))
except:
break
print(
(sum(a + b + c + d == n for a, b, c, d in product(list(range(10)), repeat=4)))
)
| false | 46.153846 | [
"+from itertools import product",
"+",
"- count = 0",
"- for a in range(0, 10):",
"- for b in range(0, 10):",
"- for c in range(0, 10):",
"- for d in range(0, 10):",
"- if a + b + c + d == n:",
"- ... | false | 0.075688 | 0.035069 | 2.158249 | [
"s235355146",
"s232964347"
] |
u367701763 | p03557 | python | s251066258 | s503775371 | 323 | 238 | 23,232 | 20,032 | Accepted | Accepted | 26.32 | from bisect import bisect_left
from bisect import bisect_right
N = int(eval(input()))
A = sorted(list(map(int, input().split())))
B = sorted(list(map(int, input().split())))
C = sorted(list(map(int, input().split())))
num_a = 0
num_c = 0
res = 0
pre_b = -1
for b in B:
if b == pre_b:
res ... | import sys
input = sys.stdin.buffer.readline
import numpy as np
N = int(eval(input()))
A = np.array(input().split(), dtype=np.int32) # 32ビットで9桁の数字を記述できる。今回は10^9までなので、これでOK。
B = np.array(input().split(), dtype=np.int32)
C = np.array(input().split(), dtype=np.int32)
A.sort()
B.sort()
C.sort()
num_a ... | 25 | 22 | 532 | 443 | from bisect import bisect_left
from bisect import bisect_right
N = int(eval(input()))
A = sorted(list(map(int, input().split())))
B = sorted(list(map(int, input().split())))
C = sorted(list(map(int, input().split())))
num_a = 0
num_c = 0
res = 0
pre_b = -1
for b in B:
if b == pre_b:
res += num_a * num_c
... | import sys
input = sys.stdin.buffer.readline
import numpy as np
N = int(eval(input()))
A = np.array(input().split(), dtype=np.int32) # 32ビットで9桁の数字を記述できる。今回は10^9までなので、これでOK。
B = np.array(input().split(), dtype=np.int32)
C = np.array(input().split(), dtype=np.int32)
A.sort()
B.sort()
C.sort()
num_a = np.searchsorted(A... | false | 12 | [
"-from bisect import bisect_left",
"-from bisect import bisect_right",
"+import sys",
"+",
"+input = sys.stdin.buffer.readline",
"+import numpy as np",
"-A = sorted(list(map(int, input().split())))",
"-B = sorted(list(map(int, input().split())))",
"-C = sorted(list(map(int, input().split())))",
"-... | false | 0.086463 | 0.177583 | 0.486889 | [
"s251066258",
"s503775371"
] |
u608088992 | p02951 | python | s553129019 | s747509837 | 20 | 17 | 2,940 | 2,940 | Accepted | Accepted | 15 | A, B, C = list(map(int, input().split()))
if C > (A - B): print((C - (A - B)))
else: print((0)) | import sys
def solve():
input = sys.stdin.readline
A, B, C = list(map(int, input().split()))
print((max(0, C - A + B)))
return 0
if __name__ == "__main__":
solve() | 3 | 11 | 87 | 188 | A, B, C = list(map(int, input().split()))
if C > (A - B):
print((C - (A - B)))
else:
print((0))
| import sys
def solve():
input = sys.stdin.readline
A, B, C = list(map(int, input().split()))
print((max(0, C - A + B)))
return 0
if __name__ == "__main__":
solve()
| false | 72.727273 | [
"-A, B, C = list(map(int, input().split()))",
"-if C > (A - B):",
"- print((C - (A - B)))",
"-else:",
"- print((0))",
"+import sys",
"+",
"+",
"+def solve():",
"+ input = sys.stdin.readline",
"+ A, B, C = list(map(int, input().split()))",
"+ print((max(0, C - A + B)))",
"+ ... | false | 0.039299 | 0.03973 | 0.989138 | [
"s553129019",
"s747509837"
] |
u334712262 | p03559 | python | s017641235 | s970082594 | 358 | 328 | 24,988 | 25,740 | Accepted | Accepted | 8.38 | # -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, produc... | # -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, produc... | 87 | 82 | 1,607 | 1,498 | # -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import (
combinations,
combinations_with_replacement,
p... | # -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import (
combinations,
combinations_with_replacement,
p... | false | 5.747126 | [
"- D = [0] * (N + 1)",
"- for i in range(N - 1, -1, -1):",
"- j = bisect.bisect_right(C, B[i])",
"- D[i] = D[i + 1] + (N - j)",
"- for i in range(N - 1, -1, -1):",
"- j = bisect.bisect_right(B, A[i])",
"- ans += D[j]",
"+ for b in B:",
"+ i = bisect.bis... | false | 0.047665 | 0.053752 | 0.886762 | [
"s017641235",
"s970082594"
] |
u835534360 | p03168 | python | s136327026 | s092721691 | 342 | 291 | 224,048 | 223,880 | Accepted | Accepted | 14.91 | import sys
def main():
N=int(sys.stdin.readline())
p=[float(x) for x in sys.stdin.readline().split()]
dp=[[0 for _ in range(N+1)] for _ in range(N+1)]
dp[0][0]=1.0
for i in range(1,N+1):
dp[i][0]=dp[i-1][0]*(1-p[i-1])
for j in range(1,N+1):dp[i][j]=dp[i-1][j-1]*p[i-1]+dp[i-1]... | import sys
def main():
N=int(sys.stdin.readline())
p=[float(x) for x in sys.stdin.readline().split()]
dp=[[0 for _ in range(N+1)] for _ in range(N+1)]
dp[0][0]=1.0
for i in range(1,N+1):
dp[i][0]=dp[i-1][0]*(1-p[i-1])
for j in range(1,i+1):dp[i][j]=dp[i-1][j-1]*p[i-1]+dp[i-1]... | 11 | 11 | 398 | 399 | import sys
def main():
N = int(sys.stdin.readline())
p = [float(x) for x in sys.stdin.readline().split()]
dp = [[0 for _ in range(N + 1)] for _ in range(N + 1)]
dp[0][0] = 1.0
for i in range(1, N + 1):
dp[i][0] = dp[i - 1][0] * (1 - p[i - 1])
for j in range(1, N + 1):
d... | import sys
def main():
N = int(sys.stdin.readline())
p = [float(x) for x in sys.stdin.readline().split()]
dp = [[0 for _ in range(N + 1)] for _ in range(N + 1)]
dp[0][0] = 1.0
for i in range(1, N + 1):
dp[i][0] = dp[i - 1][0] * (1 - p[i - 1])
for j in range(1, i + 1):
d... | false | 0 | [
"- for j in range(1, N + 1):",
"+ for j in range(1, i + 1):"
] | false | 0.052337 | 0.043401 | 1.205887 | [
"s136327026",
"s092721691"
] |
u131984977 | p02411 | python | s437839470 | s111288480 | 30 | 20 | 6,724 | 7,724 | Accepted | Accepted | 33.33 | while True:
(m, f, r) = [int(i) for i in input().split()]
if m == f == r == -1:
break
total = m + f
if m == -1 or f == -1 or total < 30:
print('F')
elif total < 50 and r < 50:
print('D')
elif total < 65:
print('C')
elif total < 80:
print(... | while True:
m, f, r = [int(i) for i in input().split()]
if m == f == r == -1:
break
total = m + f
if m == -1 or f == -1 or total < 30:
print('F')
elif total < 50 and r < 50:
print('D')
elif total < 65:
print('C')
elif total < 80:
... | 16 | 21 | 355 | 371 | while True:
(m, f, r) = [int(i) for i in input().split()]
if m == f == r == -1:
break
total = m + f
if m == -1 or f == -1 or total < 30:
print("F")
elif total < 50 and r < 50:
print("D")
elif total < 65:
print("C")
elif total < 80:
print("B")
else:... | while True:
m, f, r = [int(i) for i in input().split()]
if m == f == r == -1:
break
total = m + f
if m == -1 or f == -1 or total < 30:
print("F")
elif total < 50 and r < 50:
print("D")
elif total < 65:
print("C")
elif total < 80:
print("B")
else:
... | false | 23.809524 | [
"- (m, f, r) = [int(i) for i in input().split()]",
"+ m, f, r = [int(i) for i in input().split()]"
] | false | 0.032859 | 0.03332 | 0.986141 | [
"s437839470",
"s111288480"
] |
u645250356 | p03568 | python | s256330525 | s521157256 | 183 | 41 | 38,256 | 10,440 | Accepted | Accepted | 77.6 | from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools
sys.setrecursionlimit(10**8)
mod = 10**9+7
mod2 = 998244353
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpln(n): retu... | from collections import Counter,defaultdict,deque
from heapq import heappop,heappush
from bisect import bisect_left,bisect_right
import sys,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, ... | 17 | 17 | 472 | 448 | from collections import Counter, defaultdict, deque
from heapq import heappop, heappush, heapify
import sys, bisect, math, itertools
sys.setrecursionlimit(10**8)
mod = 10**9 + 7
mod2 = 998244353
def inp():
return int(sys.stdin.readline())
def inpl():
return list(map(int, sys.stdin.readline().split()))
de... | from collections import Counter, defaultdict, deque
from heapq import heappop, heappush
from bisect import bisect_left, bisect_right
import sys, math, itertools, fractions, pprint
sys.setrecursionlimit(10**8)
mod = 10**9 + 7
INF = float("inf")
def inp():
return int(sys.stdin.readline())
def inpl():
return ... | false | 0 | [
"-from heapq import heappop, heappush, heapify",
"-import sys, bisect, math, itertools",
"+from heapq import heappop, heappush",
"+from bisect import bisect_left, bisect_right",
"+import sys, math, itertools, fractions, pprint",
"-mod2 = 998244353",
"+INF = float(\"inf\")",
"-def inpln(n):",
"- r... | false | 0.041581 | 0.091798 | 0.45296 | [
"s256330525",
"s521157256"
] |
u346812984 | p03212 | python | s435372538 | s110353763 | 73 | 58 | 7,540 | 5,620 | Accepted | Accepted | 20.55 | import sys
from collections import deque
sys.setrecursionlimit(10 ** 6)
INF = float("inf")
MOD = 10 ** 9 + 7
def input():
return sys.stdin.readline().strip()
def bfs(N):
q = deque(["3", "5", "7"])
cnt = 0
while q:
s = q.popleft()
if int(s) > N:
cont... | import sys
from collections import deque
sys.setrecursionlimit(10 ** 6)
INF = float("inf")
MOD = 10 ** 9 + 7
def input():
return sys.stdin.readline().strip()
def bfs(N):
q = deque(["7", "5", "3"])
res = []
while q:
s = q.popleft()
for c in ["7", "5", "3"]:
... | 39 | 42 | 580 | 662 | import sys
from collections import deque
sys.setrecursionlimit(10**6)
INF = float("inf")
MOD = 10**9 + 7
def input():
return sys.stdin.readline().strip()
def bfs(N):
q = deque(["3", "5", "7"])
cnt = 0
while q:
s = q.popleft()
if int(s) > N:
continue
if len(set(s)... | import sys
from collections import deque
sys.setrecursionlimit(10**6)
INF = float("inf")
MOD = 10**9 + 7
def input():
return sys.stdin.readline().strip()
def bfs(N):
q = deque(["7", "5", "3"])
res = []
while q:
s = q.popleft()
for c in ["7", "5", "3"]:
new = s + c
... | false | 7.142857 | [
"- q = deque([\"3\", \"5\", \"7\"])",
"- cnt = 0",
"+ q = deque([\"7\", \"5\", \"3\"])",
"+ res = []",
"- if int(s) > N:",
"- continue",
"- if len(set(s)) == 3:",
"- cnt += 1",
"- for c in [\"3\", \"5\", \"7\"]:",
"- q.append(s + c)... | false | 0.207775 | 0.057282 | 3.627243 | [
"s435372538",
"s110353763"
] |
u005677960 | p02887 | python | s740176991 | s374226404 | 543 | 41 | 4,644 | 3,316 | Accepted | Accepted | 92.45 | N=int(eval(input()))
S=eval(input())
S=list(S)
for i in range(len(S)):
count=0
for j in range(i,len(S)-1):
if S[j]==S[j+1]:
count+=1
else:
break
#print(count)
if count>0:
del S[i+1:i+count+1]
#print(S)
if i==len(S)-1:
break
... | N=int(eval(input()))
S=eval(input())
count=0
for i in range(len(S)-1):
if S[i]==S[i+1]:
count+=1
print((len(S)-count)) | 18 | 7 | 332 | 116 | N = int(eval(input()))
S = eval(input())
S = list(S)
for i in range(len(S)):
count = 0
for j in range(i, len(S) - 1):
if S[j] == S[j + 1]:
count += 1
else:
break
# print(count)
if count > 0:
del S[i + 1 : i + count + 1]
# print(S)
if i == len(S) - ... | N = int(eval(input()))
S = eval(input())
count = 0
for i in range(len(S) - 1):
if S[i] == S[i + 1]:
count += 1
print((len(S) - count))
| false | 61.111111 | [
"-S = list(S)",
"-for i in range(len(S)):",
"- count = 0",
"- for j in range(i, len(S) - 1):",
"- if S[j] == S[j + 1]:",
"- count += 1",
"- else:",
"- break",
"- # print(count)",
"- if count > 0:",
"- del S[i + 1 : i + count + 1]",
"- #... | false | 0.042342 | 0.035048 | 1.208091 | [
"s740176991",
"s374226404"
] |
u142415823 | p03244 | python | s118828491 | s383172622 | 99 | 87 | 18,296 | 18,656 | Accepted | Accepted | 12.12 | n = int(eval(input()))
v = list(map(int, input().split()))
O = {}
E = {}
for i in v[0::2]:
if i in O:
O[i] += 1
else:
O[i] = 1
for i in v[1::2]:
if i in E:
E[i] += 1
else:
E[i] = 1
o_candidate = [[0, 0], [0, 0]]
e_candidate = [[0, 0], [0, 0]]
for... | import collections
n = int(eval(input()))
v = list(map(int, input().split()))
O = collections.Counter(v[0::2])
E = collections.Counter(v[1::2])
def get_candidate(F):
c = [[0, 0], [0, 0]]
for i, j in list(F.items()):
if j >= c[0][1]:
c[1] = c[0]
c[0] = [i, j]
... | 42 | 27 | 941 | 558 | n = int(eval(input()))
v = list(map(int, input().split()))
O = {}
E = {}
for i in v[0::2]:
if i in O:
O[i] += 1
else:
O[i] = 1
for i in v[1::2]:
if i in E:
E[i] += 1
else:
E[i] = 1
o_candidate = [[0, 0], [0, 0]]
e_candidate = [[0, 0], [0, 0]]
for i, j in list(O.items()):
... | import collections
n = int(eval(input()))
v = list(map(int, input().split()))
O = collections.Counter(v[0::2])
E = collections.Counter(v[1::2])
def get_candidate(F):
c = [[0, 0], [0, 0]]
for i, j in list(F.items()):
if j >= c[0][1]:
c[1] = c[0]
c[0] = [i, j]
elif j >= ... | false | 35.714286 | [
"+import collections",
"+",
"-O = {}",
"-E = {}",
"-for i in v[0::2]:",
"- if i in O:",
"- O[i] += 1",
"- else:",
"- O[i] = 1",
"-for i in v[1::2]:",
"- if i in E:",
"- E[i] += 1",
"- else:",
"- E[i] = 1",
"-o_candidate = [[0, 0], [0, 0]]",
"-e_c... | false | 0.046352 | 0.047389 | 0.978108 | [
"s118828491",
"s383172622"
] |
u940139461 | p03294 | python | s537682242 | s269258363 | 194 | 18 | 3,316 | 3,316 | Accepted | Accepted | 90.72 | import sys
input = sys.stdin.readline
n = int(eval(input())) # 入力が1つ
# map(int, input().split()) # 入力が複数
nums = [int(i) for i in input().split()]
def gcd(x, y):
if x < y:
x, y = y, x
if y == 0:
return 0
if x % y == 0:
return y
return gcd(y, x % y)
def lcm(x, y):
... | import sys
input = sys.stdin.readline
n = int(eval(input())) # 入力が1つ
# map(int, input().split()) # 入力が複数
nums = [int(i) for i in input().split()]
ans = 0
for num in nums:
ans += (num - 1)
print(ans) | 26 | 9 | 466 | 204 | import sys
input = sys.stdin.readline
n = int(eval(input())) # 入力が1つ
# map(int, input().split()) # 入力が複数
nums = [int(i) for i in input().split()]
def gcd(x, y):
if x < y:
x, y = y, x
if y == 0:
return 0
if x % y == 0:
return y
return gcd(y, x % y)
def lcm(x, y):
return ... | import sys
input = sys.stdin.readline
n = int(eval(input())) # 入力が1つ
# map(int, input().split()) # 入力が複数
nums = [int(i) for i in input().split()]
ans = 0
for num in nums:
ans += num - 1
print(ans)
| false | 65.384615 | [
"-",
"-",
"-def gcd(x, y):",
"- if x < y:",
"- x, y = y, x",
"- if y == 0:",
"- return 0",
"- if x % y == 0:",
"- return y",
"- return gcd(y, x % y)",
"-",
"-",
"-def lcm(x, y):",
"- return x * y // gcd(x, y)",
"-",
"-",
"-l = nums[0]",
"-for num... | false | 0.057073 | 0.032091 | 1.778489 | [
"s537682242",
"s269258363"
] |
u034782764 | p03457 | python | s148017557 | s738779527 | 381 | 332 | 3,060 | 3,060 | Accepted | Accepted | 12.86 | N = int(eval(input()))
count = 0
T, X, Y = 0, 0, 0
for i in range(N):
t, x, y = list(map(int, input().split()))
if abs(x-X)+abs(y-Y) <= t-T and t % 2 == (x+y) % 2:
count += 1
T, X, Y = t, x, y
if count==N:
print('Yes')
else:
print('No') | N = int(eval(input()))
for _ in range(N):
t, x, y = list(map(int, input().split()))
if x + y > t or (t + x + y)%2 != 0:
print("No")
quit()
print("Yes") | 12 | 7 | 263 | 169 | N = int(eval(input()))
count = 0
T, X, Y = 0, 0, 0
for i in range(N):
t, x, y = list(map(int, input().split()))
if abs(x - X) + abs(y - Y) <= t - T and t % 2 == (x + y) % 2:
count += 1
T, X, Y = t, x, y
if count == N:
print("Yes")
else:
print("No")
| N = int(eval(input()))
for _ in range(N):
t, x, y = list(map(int, input().split()))
if x + y > t or (t + x + y) % 2 != 0:
print("No")
quit()
print("Yes")
| false | 41.666667 | [
"-count = 0",
"-T, X, Y = 0, 0, 0",
"-for i in range(N):",
"+for _ in range(N):",
"- if abs(x - X) + abs(y - Y) <= t - T and t % 2 == (x + y) % 2:",
"- count += 1",
"- T, X, Y = t, x, y",
"-if count == N:",
"- print(\"Yes\")",
"-else:",
"- print(\"No\")",
"+ if x + y > t ... | false | 0.047282 | 0.037293 | 1.267861 | [
"s148017557",
"s738779527"
] |
u638456847 | p02613 | python | s882542074 | s755791962 | 52 | 48 | 9,200 | 17,232 | Accepted | Accepted | 7.69 | import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
def main():
N = int(readline())
d = {}
d["AC"] = 0
d["WA"] = 0
d["TLE"] = 0
d["RE"] = 0
for _ in range(N):
s = readline().strip()
d[s] += 1
print(f"AC x {d... | from collections import Counter
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
def main():
N, *S = read().split()
d = Counter(S)
for result in ['AC','WA','TLE','RE']:
if result in d:
print(f"{result} x {d[result]}")
... | 26 | 19 | 466 | 410 | import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
def main():
N = int(readline())
d = {}
d["AC"] = 0
d["WA"] = 0
d["TLE"] = 0
d["RE"] = 0
for _ in range(N):
s = readline().strip()
d[s] += 1
print(f"AC x {d['AC']}")
print... | from collections import Counter
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
def main():
N, *S = read().split()
d = Counter(S)
for result in ["AC", "WA", "TLE", "RE"]:
if result in d:
print(f"{result} x {d[result]}")
else:
... | false | 26.923077 | [
"+from collections import Counter",
"- N = int(readline())",
"- d = {}",
"- d[\"AC\"] = 0",
"- d[\"WA\"] = 0",
"- d[\"TLE\"] = 0",
"- d[\"RE\"] = 0",
"- for _ in range(N):",
"- s = readline().strip()",
"- d[s] += 1",
"- print(f\"AC x {d['AC']}\")",
"- p... | false | 0.045653 | 0.046373 | 0.984476 | [
"s882542074",
"s755791962"
] |
u784022244 | p02598 | python | s389431832 | s753269471 | 472 | 211 | 104,956 | 104,412 | Accepted | Accepted | 55.3 | from bisect import bisect_right
from math import ceil
N,K=list(map(int, input().split()))
A=list(map(int, input().split()))
if K==0:
print((max(A)))
exit()
A=sorted(A)
# 最小値で二分探索 してまだ行けるかどうか
# 回数で二分探索
left=0
right=max(A)
ans=float("INF")
pre=ans
flag=False
count=0
while True:
now=0
... | from math import ceil
N,K=list(map(int, input().split()))
A=list(map(int, input().split()))
left=1
right=10**9+1
ans=float("INF")
while True:
mid=(left+right)//2
now=0
for i in range(N):
now+=ceil(A[i]/mid)-1
if now>K:
if left==mid:
break
left=mid
... | 50 | 25 | 897 | 427 | from bisect import bisect_right
from math import ceil
N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
if K == 0:
print((max(A)))
exit()
A = sorted(A)
# 最小値で二分探索 してまだ行けるかどうか
# 回数で二分探索
left = 0
right = max(A)
ans = float("INF")
pre = ans
flag = False
count = 0
while True:
now = 0
... | from math import ceil
N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
left = 1
right = 10**9 + 1
ans = float("INF")
while True:
mid = (left + right) // 2
now = 0
for i in range(N):
now += ceil(A[i] / mid) - 1
if now > K:
if left == mid:
break
... | false | 50 | [
"-from bisect import bisect_right",
"-if K == 0:",
"- print((max(A)))",
"- exit()",
"-A = sorted(A)",
"-# 最小値で二分探索 してまだ行けるかどうか",
"-# 回数で二分探索",
"-left = 0",
"-right = max(A)",
"+left = 1",
"+right = 10**9 + 1",
"-pre = ans",
"-flag = False",
"-count = 0",
"+ mid = (left + right) ... | false | 0.066498 | 0.042015 | 1.5827 | [
"s389431832",
"s753269471"
] |
u323680411 | p03456 | python | s009952767 | s947228986 | 23 | 17 | 3,188 | 3,064 | Accepted | Accepted | 26.09 | from sys import stdin
def main() -> None:
a = next_int()
b = next_int()
ab = int(str(a) + str(b))
sqrt = int(ab ** 0.5)
print((["No","Yes"][sqrt ** 2 == ab]))
def next_int() -> int:
return int(next_str())
def next_str() -> str:
result = ""
while True:
... | from sys import stdin
def main() -> None:
a = next_int()
b = next_int()
ab = int(str(a) + str(b))
sqrt = int(ab ** 0.5)
print((["No", "Yes"][int(sqrt ** 2 == ab)]))
def next_int() -> int:
return int(next_str())
def next_str() -> str:
result = ""
while True:
... | 30 | 30 | 504 | 510 | from sys import stdin
def main() -> None:
a = next_int()
b = next_int()
ab = int(str(a) + str(b))
sqrt = int(ab**0.5)
print((["No", "Yes"][sqrt**2 == ab]))
def next_int() -> int:
return int(next_str())
def next_str() -> str:
result = ""
while True:
tmp = stdin.read(1)
... | from sys import stdin
def main() -> None:
a = next_int()
b = next_int()
ab = int(str(a) + str(b))
sqrt = int(ab**0.5)
print((["No", "Yes"][int(sqrt**2 == ab)]))
def next_int() -> int:
return int(next_str())
def next_str() -> str:
result = ""
while True:
tmp = stdin.read(1)
... | false | 0 | [
"- print(([\"No\", \"Yes\"][sqrt**2 == ab]))",
"+ print(([\"No\", \"Yes\"][int(sqrt**2 == ab)]))"
] | false | 0.037134 | 0.036531 | 1.016507 | [
"s009952767",
"s947228986"
] |
u492910842 | p03494 | python | s270412841 | s553206892 | 171 | 61 | 38,896 | 63,640 | Accepted | Accepted | 64.33 | n = int(eval(input()))
a = list(map(int,input().split()))
mincount = 40
count = 0
for i in a:
while i%2 == 0:
i = i/2
count += 1
if count < mincount:
mincount = count
count = 0
print(mincount) | n=int(eval(input()))
a=list(map(int,input().split()))
ans,cnt=36,0
for i in range(n):
while a[i]%2==0:
a[i]//=2
cnt+=1
ans=min(ans,cnt)
cnt=0
print(ans)
| 14 | 10 | 219 | 170 | n = int(eval(input()))
a = list(map(int, input().split()))
mincount = 40
count = 0
for i in a:
while i % 2 == 0:
i = i / 2
count += 1
if count < mincount:
mincount = count
count = 0
print(mincount)
| n = int(eval(input()))
a = list(map(int, input().split()))
ans, cnt = 36, 0
for i in range(n):
while a[i] % 2 == 0:
a[i] //= 2
cnt += 1
ans = min(ans, cnt)
cnt = 0
print(ans)
| false | 28.571429 | [
"-mincount = 40",
"-count = 0",
"-for i in a:",
"- while i % 2 == 0:",
"- i = i / 2",
"- count += 1",
"- if count < mincount:",
"- mincount = count",
"- count = 0",
"-print(mincount)",
"+ans, cnt = 36, 0",
"+for i in range(n):",
"+ while a[i] % 2 == 0:",
"+... | false | 0.09736 | 0.041915 | 2.322806 | [
"s270412841",
"s553206892"
] |
u790710233 | p03283 | python | s569389887 | s274333974 | 2,672 | 1,664 | 57,292 | 57,432 | Accepted | Accepted | 37.72 | n, m, q = list(map(int, input().split()))
edges = [[0]*n for _ in range(n)]
for _ in range(m):
L, R = [int(x)-1 for x in input().split()]
edges[L][R] += 1
S = [[0]*(n+1)for _ in range(n+1)]
for i in range(n):
for j in range(n):
S[i][j+1] = S[i][j] + edges[i][j]
for _ in range(q):
... | n, m, q = list(map(int, input().split()))
edges = [[0]*(n+1) for _ in range(n+1)]
for _ in range(m):
L, R = list(map(int, input().split()))
edges[L][R] += 1
for i in range(1, n+1):
for j in range(n):
edges[i][j+1] += edges[i][j]
for i in range(n):
for j in range(1, n+1):
... | 20 | 20 | 460 | 481 | n, m, q = list(map(int, input().split()))
edges = [[0] * n for _ in range(n)]
for _ in range(m):
L, R = [int(x) - 1 for x in input().split()]
edges[L][R] += 1
S = [[0] * (n + 1) for _ in range(n + 1)]
for i in range(n):
for j in range(n):
S[i][j + 1] = S[i][j] + edges[i][j]
for _ in range(q):
p,... | n, m, q = list(map(int, input().split()))
edges = [[0] * (n + 1) for _ in range(n + 1)]
for _ in range(m):
L, R = list(map(int, input().split()))
edges[L][R] += 1
for i in range(1, n + 1):
for j in range(n):
edges[i][j + 1] += edges[i][j]
for i in range(n):
for j in range(1, n + 1):
edge... | false | 0 | [
"-edges = [[0] * n for _ in range(n)]",
"+edges = [[0] * (n + 1) for _ in range(n + 1)]",
"- L, R = [int(x) - 1 for x in input().split()]",
"+ L, R = list(map(int, input().split()))",
"-S = [[0] * (n + 1) for _ in range(n + 1)]",
"+for i in range(1, n + 1):",
"+ for j in range(n):",
"+ ... | false | 0.081459 | 0.083609 | 0.974283 | [
"s569389887",
"s274333974"
] |
u780962115 | p02838 | python | s944391686 | s749170851 | 1,960 | 1,398 | 42,156 | 123,180 | Accepted | Accepted | 28.67 | n=int(eval(input()))
lists=list(map(int,input().split()))
length=61
use=[0 for i in range(61)]
a,b=divmod(n,9)
anslist=[0 for i in range(a+1)]
for j in range(n):
k=format(lists[j],"0%ib"%length)
k=k[::-1]
p,q=divmod(j,9)
if p>a:
anslist.append(str(k))
else:
anslist[p]+=... | import sys
input=sys.stdin.readline
n=int(eval(input()))
lists=list(map(int,input().split()))
length=61
use=[0 for i in range(61)]
a,b=divmod(n,9)
anslist=[0 for i in range(a+1)]
for j in range(n):
k=format(lists[j],"0%ib"%length)
k=k[::-1]
p,q=divmod(j,9)
if p>a:
anslist.append(st... | 25 | 27 | 581 | 620 | n = int(eval(input()))
lists = list(map(int, input().split()))
length = 61
use = [0 for i in range(61)]
a, b = divmod(n, 9)
anslist = [0 for i in range(a + 1)]
for j in range(n):
k = format(lists[j], "0%ib" % length)
k = k[::-1]
p, q = divmod(j, 9)
if p > a:
anslist.append(str(k))
else:
... | import sys
input = sys.stdin.readline
n = int(eval(input()))
lists = list(map(int, input().split()))
length = 61
use = [0 for i in range(61)]
a, b = divmod(n, 9)
anslist = [0 for i in range(a + 1)]
for j in range(n):
k = format(lists[j], "0%ib" % length)
k = k[::-1]
p, q = divmod(j, 9)
if p > a:
... | false | 7.407407 | [
"+import sys",
"+",
"+input = sys.stdin.readline"
] | false | 0.046612 | 0.038101 | 1.223384 | [
"s944391686",
"s749170851"
] |
u083960235 | p02792 | python | s828021550 | s951795812 | 236 | 215 | 5,144 | 5,192 | Accepted | Accepted | 8.9 | # 参考文献:tonnnura172
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import as... | import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii... | 57 | 63 | 1,433 | 1,530 | # 参考文献:tonnnura172
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_low... | import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_upper... | false | 9.52381 | [
"-# 参考文献:tonnnura172",
"-dic = defaultdict(int)",
"+# 二次元配列,他の要素まで書き変わらないように静的確保,意識",
"+# c = [[0] * 10] * 10",
"+c = [[0 for i in range(10)] for j in range(10)]",
"- dic[\"{},{}\".format(str(i)[0], str(i)[-1])] += 1",
"-# print(dic)",
"+ s_i = str(i)",
"+ # print(s_i)",
"+ first = int... | false | 0.071873 | 0.070741 | 1.015994 | [
"s828021550",
"s951795812"
] |
u368249389 | p03611 | python | s636257566 | s757876963 | 229 | 112 | 56,364 | 14,008 | Accepted | Accepted | 51.09 | # Problem C - Together
import collections
# input
N = int(eval(input()))
a_list = list(map(int, input().split()))
# initialization
num_counter = collections.Counter(a_list)
max_count = 0
# count
for k in list(num_counter.keys()):
nc = num_counter[k]
tmp_mae = num_counter[k-1]
tmp_ushiro ... | # Problem C - Together
# input
N = int(eval(input()))
a_nums = list(map(int, input().split()))
# initialization
nums = [0]*(10**5 + 1)
max_count = 0
# count
for a in a_nums:
nums[a] += 1
# max count
for i in range(10**5 + 1):
if i==0 or i==10**5:
continue
tmp_count = nums[i-1... | 21 | 24 | 416 | 411 | # Problem C - Together
import collections
# input
N = int(eval(input()))
a_list = list(map(int, input().split()))
# initialization
num_counter = collections.Counter(a_list)
max_count = 0
# count
for k in list(num_counter.keys()):
nc = num_counter[k]
tmp_mae = num_counter[k - 1]
tmp_ushiro = num_counter[k +... | # Problem C - Together
# input
N = int(eval(input()))
a_nums = list(map(int, input().split()))
# initialization
nums = [0] * (10**5 + 1)
max_count = 0
# count
for a in a_nums:
nums[a] += 1
# max count
for i in range(10**5 + 1):
if i == 0 or i == 10**5:
continue
tmp_count = nums[i - 1] + nums[i] + nu... | false | 12.5 | [
"-import collections",
"-",
"-a_list = list(map(int, input().split()))",
"+a_nums = list(map(int, input().split()))",
"-num_counter = collections.Counter(a_list)",
"+nums = [0] * (10**5 + 1)",
"-for k in list(num_counter.keys()):",
"- nc = num_counter[k]",
"- tmp_mae = num_counter[k - 1]",
"... | false | 0.040562 | 0.154108 | 0.263206 | [
"s636257566",
"s757876963"
] |
u989345508 | p03610 | python | s069362733 | s285879322 | 80 | 36 | 4,596 | 3,188 | Accepted | Accepted | 55 | s=input()
for i in range(len(s)):
if i%2==0:
print(s[i],end="")
print("")
| s=eval(input())
l=len(s)
t=""
for i in range(l):
if i%2==0:
t+=s[i]
print(t)
| 6 | 7 | 92 | 89 | s = input()
for i in range(len(s)):
if i % 2 == 0:
print(s[i], end="")
print("")
| s = eval(input())
l = len(s)
t = ""
for i in range(l):
if i % 2 == 0:
t += s[i]
print(t)
| false | 14.285714 | [
"-s = input()",
"-for i in range(len(s)):",
"+s = eval(input())",
"+l = len(s)",
"+t = \"\"",
"+for i in range(l):",
"- print(s[i], end=\"\")",
"-print(\"\")",
"+ t += s[i]",
"+print(t)"
] | false | 0.038526 | 0.039043 | 0.986738 | [
"s069362733",
"s285879322"
] |
u664373116 | p02911 | python | s779597515 | s655743543 | 718 | 242 | 17,128 | 8,640 | Accepted | Accepted | 66.3 | import numpy as np
N,K,Q=list(map(int,input().split()))
res=np.array([K-Q for _ in range(N)])
for _ in range(Q):
i=int(eval(input()))
res[i-1]+=1
for i in res:
if i>0:
print("Yes")
else:
print("No") | n,k,q=list(map(int,input().split()))
a=[int(eval(input())) for _ in range(q)]
c=q-k
if c<0:
for _ in range(n):
print("Yes")
exit()
cal=[0 for _ in range(n)]
for i in a:
cal[i-1]+=1
for i in range(n):
if cal[i]>c:
print("Yes")
else:
print("No") | 11 | 16 | 234 | 297 | import numpy as np
N, K, Q = list(map(int, input().split()))
res = np.array([K - Q for _ in range(N)])
for _ in range(Q):
i = int(eval(input()))
res[i - 1] += 1
for i in res:
if i > 0:
print("Yes")
else:
print("No")
| n, k, q = list(map(int, input().split()))
a = [int(eval(input())) for _ in range(q)]
c = q - k
if c < 0:
for _ in range(n):
print("Yes")
exit()
cal = [0 for _ in range(n)]
for i in a:
cal[i - 1] += 1
for i in range(n):
if cal[i] > c:
print("Yes")
else:
print("No")
| false | 31.25 | [
"-import numpy as np",
"-",
"-N, K, Q = list(map(int, input().split()))",
"-res = np.array([K - Q for _ in range(N)])",
"-for _ in range(Q):",
"- i = int(eval(input()))",
"- res[i - 1] += 1",
"-for i in res:",
"- if i > 0:",
"+n, k, q = list(map(int, input().split()))",
"+a = [int(eval(... | false | 0.234076 | 0.076609 | 3.055472 | [
"s779597515",
"s655743543"
] |
u074220993 | p03424 | python | s338144614 | s125500777 | 31 | 25 | 9,020 | 9,100 | Accepted | Accepted | 19.35 | N = int(eval(input()))
S = set(input().split())
print(('Three' if len(S) == 3 else 'Four')) | N = int(eval(input()))
S = input().split()
print(('Four' if 'Y' in S else 'Three')) | 3 | 3 | 85 | 77 | N = int(eval(input()))
S = set(input().split())
print(("Three" if len(S) == 3 else "Four"))
| N = int(eval(input()))
S = input().split()
print(("Four" if "Y" in S else "Three"))
| false | 0 | [
"-S = set(input().split())",
"-print((\"Three\" if len(S) == 3 else \"Four\"))",
"+S = input().split()",
"+print((\"Four\" if \"Y\" in S else \"Three\"))"
] | false | 0.040981 | 0.101011 | 0.405712 | [
"s338144614",
"s125500777"
] |
u188827677 | p02959 | python | s584274188 | s948363777 | 153 | 130 | 18,624 | 24,328 | Accepted | Accepted | 15.03 | n = int(eval(input()))
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = 0
t = 0
for i in range(n):
t = a[i]
if t >= b[i]:
t -= b[i]
ans += b[i]
else:
ans += t
b[i] -= t
t = 0
if b[i] <= a[i+1]:
ans += b[i]
a[i+1] -= b[i]
else:... | n = int(eval(input()))
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = 0
for i in range(n):
if a[i] >= b[i]:
ans += b[i]
else:
ans += a[i]
b[i] -= a[i]
if b[i] <= a[i+1]:
a[i+1] -= b[i]
ans += b[i]
else:
ans += a[i+1]
a[i+1] ... | 23 | 19 | 373 | 337 | n = int(eval(input()))
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = 0
t = 0
for i in range(n):
t = a[i]
if t >= b[i]:
t -= b[i]
ans += b[i]
else:
ans += t
b[i] -= t
t = 0
if b[i] <= a[i + 1]:
ans += b[i]
... | n = int(eval(input()))
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = 0
for i in range(n):
if a[i] >= b[i]:
ans += b[i]
else:
ans += a[i]
b[i] -= a[i]
if b[i] <= a[i + 1]:
a[i + 1] -= b[i]
ans += b[i]
else:
... | false | 17.391304 | [
"-t = 0",
"- t = a[i]",
"- if t >= b[i]:",
"- t -= b[i]",
"+ if a[i] >= b[i]:",
"- ans += t",
"- b[i] -= t",
"- t = 0",
"+ ans += a[i]",
"+ b[i] -= a[i]",
"+ a[i + 1] -= b[i]",
"- a[i + 1] -= b[i]"
] | false | 0.046624 | 0.044677 | 1.043592 | [
"s584274188",
"s948363777"
] |
u287132915 | p02616 | python | s244392471 | s567123519 | 327 | 138 | 104,428 | 108,280 | Accepted | Accepted | 57.8 | n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
mod = 10**9 + 7
ans = 1
if k == n:
for i in range(n):
ans *= a[i]
ans %= mod
print(ans)
exit()
if max(a) < 0 and k%2 == 1:
a.sort(reverse=True)
for i in range(k):
ans *= a[i]
an... | n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
mod = 10**9 + 7
ans = 1
if k == n:
for i in range(n):
ans *= a[i]
ans %= mod
print(ans)
exit()
if max(a) < 0 and k%2 == 1:
a.sort(reverse=True)
for i in range(k):
ans *= a[i]
an... | 66 | 54 | 1,587 | 1,213 | n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
mod = 10**9 + 7
ans = 1
if k == n:
for i in range(n):
ans *= a[i]
ans %= mod
print(ans)
exit()
if max(a) < 0 and k % 2 == 1:
a.sort(reverse=True)
for i in range(k):
ans *= a[i]
ans %= mod
p... | n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
mod = 10**9 + 7
ans = 1
if k == n:
for i in range(n):
ans *= a[i]
ans %= mod
print(ans)
exit()
if max(a) < 0 and k % 2 == 1:
a.sort(reverse=True)
for i in range(k):
ans *= a[i]
ans %= mod
p... | false | 18.181818 | [
"-a.sort(key=lambda x: abs(x))",
"-cnt = 0",
"-for i in range(1, k + 1):",
"- ans *= a[-i]",
"- ans %= mod",
"- if a[-i] < 0:",
"- cnt += 1",
"-if cnt % 2 == 0:",
"- print(ans)",
"-else:",
"- a_plus = None",
"- a_minus = None",
"- b_plus = None",
"- b_minus =... | false | 0.047558 | 0.042665 | 1.114687 | [
"s244392471",
"s567123519"
] |
u148551245 | p03359 | python | s163583538 | s104576030 | 164 | 17 | 38,256 | 2,940 | Accepted | Accepted | 89.63 | (a, b) = list(map(int, input().split()))
if a <= b:
print(a)
else:
print((a - 1)) | a, b = list(map(int, input().split()))
if b >= a:
ans = a
else:
ans = a-1
print(ans) | 5 | 6 | 85 | 91 | (a, b) = list(map(int, input().split()))
if a <= b:
print(a)
else:
print((a - 1))
| a, b = list(map(int, input().split()))
if b >= a:
ans = a
else:
ans = a - 1
print(ans)
| false | 16.666667 | [
"-(a, b) = list(map(int, input().split()))",
"-if a <= b:",
"- print(a)",
"+a, b = list(map(int, input().split()))",
"+if b >= a:",
"+ ans = a",
"- print((a - 1))",
"+ ans = a - 1",
"+print(ans)"
] | false | 0.107151 | 0.034355 | 3.118928 | [
"s163583538",
"s104576030"
] |
u597436499 | p03731 | python | s348664327 | s031228231 | 171 | 151 | 25,200 | 26,708 | Accepted | Accepted | 11.7 | N,T = list(map(int, input().split()))
t = list(map(int, input().split()))
x = T
for i in range(1,N):
if t[i]-t[i-1] >= T:
x += T
elif t[i]+T > T:
x += t[i]-t[i-1]
print(x)
| N,T = list(map(int, input().split()))
t = list(map(int, input().split()))
x = T
for i in range(1,N):
if t[i]-t[i-1] >= T:
x += T
else:
x += t[i]-t[i-1]
print(x)
| 10 | 10 | 200 | 189 | N, T = list(map(int, input().split()))
t = list(map(int, input().split()))
x = T
for i in range(1, N):
if t[i] - t[i - 1] >= T:
x += T
elif t[i] + T > T:
x += t[i] - t[i - 1]
print(x)
| N, T = list(map(int, input().split()))
t = list(map(int, input().split()))
x = T
for i in range(1, N):
if t[i] - t[i - 1] >= T:
x += T
else:
x += t[i] - t[i - 1]
print(x)
| false | 0 | [
"- elif t[i] + T > T:",
"+ else:"
] | false | 0.047244 | 0.048067 | 0.982893 | [
"s348664327",
"s031228231"
] |
u290563917 | p02837 | python | s169173384 | s173916349 | 316 | 234 | 44,380 | 44,400 | Accepted | Accepted | 25.95 | n = int(eval(input()))
a = [0] * n
s = [[]] * n
for i in range(n):
a[i] = int(eval(input()))
tmp = [[]] * a[i]
for j in range(a[i]):
tmp[j] = [num for num in map(int, input().split())]
s[i] = tmp
# print(n)
# print(a)
# print(s)
ans = 0
for i in range(2 ** n):
pattern = '{:0' + str(n) + 'b... | n = int(eval(input()))
a = [0] * n
sl = []
for i in range(n):
a = int(eval(input()))
s = []
for j in range(a):
x, y = list(map(int, input().split()))
s.append([x, y])
sl.append(s)
ans = 0
# bit 全探索
# 1 = 正直者、0 = 不親切な人
for i in range(1 << n):
#print('pattern', bin(i))
all_ok = Tr... | 35 | 46 | 766 | 1,031 | n = int(eval(input()))
a = [0] * n
s = [[]] * n
for i in range(n):
a[i] = int(eval(input()))
tmp = [[]] * a[i]
for j in range(a[i]):
tmp[j] = [num for num in map(int, input().split())]
s[i] = tmp
# print(n)
# print(a)
# print(s)
ans = 0
for i in range(2**n):
pattern = "{:0" + str(n) + "b}"
... | n = int(eval(input()))
a = [0] * n
sl = []
for i in range(n):
a = int(eval(input()))
s = []
for j in range(a):
x, y = list(map(int, input().split()))
s.append([x, y])
sl.append(s)
ans = 0
# bit 全探索
# 1 = 正直者、0 = 不親切な人
for i in range(1 << n):
# print('pattern', bin(i))
all_ok = Tr... | false | 23.913043 | [
"-s = [[]] * n",
"+sl = []",
"- a[i] = int(eval(input()))",
"- tmp = [[]] * a[i]",
"- for j in range(a[i]):",
"- tmp[j] = [num for num in map(int, input().split())]",
"- s[i] = tmp",
"-# print(n)",
"-# print(a)",
"-# print(s)",
"+ a = int(eval(input()))",
"+ s = []",
... | false | 0.040732 | 0.036524 | 1.115225 | [
"s169173384",
"s173916349"
] |
u493520238 | p03355 | python | s607300757 | s083067013 | 188 | 72 | 68,212 | 68,164 | Accepted | Accepted | 61.7 | s = eval(input())
k = int(eval(input()))
cnt = 0
alps = 'abcdefghijklmnopqrstuvwxyz'
for alp in alps:
inds = []
for i,si in enumerate(s):
if si == alp:
inds.append(i)
if inds:
s_set = set()
for ind in inds:
for i in range(1,6):
i... | s = eval(input())
k = int(eval(input()))
n = len(s)
ss = set()
for i in range(n):
for j in range(5):
if i+j < n:
ss.add(s[i:i+j+1])
sl = list(ss)
sl.sort()
print((sl[k-1])) | 23 | 13 | 548 | 196 | s = eval(input())
k = int(eval(input()))
cnt = 0
alps = "abcdefghijklmnopqrstuvwxyz"
for alp in alps:
inds = []
for i, si in enumerate(s):
if si == alp:
inds.append(i)
if inds:
s_set = set()
for ind in inds:
for i in range(1, 6):
if ind + i <= ... | s = eval(input())
k = int(eval(input()))
n = len(s)
ss = set()
for i in range(n):
for j in range(5):
if i + j < n:
ss.add(s[i : i + j + 1])
sl = list(ss)
sl.sort()
print((sl[k - 1]))
| false | 43.478261 | [
"-cnt = 0",
"-alps = \"abcdefghijklmnopqrstuvwxyz\"",
"-for alp in alps:",
"- inds = []",
"- for i, si in enumerate(s):",
"- if si == alp:",
"- inds.append(i)",
"- if inds:",
"- s_set = set()",
"- for ind in inds:",
"- for i in range(1, 6):",
... | false | 0.034065 | 0.032184 | 1.058428 | [
"s607300757",
"s083067013"
] |
u380524497 | p02814 | python | s864183863 | s762942340 | 513 | 278 | 16,540 | 21,180 | Accepted | Accepted | 45.81 | import fractions
def lcm(a, b):
return a * b // fractions.gcd(a, b)
def div_count_by_2(x):
count = 0
while x % 2 == 0:
count += 1
x //= 2
return count
n, m = list(map(int, input().split()))
A = list(map(int, input().split()))
num = A[0]
count = div_count_by_2(... | from math import gcd
from functools import reduce
import sys
input = sys.stdin.readline
def lcm(a, b):
return a*b // gcd(a, b)
def count_factor_2(num):
count = 0
while num % 2 == 0:
num //= 2
count += 1
return count
def main():
n, m = list(map(int, input().sp... | 34 | 35 | 517 | 624 | import fractions
def lcm(a, b):
return a * b // fractions.gcd(a, b)
def div_count_by_2(x):
count = 0
while x % 2 == 0:
count += 1
x //= 2
return count
n, m = list(map(int, input().split()))
A = list(map(int, input().split()))
num = A[0]
count = div_count_by_2(num)
for a in A:
i... | from math import gcd
from functools import reduce
import sys
input = sys.stdin.readline
def lcm(a, b):
return a * b // gcd(a, b)
def count_factor_2(num):
count = 0
while num % 2 == 0:
num //= 2
count += 1
return count
def main():
n, m = list(map(int, input().split()))
A = ... | false | 2.857143 | [
"-import fractions",
"+from math import gcd",
"+from functools import reduce",
"+import sys",
"+",
"+input = sys.stdin.readline",
"- return a * b // fractions.gcd(a, b)",
"+ return a * b // gcd(a, b)",
"-def div_count_by_2(x):",
"+def count_factor_2(num):",
"- while x % 2 == 0:",
"+ ... | false | 0.04291 | 0.067457 | 0.636108 | [
"s864183863",
"s762942340"
] |
u159994501 | p02873 | python | s600963791 | s509470904 | 272 | 251 | 9,776 | 9,776 | Accepted | Accepted | 7.72 | S = list(eval(input()))
if S == ['>'] or S == ['<']:
print((1))
exit()
m = 0
n = 0
s = 0
l = []
if S[0] == '>':
l.append(0)
p = '>'
else:
p = '<'
c = 1
for i in range(1, len(S)):
if S[i] == p:
c += 1
else:
l.append(c)
c = 1
p = S[i]
if c !... | S = list(eval(input()))
if S == ['>'] or S == ['<']:
print((1))
exit()
l = []
if S[0] == '>':
l.append(0)
p = '>'
else:
p = '<'
c = 1
for i in range(1, len(S)):
if S[i] == p:
c += 1
else:
l.append(c)
c = 1
p = S[i]
if c != 0:
l.append(c)... | 40 | 32 | 654 | 513 | S = list(eval(input()))
if S == [">"] or S == ["<"]:
print((1))
exit()
m = 0
n = 0
s = 0
l = []
if S[0] == ">":
l.append(0)
p = ">"
else:
p = "<"
c = 1
for i in range(1, len(S)):
if S[i] == p:
c += 1
else:
l.append(c)
c = 1
p = S[i]
if c != 0:
l.append(c)
... | S = list(eval(input()))
if S == [">"] or S == ["<"]:
print((1))
exit()
l = []
if S[0] == ">":
l.append(0)
p = ">"
else:
p = "<"
c = 1
for i in range(1, len(S)):
if S[i] == p:
c += 1
else:
l.append(c)
c = 1
p = S[i]
if c != 0:
l.append(c)
if S[-1] == "<":
... | false | 20 | [
"-m = 0",
"-n = 0",
"-s = 0",
"-# print(l)",
"- if x == 0:",
"- return 0",
"- elif x == 1:",
"- return 1",
"- else:",
"- return (1 + x) * x // 2",
"+ return (1 + x) * x // 2",
"- # print(l[i], l[i+1])"
] | false | 0.045218 | 0.119938 | 0.377009 | [
"s600963791",
"s509470904"
] |
u078276601 | p03853 | python | s537710768 | s002757793 | 28 | 25 | 9,072 | 9,060 | Accepted | Accepted | 10.71 | H,W = list(map(int, input().split()))
for i in range(H):
x = eval(input())
print(x)
print(x) | H,W = list(map(int, input().split()))
C = [eval(input()) for i in range(H)]
for i in range(H):
print((C[i]))
print((C[i])) | 6 | 7 | 98 | 122 | H, W = list(map(int, input().split()))
for i in range(H):
x = eval(input())
print(x)
print(x)
| H, W = list(map(int, input().split()))
C = [eval(input()) for i in range(H)]
for i in range(H):
print((C[i]))
print((C[i]))
| false | 14.285714 | [
"+C = [eval(input()) for i in range(H)]",
"- x = eval(input())",
"- print(x)",
"- print(x)",
"+ print((C[i]))",
"+ print((C[i]))"
] | false | 0.041853 | 0.047638 | 0.878571 | [
"s537710768",
"s002757793"
] |
u577300110 | p02659 | python | s933206668 | s560971901 | 23 | 21 | 9,088 | 9,172 | Accepted | Accepted | 8.7 | import math
a,b=input().split()
a=int(a)
b=round(float(b)*100)
n=int((a*b)//100)
print(n) | a,b=input().split()
a=int(a)
b=round(float(b)*100)
n=(a*b)//100
print((int(n))) | 6 | 5 | 94 | 81 | import math
a, b = input().split()
a = int(a)
b = round(float(b) * 100)
n = int((a * b) // 100)
print(n)
| a, b = input().split()
a = int(a)
b = round(float(b) * 100)
n = (a * b) // 100
print((int(n)))
| false | 16.666667 | [
"-import math",
"-",
"-n = int((a * b) // 100)",
"-print(n)",
"+n = (a * b) // 100",
"+print((int(n)))"
] | false | 0.084978 | 0.035534 | 2.391432 | [
"s933206668",
"s560971901"
] |
u514118270 | p02953 | python | s748457976 | s166570255 | 155 | 121 | 14,224 | 92,528 | Accepted | Accepted | 21.94 | n = int(eval(input()))
A = list(map(int,input().split()))
ans = 0
for i in range(n-1):
if ans > A[i+1]:
print('No')
exit()
if A[i+1]-A[i] >= -1:
ans = max(A[i+1]-1,A[i]-1,ans)
if A[i+1] >= A[i] and A[i+1] > ans :
A[i+1] -=1
else:
print('No')
exit()
print('Yes') | import sys
import math
import itertools
import bisect
from copy import copy,deepcopy
from collections import deque,Counter
from decimal import Decimal
def s(): return eval(input())
def i(): return int(eval(input()))
def S(): return input().split()
def I(): return list(map(int,input().split()))
def L(): retur... | 15 | 28 | 305 | 657 | n = int(eval(input()))
A = list(map(int, input().split()))
ans = 0
for i in range(n - 1):
if ans > A[i + 1]:
print("No")
exit()
if A[i + 1] - A[i] >= -1:
ans = max(A[i + 1] - 1, A[i] - 1, ans)
if A[i + 1] >= A[i] and A[i + 1] > ans:
A[i + 1] -= 1
else:
pri... | import sys
import math
import itertools
import bisect
from copy import copy, deepcopy
from collections import deque, Counter
from decimal import Decimal
def s():
return eval(input())
def i():
return int(eval(input()))
def S():
return input().split()
def I():
return list(map(int, input().split())... | false | 46.428571 | [
"-n = int(eval(input()))",
"-A = list(map(int, input().split()))",
"-ans = 0",
"-for i in range(n - 1):",
"- if ans > A[i + 1]:",
"+import sys",
"+import math",
"+import itertools",
"+import bisect",
"+from copy import copy, deepcopy",
"+from collections import deque, Counter",
"+from decim... | false | 0.080696 | 0.035054 | 2.302005 | [
"s748457976",
"s166570255"
] |
u995004106 | p02616 | python | s412841747 | s876045454 | 279 | 185 | 109,636 | 112,700 | Accepted | Accepted | 33.69 | import math
import fractions
import collections
import itertools
import pprint
from collections import deque
N,K=list(map(int,input().split()))
A=list(map(int,input().split()))
plist=[]
mlist=[]
ans=1
p=10**9+7
for i in range(N):
if A[i]>=0:
plist.append(A[i])
else:
mlist.append(... | import math
import fractions
import collections
import itertools
import pprint
from collections import deque
N,K=list(map(int,input().split()))
A=list(map(int,input().split()))
plist=[]
mlist=[]
ans=1
p=10**9+7
for i in range(N):
if A[i]>=0:
plist.append(A[i])
else:
mlist.append(... | 76 | 69 | 1,817 | 1,643 | import math
import fractions
import collections
import itertools
import pprint
from collections import deque
N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
plist = []
mlist = []
ans = 1
p = 10**9 + 7
for i in range(N):
if A[i] >= 0:
plist.append(A[i])
else:
mlist.app... | import math
import fractions
import collections
import itertools
import pprint
from collections import deque
N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
plist = []
mlist = []
ans = 1
p = 10**9 + 7
for i in range(N):
if A[i] >= 0:
plist.append(A[i])
else:
mlist.app... | false | 9.210526 | [
"- print((ans % p))",
"-elif len(plist) == 1:",
"- # print(plist,mlist)",
"- mlist.sort()",
"- if K % 2 == 1:",
"- ans = plist[0]",
"- for i in range(K - 1):",
"- ans = (ans * mlist[i]) % p"
] | false | 0.036757 | 0.036728 | 1.000785 | [
"s412841747",
"s876045454"
] |
u190178779 | p03085 | python | s479943870 | s808363377 | 27 | 22 | 9,060 | 8,964 | Accepted | Accepted | 18.52 | import sys
b = eval(input())
if not ( b == 'A' or b == 'T' or b == 'G' or b == 'C' ): sys.exit()
if b == 'T': print('A')
if b == 'A': print('T')
if b == 'C': print('G')
if b == 'G': print('C') | import sys
b = eval(input())
if not ( b == 'A' or b == 'T' or b == 'G' or b == 'C' ): sys.exit()
base = { 'A':'T', 'T':'A', 'G':'C', 'C':'G' }
print((base[b])) | 8 | 6 | 194 | 157 | import sys
b = eval(input())
if not (b == "A" or b == "T" or b == "G" or b == "C"):
sys.exit()
if b == "T":
print("A")
if b == "A":
print("T")
if b == "C":
print("G")
if b == "G":
print("C")
| import sys
b = eval(input())
if not (b == "A" or b == "T" or b == "G" or b == "C"):
sys.exit()
base = {"A": "T", "T": "A", "G": "C", "C": "G"}
print((base[b]))
| false | 25 | [
"-if b == \"T\":",
"- print(\"A\")",
"-if b == \"A\":",
"- print(\"T\")",
"-if b == \"C\":",
"- print(\"G\")",
"-if b == \"G\":",
"- print(\"C\")",
"+base = {\"A\": \"T\", \"T\": \"A\", \"G\": \"C\", \"C\": \"G\"}",
"+print((base[b]))"
] | false | 0.037235 | 0.039302 | 0.947428 | [
"s479943870",
"s808363377"
] |
u483645888 | p03103 | python | s352547499 | s044713540 | 1,026 | 203 | 31,448 | 25,828 | Accepted | Accepted | 80.21 | import numpy as np
n, m = list(map(int, input().split()))
f = lambda:list(map(int, input().split()))
arr = np.zeros((n,2),'i8')
#print(arr)
Q = m
price = 0
for i in range(n):
p, q = f()
#print(p,q)
arr[i] = (p,q)
arr = sorted(arr.tolist())
#print(arr)
while Q>0:
for i in range(n):
p = arr[i... | import sys
n, m,*l = list(map(int, sys.stdin.read().split()))
#print(n,m,l)
a = 0
for p, q in sorted(zip(l[::2],l[1::2])):
a += p*min(q,m)
m -= q
if m <= 0:
print(a)
break | 29 | 10 | 504 | 188 | import numpy as np
n, m = list(map(int, input().split()))
f = lambda: list(map(int, input().split()))
arr = np.zeros((n, 2), "i8")
# print(arr)
Q = m
price = 0
for i in range(n):
p, q = f()
# print(p,q)
arr[i] = (p, q)
arr = sorted(arr.tolist())
# print(arr)
while Q > 0:
for i in range(n):
p = ... | import sys
n, m, *l = list(map(int, sys.stdin.read().split()))
# print(n,m,l)
a = 0
for p, q in sorted(zip(l[::2], l[1::2])):
a += p * min(q, m)
m -= q
if m <= 0:
print(a)
break
| false | 65.517241 | [
"-import numpy as np",
"+import sys",
"-n, m = list(map(int, input().split()))",
"-f = lambda: list(map(int, input().split()))",
"-arr = np.zeros((n, 2), \"i8\")",
"-# print(arr)",
"-Q = m",
"-price = 0",
"-for i in range(n):",
"- p, q = f()",
"- # print(p,q)",
"- arr[i] = (p, q)",
... | false | 0.447401 | 0.04052 | 11.041407 | [
"s352547499",
"s044713540"
] |
u623814058 | p03836 | python | s583642896 | s199130622 | 31 | 27 | 9,276 | 9,128 | Accepted | Accepted | 12.9 | SX,SY,TX,TY=list(map(int,input().split()))
dt={'U':'D','D':'U','L':'R','R':'L'}
def f(s):
t=''
for a in s:
t+=dt[a]
return t
vx=TX-SX
vy=TY-SY
ans1=''
ans1=('U' if 0<=vy else 'D')*abs(vy)
ans1+=('R' if 0<=vx else 'L')*abs(vx)
ans1+=f(ans1)
ans2=''
ans2=('R' if 0<=-vx else 'L'... | SX,SY,TX,TY=list(map(int,input().split()))
dt={'U':'D','D':'U','L':'R','R':'L'}
def f(s):
t=''
for a in s:t+=dt[a]
return t
vx=TX-SX
vy=TY-SY
ans1='U'*vy+'R'*vx
ans1+=f(ans1)
ans2='L'+'U'*(vy+1)+'R'*(vx+1)+'D'
ans2+=f(ans2)
print((ans1+ans2)) | 25 | 16 | 463 | 255 | SX, SY, TX, TY = list(map(int, input().split()))
dt = {"U": "D", "D": "U", "L": "R", "R": "L"}
def f(s):
t = ""
for a in s:
t += dt[a]
return t
vx = TX - SX
vy = TY - SY
ans1 = ""
ans1 = ("U" if 0 <= vy else "D") * abs(vy)
ans1 += ("R" if 0 <= vx else "L") * abs(vx)
ans1 += f(ans1)
ans2 = ""
ans... | SX, SY, TX, TY = list(map(int, input().split()))
dt = {"U": "D", "D": "U", "L": "R", "R": "L"}
def f(s):
t = ""
for a in s:
t += dt[a]
return t
vx = TX - SX
vy = TY - SY
ans1 = "U" * vy + "R" * vx
ans1 += f(ans1)
ans2 = "L" + "U" * (vy + 1) + "R" * (vx + 1) + "D"
ans2 += f(ans2)
print((ans1 + an... | false | 36 | [
"-ans1 = \"\"",
"-ans1 = (\"U\" if 0 <= vy else \"D\") * abs(vy)",
"-ans1 += (\"R\" if 0 <= vx else \"L\") * abs(vx)",
"+ans1 = \"U\" * vy + \"R\" * vx",
"-ans2 = \"\"",
"-ans2 = \"R\" if 0 <= -vx else \"L\"",
"-ans2 += (\"U\" if 0 <= vy else \"D\") * abs(vy + 1)",
"-ans2 += (\"R\" if 0 <= vx else \"L... | false | 0.043926 | 0.062596 | 0.701734 | [
"s583642896",
"s199130622"
] |
u729133443 | p03840 | python | s303346202 | s269354379 | 31 | 27 | 9,116 | 9,128 | Accepted | Accepted | 12.9 | I,O,T,J,L,S,Z=list(map(int,input().split()))
print((max((~-I//2+~-J//2+~-L//2)*2+O+3*(I>0<L>0<J),(I//2+J//2+L//2)*2+O))) | I,O,T,J,L,S,Z=list(map(int,input().split()))
print((max((~-I//2+~-J//2+~-L//2)*2+3*(I>0<L>0<J),I//2+J//2+L//2<<1)+O)) | 2 | 2 | 113 | 110 | I, O, T, J, L, S, Z = list(map(int, input().split()))
print(
(
max(
(~-I // 2 + ~-J // 2 + ~-L // 2) * 2 + O + 3 * (I > 0 < L > 0 < J),
(I // 2 + J // 2 + L // 2) * 2 + O,
)
)
)
| I, O, T, J, L, S, Z = list(map(int, input().split()))
print(
(
max(
(~-I // 2 + ~-J // 2 + ~-L // 2) * 2 + 3 * (I > 0 < L > 0 < J),
I // 2 + J // 2 + L // 2 << 1,
)
+ O
)
)
| false | 0 | [
"- (~-I // 2 + ~-J // 2 + ~-L // 2) * 2 + O + 3 * (I > 0 < L > 0 < J),",
"- (I // 2 + J // 2 + L // 2) * 2 + O,",
"+ (~-I // 2 + ~-J // 2 + ~-L // 2) * 2 + 3 * (I > 0 < L > 0 < J),",
"+ I // 2 + J // 2 + L // 2 << 1,",
"+ + O"
] | false | 0.035022 | 0.03728 | 0.939424 | [
"s303346202",
"s269354379"
] |
u813098295 | p03633 | python | s520837701 | s461787290 | 48 | 17 | 5,032 | 2,940 | Accepted | Accepted | 64.58 | import fractions
def lcm(a, b):
return a / fractions.gcd(a, b) * b
N = int(input())
T = [int(input()) for _ in range(N)]
ans = 1
for i in T:
ans = lcm(ans, i)
print(ans)
| def gcd(x, y):
return x if y == 0 else gcd(y, x % y)
def lcm(x, y):
return x//gcd(x, y)*y
n = int(eval(input()))
ans = 1
for i in range(n):
t = int(eval(input()))
ans = lcm(ans, t)
print(ans) | 14 | 15 | 204 | 214 | import fractions
def lcm(a, b):
return a / fractions.gcd(a, b) * b
N = int(input())
T = [int(input()) for _ in range(N)]
ans = 1
for i in T:
ans = lcm(ans, i)
print(ans)
| def gcd(x, y):
return x if y == 0 else gcd(y, x % y)
def lcm(x, y):
return x // gcd(x, y) * y
n = int(eval(input()))
ans = 1
for i in range(n):
t = int(eval(input()))
ans = lcm(ans, t)
print(ans)
| false | 6.666667 | [
"-import fractions",
"+def gcd(x, y):",
"+ return x if y == 0 else gcd(y, x % y)",
"-def lcm(a, b):",
"- return a / fractions.gcd(a, b) * b",
"+def lcm(x, y):",
"+ return x // gcd(x, y) * y",
"-N = int(input())",
"-T = [int(input()) for _ in range(N)]",
"+n = int(eval(input()))",
"-for ... | false | 0.102338 | 0.061458 | 1.665187 | [
"s520837701",
"s461787290"
] |
u519968172 | p02600 | python | s662463342 | s081128481 | 86 | 75 | 61,636 | 61,784 | Accepted | Accepted | 12.79 | x=int(eval(input()))
l=[[600,8],[800,7],[1000,6],[1200,5],[1400,4],[1600,3],[1800,2],[2000,1]]
for m in l:
if x<m[0]:
print((m[1]))
break | x=int(eval(input()))
for i in range(3,11):
if x<i*200:
print((11-i))
break | 7 | 5 | 146 | 80 | x = int(eval(input()))
l = [
[600, 8],
[800, 7],
[1000, 6],
[1200, 5],
[1400, 4],
[1600, 3],
[1800, 2],
[2000, 1],
]
for m in l:
if x < m[0]:
print((m[1]))
break
| x = int(eval(input()))
for i in range(3, 11):
if x < i * 200:
print((11 - i))
break
| false | 28.571429 | [
"-l = [",
"- [600, 8],",
"- [800, 7],",
"- [1000, 6],",
"- [1200, 5],",
"- [1400, 4],",
"- [1600, 3],",
"- [1800, 2],",
"- [2000, 1],",
"-]",
"-for m in l:",
"- if x < m[0]:",
"- print((m[1]))",
"+for i in range(3, 11):",
"+ if x < i * 200:",
"+ ... | false | 0.041628 | 0.042572 | 0.977814 | [
"s662463342",
"s081128481"
] |
u077291787 | p03170 | python | s571463444 | s718734115 | 257 | 209 | 39,792 | 40,048 | Accepted | Accepted | 18.68 | # K - Stones
def main():
N, K, *A = list(map(int, open(0).read().split()))
dp = [0] * (K + 1)
for i in range(1, K + 1):
for a in A:
if i - a >= 0:
dp[i] |= dp[i - a] ^ 1
print(("First" if dp[-1] else "Second"))
if __name__ == "__main__":
main()
| # K - Stones
def main():
N, K, *A = list(map(int, open(0).read().split()))
dp = [0] * (K + 1)
for i in range(1, K + 1):
for a in A:
if i - a >= 0:
dp[i] |= dp[i - a] ^ 1
if dp[i]:
break
print(("First" if dp[-1] else "Second"))
... | 13 | 15 | 307 | 353 | # K - Stones
def main():
N, K, *A = list(map(int, open(0).read().split()))
dp = [0] * (K + 1)
for i in range(1, K + 1):
for a in A:
if i - a >= 0:
dp[i] |= dp[i - a] ^ 1
print(("First" if dp[-1] else "Second"))
if __name__ == "__main__":
main()
| # K - Stones
def main():
N, K, *A = list(map(int, open(0).read().split()))
dp = [0] * (K + 1)
for i in range(1, K + 1):
for a in A:
if i - a >= 0:
dp[i] |= dp[i - a] ^ 1
if dp[i]:
break
print(("First" if dp[-1] else "Second"))
if __name__... | false | 13.333333 | [
"+ if dp[i]:",
"+ break"
] | false | 0.113247 | 0.099242 | 1.141122 | [
"s571463444",
"s718734115"
] |
u905582793 | p02716 | python | s879358230 | s931169255 | 365 | 184 | 53,768 | 31,416 | Accepted | Accepted | 49.59 | n = int(eval(input()))
a = list(map(int,input().split()))
dp = [[0 for i in range(3)] for j in range(n+1)]
for i in range(1,n+1):
ai = a[i-1]
dp[i] = dp[i-1][:]
if i%2:
dp[i][0] += +ai
dp[i][1] = max(dp[i-1][0],dp[i-1][1])
if i%2 == 0:
dp[i][1] += ai
dp[i][2] = max(dp[i-1][1],dp[i-1][... | n = int(eval(input()))
a = list(map(int,input().split()))
dp = [0 for i in range(3)]
for i in range(1,n+1):
ai = a[i-1]
if i%2:
dp[1] = max(dp[0],dp[1])
dp[0] += ai
if i%2 == 0:
dp[2] = max(dp[1],dp[2])
dp[1] += ai
if i >= 3 and i%2:
dp[2] += ai
if n%2 == 0:
print((max(dp[0],... | 18 | 17 | 450 | 354 | n = int(eval(input()))
a = list(map(int, input().split()))
dp = [[0 for i in range(3)] for j in range(n + 1)]
for i in range(1, n + 1):
ai = a[i - 1]
dp[i] = dp[i - 1][:]
if i % 2:
dp[i][0] += +ai
dp[i][1] = max(dp[i - 1][0], dp[i - 1][1])
if i % 2 == 0:
dp[i][1] += ai
dp... | n = int(eval(input()))
a = list(map(int, input().split()))
dp = [0 for i in range(3)]
for i in range(1, n + 1):
ai = a[i - 1]
if i % 2:
dp[1] = max(dp[0], dp[1])
dp[0] += ai
if i % 2 == 0:
dp[2] = max(dp[1], dp[2])
dp[1] += ai
if i >= 3 and i % 2:
dp[2] += ai
if n... | false | 5.555556 | [
"-dp = [[0 for i in range(3)] for j in range(n + 1)]",
"+dp = [0 for i in range(3)]",
"- dp[i] = dp[i - 1][:]",
"- dp[i][0] += +ai",
"- dp[i][1] = max(dp[i - 1][0], dp[i - 1][1])",
"+ dp[1] = max(dp[0], dp[1])",
"+ dp[0] += ai",
"- dp[i][1] += ai",
"- dp[... | false | 0.047535 | 0.069282 | 0.686116 | [
"s879358230",
"s931169255"
] |
u354916249 | p02983 | python | s403109026 | s832077119 | 1,432 | 695 | 2,940 | 2,940 | Accepted | Accepted | 51.47 | L, R = list(map(int, input().split()))
l = L % 2019
r = R % 2019
ans = 2019*2019
if L // 2019 == R // 2019:
# print(l,r)
for i in range(l, r):
# print('i', i)
for j in range(l+1,r+1):
# print('j', j)
ans = min(ans, (i*j)%2019)
else:
ans = 0
prin... | L, R = list(map(int, input().split()))
l = L % 2019
r = R % 2019
ans = 2019*2019
if L // 2019 == R // 2019:
# print(l,r)
for i in range(l, r):
# print('i', i)
for j in range(i+1,r+1):
# print('j', j)
ans = min(ans, (i*j)%2019)
else:
ans = 0
prin... | 19 | 19 | 321 | 321 | L, R = list(map(int, input().split()))
l = L % 2019
r = R % 2019
ans = 2019 * 2019
if L // 2019 == R // 2019:
# print(l,r)
for i in range(l, r):
# print('i', i)
for j in range(l + 1, r + 1):
# print('j', j)
ans = min(ans, (i * j) % 2019)
else:
ans = 0
print(ans)
| L, R = list(map(int, input().split()))
l = L % 2019
r = R % 2019
ans = 2019 * 2019
if L // 2019 == R // 2019:
# print(l,r)
for i in range(l, r):
# print('i', i)
for j in range(i + 1, r + 1):
# print('j', j)
ans = min(ans, (i * j) % 2019)
else:
ans = 0
print(ans)
| false | 0 | [
"- for j in range(l + 1, r + 1):",
"+ for j in range(i + 1, r + 1):"
] | false | 0.037865 | 0.042268 | 0.89584 | [
"s403109026",
"s832077119"
] |
u017415492 | p02642 | python | s887500373 | s141509715 | 450 | 361 | 44,612 | 43,248 | Accepted | Accepted | 19.78 | from collections import Counter
n = int(eval(input()))
a = [int(v) for v in input().split()]
M = max(a)
d = [1 for i in range(M+1)]
for v in sorted(a):
for j in range(2*v, M+1, v):
d[j] = 0
ans = 0
c = Counter(a)
for i in a:
if c[i]==1:
ans += d[i]
print(ans) | from collections import Counter
n=int(eval(input()))
a=list(map(int,input().split()))
ma=max(a)
a.sort()
era=[1]*(ma+1)
#0と1はふるいにかけられている。
cn=Counter(a)
count=0
for i in range(n):
if era[a[i]]==0:continue
else:
era[a[i]]=0
if cn[a[i]]==1:
count+=1
for j in range(2*a[i],ma+1,a[i]):
... | 15 | 19 | 291 | 343 | from collections import Counter
n = int(eval(input()))
a = [int(v) for v in input().split()]
M = max(a)
d = [1 for i in range(M + 1)]
for v in sorted(a):
for j in range(2 * v, M + 1, v):
d[j] = 0
ans = 0
c = Counter(a)
for i in a:
if c[i] == 1:
ans += d[i]
print(ans)
| from collections import Counter
n = int(eval(input()))
a = list(map(int, input().split()))
ma = max(a)
a.sort()
era = [1] * (ma + 1)
# 0と1はふるいにかけられている。
cn = Counter(a)
count = 0
for i in range(n):
if era[a[i]] == 0:
continue
else:
era[a[i]] = 0
if cn[a[i]] == 1:
count += 1
... | false | 21.052632 | [
"-a = [int(v) for v in input().split()]",
"-M = max(a)",
"-d = [1 for i in range(M + 1)]",
"-for v in sorted(a):",
"- for j in range(2 * v, M + 1, v):",
"- d[j] = 0",
"-ans = 0",
"-c = Counter(a)",
"-for i in a:",
"- if c[i] == 1:",
"- ans += d[i]",
"-print(ans)",
"+a = l... | false | 0.049127 | 0.041067 | 1.196276 | [
"s887500373",
"s141509715"
] |
u864197622 | p02763 | python | s418919384 | s354568140 | 610 | 420 | 77,976 | 75,720 | Accepted | Accepted | 31.15 | NN = 19
X = [0] * ((1<<NN+1)-1)
def popcount(x):
x -= (x >> 1) & 0x55555555
x = (x & 0x33333333) + ((x >> 2) & 0x33333333)
x = (x + (x >> 4)) & 0x0f0f0f0f
x += x >> 8
x += x >> 16
return x & 0x3f
def update(a, x):
i = (1<<NN) - 1 + a
X[i] = x
while i:
i = (i... | import sys
input = lambda: sys.stdin.readline().rstrip()
NN = 19
X = [0] * ((1<<NN+1)-1)
def popcount(x):
x -= (x >> 1) & 0x55555555
x = (x & 0x33333333) + ((x >> 2) & 0x33333333)
x = (x + (x >> 4)) & 0x0f0f0f0f
x += x >> 8
x += x >> 16
return x & 0x3f
def update(a, x):
i = ... | 50 | 52 | 1,059 | 1,119 | NN = 19
X = [0] * ((1 << NN + 1) - 1)
def popcount(x):
x -= (x >> 1) & 0x55555555
x = (x & 0x33333333) + ((x >> 2) & 0x33333333)
x = (x + (x >> 4)) & 0x0F0F0F0F
x += x >> 8
x += x >> 16
return x & 0x3F
def update(a, x):
i = (1 << NN) - 1 + a
X[i] = x
while i:
i = (i - 1) ... | import sys
input = lambda: sys.stdin.readline().rstrip()
NN = 19
X = [0] * ((1 << NN + 1) - 1)
def popcount(x):
x -= (x >> 1) & 0x55555555
x = (x & 0x33333333) + ((x >> 2) & 0x33333333)
x = (x + (x >> 4)) & 0x0F0F0F0F
x += x >> 8
x += x >> 16
return x & 0x3F
def update(a, x):
i = (1 << ... | false | 3.846154 | [
"+import sys",
"+",
"+input = lambda: sys.stdin.readline().rstrip()"
] | false | 0.058244 | 0.067359 | 0.864684 | [
"s418919384",
"s354568140"
] |
u667024514 | p03077 | python | s259986750 | s792650689 | 19 | 17 | 3,064 | 2,940 | Accepted | Accepted | 10.53 | n = int(eval(input()))
lis = [int(eval(input())) for i in range(5)]
key = 0
if n % min(lis) == 0:key = 1
print((5 + n//min(lis)-key)) | n = int(eval(input()))
nu = min([int(eval(input())) for i in range(5)])
print((4 + bool(n%nu) + n//nu)) | 5 | 3 | 123 | 91 | n = int(eval(input()))
lis = [int(eval(input())) for i in range(5)]
key = 0
if n % min(lis) == 0:
key = 1
print((5 + n // min(lis) - key))
| n = int(eval(input()))
nu = min([int(eval(input())) for i in range(5)])
print((4 + bool(n % nu) + n // nu))
| false | 40 | [
"-lis = [int(eval(input())) for i in range(5)]",
"-key = 0",
"-if n % min(lis) == 0:",
"- key = 1",
"-print((5 + n // min(lis) - key))",
"+nu = min([int(eval(input())) for i in range(5)])",
"+print((4 + bool(n % nu) + n // nu))"
] | false | 0.061771 | 0.048222 | 1.280976 | [
"s259986750",
"s792650689"
] |
u821624310 | p02401 | python | s000207840 | s731393318 | 30 | 20 | 7,640 | 7,636 | Accepted | Accepted | 33.33 | while 1:
a, op, b = input().split()
a = int(a)
b = int(b)
if op == "?":
break
elif op == "+":
print((a + b))
elif op == "-":
print((a - b))
elif op == "*":
print((a * b))
elif op == "/":
print((int(a / b)))
| op = ""
while op != "?":
a, op, b = input().split()
a = int(a)
b = int(b)
if op == "+":
print((a + b))
elif op == "-":
print((a - b))
elif op == "*":
print((a * b))
elif op == "/":
print((int(a / b)))
elif op == "?":
break | 15 | 15 | 293 | 300 | while 1:
a, op, b = input().split()
a = int(a)
b = int(b)
if op == "?":
break
elif op == "+":
print((a + b))
elif op == "-":
print((a - b))
elif op == "*":
print((a * b))
elif op == "/":
print((int(a / b)))
| op = ""
while op != "?":
a, op, b = input().split()
a = int(a)
b = int(b)
if op == "+":
print((a + b))
elif op == "-":
print((a - b))
elif op == "*":
print((a * b))
elif op == "/":
print((int(a / b)))
elif op == "?":
break
| false | 0 | [
"-while 1:",
"+op = \"\"",
"+while op != \"?\":",
"- if op == \"?\":",
"- break",
"- elif op == \"+\":",
"+ if op == \"+\":",
"+ elif op == \"?\":",
"+ break"
] | false | 0.037726 | 0.039421 | 0.956997 | [
"s000207840",
"s731393318"
] |
u322354465 | p03493 | python | s804424182 | s252419357 | 20 | 17 | 3,316 | 2,940 | Accepted | Accepted | 15 | import collections
print((collections.Counter(eval(input()))['1'])) | # import collections
# print(collections.Counter(input())['1'])
print((input().count('1'))) | 3 | 5 | 62 | 95 | import collections
print((collections.Counter(eval(input()))["1"]))
| # import collections
# print(collections.Counter(input())['1'])
print((input().count("1")))
| false | 40 | [
"-import collections",
"-",
"-print((collections.Counter(eval(input()))[\"1\"]))",
"+# import collections",
"+# print(collections.Counter(input())['1'])",
"+print((input().count(\"1\")))"
] | false | 0.119675 | 0.047444 | 2.522463 | [
"s804424182",
"s252419357"
] |
u094191970 | p03786 | python | s873132457 | s469514001 | 118 | 96 | 20,060 | 20,236 | Accepted | Accepted | 18.64 | from sys import stdin
nii=lambda:list(map(int,stdin.readline().split()))
lnii=lambda:list(map(int,stdin.readline().split()))
n=int(eval(input()))
a=lnii()
a.sort()
b=[0]
for i in range(1,n+1):
b.append(b[i-1]+a[i-1])
b=b[1:]
ans=1
for i in range(n-2,-1,-1):
if b[i]*2>=a[i+1]:
ans+=1
else:
... | from sys import stdin
nii=lambda:list(map(int,stdin.readline().split()))
lnii=lambda:list(map(int,stdin.readline().split()))
n=int(eval(input()))
a=lnii()
a.sort()
sum_v=0
ans=0
for i in range(n-1):
sum_v+=a[i]
if sum_v*2>=a[i+1]:
ans+=1
else:
ans=0
ans+=1
print(ans) | 21 | 19 | 332 | 290 | from sys import stdin
nii = lambda: list(map(int, stdin.readline().split()))
lnii = lambda: list(map(int, stdin.readline().split()))
n = int(eval(input()))
a = lnii()
a.sort()
b = [0]
for i in range(1, n + 1):
b.append(b[i - 1] + a[i - 1])
b = b[1:]
ans = 1
for i in range(n - 2, -1, -1):
if b[i] * 2 >= a[i + 1... | from sys import stdin
nii = lambda: list(map(int, stdin.readline().split()))
lnii = lambda: list(map(int, stdin.readline().split()))
n = int(eval(input()))
a = lnii()
a.sort()
sum_v = 0
ans = 0
for i in range(n - 1):
sum_v += a[i]
if sum_v * 2 >= a[i + 1]:
ans += 1
else:
ans = 0
ans += 1
pr... | false | 9.52381 | [
"-b = [0]",
"-for i in range(1, n + 1):",
"- b.append(b[i - 1] + a[i - 1])",
"-b = b[1:]",
"-ans = 1",
"-for i in range(n - 2, -1, -1):",
"- if b[i] * 2 >= a[i + 1]:",
"+sum_v = 0",
"+ans = 0",
"+for i in range(n - 1):",
"+ sum_v += a[i]",
"+ if sum_v * 2 >= a[i + 1]:",
"- ... | false | 0.038628 | 0.06005 | 0.643262 | [
"s873132457",
"s469514001"
] |
u807772568 | p03061 | python | s361601183 | s705542381 | 1,031 | 154 | 93,408 | 103,468 | Accepted | Accepted | 85.06 | import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
import fractions
from functools import reduce
def gcd(*numbers):
return reduce(fractions.gcd, numbers)
def gcd_list(numbers):
return reduce(fractions.gcd, numbers)
def ... | import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
return list(map(int,input().split()))
def m(): #複数文字
return list(map(int,input().split()))
def onem(): #Nとかの取得
return int(eval(input()))
def s(x): ... | 116 | 105 | 2,798 | 2,015 | import sys, collections as cl, bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9 + 7
Max = sys.maxsize
import fractions
from functools import reduce
def gcd(*numbers):
return reduce(fractions.gcd, numbers)
def gcd_list(numbers):
return reduce(fractions.gcd, numbers)
def lc... | import sys, collections as cl, bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9 + 7
Max = sys.maxsize
def l(): # intのlist
return list(map(int, input().split()))
def m(): # 複数文字
return list(map(int, input().split()))
def onem(): # Nとかの取得
return int(eval(input()))
... | false | 9.482759 | [
"-import fractions",
"-from functools import reduce",
"-",
"-",
"-def gcd(*numbers):",
"- return reduce(fractions.gcd, numbers)",
"-",
"-",
"-def gcd_list(numbers):",
"- return reduce(fractions.gcd, numbers)",
"-",
"-",
"-def lcm_base(x, y):",
"- return (x * y) // fractions.gcd(x,... | false | 0.054063 | 0.060279 | 0.896881 | [
"s361601183",
"s705542381"
] |
u821624310 | p02408 | python | s560133733 | s302904929 | 30 | 20 | 7,756 | 7,612 | Accepted | Accepted | 33.33 | n = int(eval(input()))
s = [0 for s in range(13)]
h = [0 for s in range(13)]
c = [0 for s in range(13)]
d = [0 for s in range(13)]
for i in range(n):
design, N = input().split()
N = int(N)
if design == "S":
s[N-1] = 1
elif design == "H":
h[N-1] = 1
elif design == "C":
... | n = int(eval(input()))
card = set()
for i in range(n):
card_type, card_num = input().split()
card.add(card_type + card_num)
for card_type in ["S", "H", "C", "D"]:
for card_num in range(1, 14):
if card_type + str(card_num) not in card:
print((card_type + " " + str(card_num))) | 33 | 9 | 691 | 307 | n = int(eval(input()))
s = [0 for s in range(13)]
h = [0 for s in range(13)]
c = [0 for s in range(13)]
d = [0 for s in range(13)]
for i in range(n):
design, N = input().split()
N = int(N)
if design == "S":
s[N - 1] = 1
elif design == "H":
h[N - 1] = 1
elif design == "C":
c[N... | n = int(eval(input()))
card = set()
for i in range(n):
card_type, card_num = input().split()
card.add(card_type + card_num)
for card_type in ["S", "H", "C", "D"]:
for card_num in range(1, 14):
if card_type + str(card_num) not in card:
print((card_type + " " + str(card_num)))
| false | 72.727273 | [
"-s = [0 for s in range(13)]",
"-h = [0 for s in range(13)]",
"-c = [0 for s in range(13)]",
"-d = [0 for s in range(13)]",
"+card = set()",
"- design, N = input().split()",
"- N = int(N)",
"- if design == \"S\":",
"- s[N - 1] = 1",
"- elif design == \"H\":",
"- h[N - 1... | false | 0.044626 | 0.042098 | 1.060045 | [
"s560133733",
"s302904929"
] |
u546285759 | p00101 | python | s373581766 | s805370628 | 30 | 20 | 7,584 | 5,604 | Accepted | Accepted | 33.33 | n = int(eval(input()))
for _ in range(n):
print((input().replace("Hoshino", "Hoshina"))) | n = int(input())
dataset = [input().replace("Hoshino", "Hoshina") for _ in range(n)]
print(*dataset, sep="\n")
| 3 | 4 | 86 | 115 | n = int(eval(input()))
for _ in range(n):
print((input().replace("Hoshino", "Hoshina")))
| n = int(input())
dataset = [input().replace("Hoshino", "Hoshina") for _ in range(n)]
print(*dataset, sep="\n")
| false | 25 | [
"-n = int(eval(input()))",
"-for _ in range(n):",
"- print((input().replace(\"Hoshino\", \"Hoshina\")))",
"+n = int(input())",
"+dataset = [input().replace(\"Hoshino\", \"Hoshina\") for _ in range(n)]",
"+print(*dataset, sep=\"\\n\")"
] | false | 0.136005 | 0.120452 | 1.129127 | [
"s373581766",
"s805370628"
] |
u102461423 | p03422 | python | s129452478 | s825399076 | 923 | 528 | 14,440 | 21,520 | Accepted | Accepted | 42.8 | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
import numpy as np
N = int(readline())
AK = np.array(read().split(),np.int32)
A = AK[::2]; K = AK[1::2]
for _ in range(50000):
q = A//K; r = A%K
q += 1
r += (-r)%q
A -=... | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
import numpy as np
N = int(readline())
AK = np.array(read().split(),np.int32)
A = AK[::2]; K = AK[1::2]
G = 0
for t in range(50000):
q = A//K; r = A%K
q += 1
r += (-r)%q
... | 23 | 29 | 427 | 601 | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
import numpy as np
N = int(readline())
AK = np.array(read().split(), np.int32)
A = AK[::2]
K = AK[1::2]
for _ in range(50000):
q = A // K
r = A % K
q += 1
r += (-r) % q
A -= r
A //= ... | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
import numpy as np
N = int(readline())
AK = np.array(read().split(), np.int32)
A = AK[::2]
K = AK[1::2]
G = 0
for t in range(50000):
q = A // K
r = A % K
q += 1
r += (-r) % q
A -= r
... | false | 20.689655 | [
"-for _ in range(50000):",
"+G = 0",
"+for t in range(50000):",
"-A //= K # grundy",
"-g = np.bitwise_xor.reduce(A)",
"-answer = \"Takahashi\" if g else \"Aoki\"",
"+ if t % 1000 == 0:",
"+ ind = r != 0",
"+ if np.count_nonzero(~ind):",
"+ G ^= np.bitwise_xor.reduce(A[... | false | 0.588301 | 0.1687 | 3.487268 | [
"s129452478",
"s825399076"
] |
u075595666 | p03253 | python | s194373258 | s725606408 | 830 | 197 | 25,984 | 14,792 | Accepted | Accepted | 76.27 | def factorization(n):
arr = []
temp = n
for i in range(2, int(-(-n**0.5//1))+1):
if temp%i==0:
cnt=0
while temp%i==0:
cnt+=1
temp //= i
arr.append([i, cnt])
if temp!=1:
arr.append([temp, 1])
if arr==[]:
... | def factorization(n):
arr = []
temp = n
for i in range(2, int(-(-n**0.5//1))+1):
if temp%i==0:
cnt=0
while temp%i==0:
cnt+=1
temp //= i
arr.append([i, cnt])
if temp!=1:
arr.append([temp, 1])
if arr==[]:
... | 44 | 27 | 1,053 | 569 | def factorization(n):
arr = []
temp = n
for i in range(2, int(-(-(n**0.5) // 1)) + 1):
if temp % i == 0:
cnt = 0
while temp % i == 0:
cnt += 1
temp //= i
arr.append([i, cnt])
if temp != 1:
arr.append([temp, 1])
if ar... | def factorization(n):
arr = []
temp = n
for i in range(2, int(-(-(n**0.5) // 1)) + 1):
if temp % i == 0:
cnt = 0
while temp % i == 0:
cnt += 1
temp //= i
arr.append([i, cnt])
if temp != 1:
arr.append([temp, 1])
if ar... | false | 38.636364 | [
"-",
"-",
"-def make_array_for_comb(N, mod=10**9 + 7):",
"- fact = [1, 1]",
"- fact_inv = [1, 1]",
"- inv = [0, 1]",
"- for i in range(2, N + 1):",
"- fact.append((fact[-1] * i) % mod)",
"- inv.append((-inv[mod % i] * (mod // i)) % mod)",
"- fact_inv.append((fact_i... | false | 0.086091 | 0.452923 | 0.190079 | [
"s194373258",
"s725606408"
] |
u047102107 | p03687 | python | s719024219 | s291820710 | 255 | 199 | 46,140 | 40,304 | Accepted | Accepted | 21.96 | from collections import Counter
from copy import deepcopy
s = eval(input())
c = Counter(list(s))
lS = len(set(list(s)))
if lS == 1:
print((0))
exit()
if lS == len(s):
print((len(s) // 2))
exit()
else:
maxN = len(s)
for key in c:
ss = list(s)
count = 0
... | from string import ascii_lowercase
# a-zまで試す
s = eval(input())
maxN = len(s)
for ch in ascii_lowercase:
ss = list(s)
count = 0
if len(set(s)) == 1:
count = 0
else:
while True:
count += 1
new_ss = []
for j in range(len(ss) - 1):
... | 36 | 26 | 831 | 620 | from collections import Counter
from copy import deepcopy
s = eval(input())
c = Counter(list(s))
lS = len(set(list(s)))
if lS == 1:
print((0))
exit()
if lS == len(s):
print((len(s) // 2))
exit()
else:
maxN = len(s)
for key in c:
ss = list(s)
count = 0
# print(">", key)
... | from string import ascii_lowercase
# a-zまで試す
s = eval(input())
maxN = len(s)
for ch in ascii_lowercase:
ss = list(s)
count = 0
if len(set(s)) == 1:
count = 0
else:
while True:
count += 1
new_ss = []
for j in range(len(ss) - 1):
if ss[j... | false | 27.777778 | [
"-from collections import Counter",
"-from copy import deepcopy",
"+from string import ascii_lowercase",
"+# a-zまで試す",
"-c = Counter(list(s))",
"-lS = len(set(list(s)))",
"-if lS == 1:",
"- print((0))",
"- exit()",
"-if lS == len(s):",
"- print((len(s) // 2))",
"- exit()",
"-else... | false | 0.03873 | 0.135508 | 0.285816 | [
"s719024219",
"s291820710"
] |
u229660384 | p03557 | python | s781793599 | s044285101 | 1,700 | 319 | 23,200 | 23,328 | Accepted | Accepted | 81.24 | N = int(eval(input()))
A = list(map(int, input().split()))
#A = [int(x) for x in input().split()]
B = list(map(int, input().split()))
C = list(map(int, input().split()))
A.sort()
A = [-float('inf')] + A + [float('inf')]
B.sort()
C.sort()
C = [-float('inf')] + C + [float('inf')]
total = 0
for i in range(N... | import bisect
N = int(eval(input()))
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
A.sort()
B.sort()
C.sort()
ans = 0
for b in B:
ans += bisect.bisect_left(A,b)*(N-bisect.bisect_right(C,b))
print(ans) | 35 | 12 | 777 | 271 | N = int(eval(input()))
A = list(map(int, input().split()))
# A = [int(x) for x in input().split()]
B = list(map(int, input().split()))
C = list(map(int, input().split()))
A.sort()
A = [-float("inf")] + A + [float("inf")]
B.sort()
C.sort()
C = [-float("inf")] + C + [float("inf")]
total = 0
for i in range(N):
low = 0... | import bisect
N = int(eval(input()))
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
A.sort()
B.sort()
C.sort()
ans = 0
for b in B:
ans += bisect.bisect_left(A, b) * (N - bisect.bisect_right(C, b))
print(ans)
| false | 65.714286 | [
"+import bisect",
"+",
"-# A = [int(x) for x in input().split()]",
"-A = [-float(\"inf\")] + A + [float(\"inf\")]",
"-C = [-float(\"inf\")] + C + [float(\"inf\")]",
"-total = 0",
"-for i in range(N):",
"- low = 0",
"- high = N + 1",
"- while low + 1 < high:",
"- mid1 = (low + hig... | false | 0.044761 | 0.046256 | 0.967677 | [
"s781793599",
"s044285101"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.