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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
u606045429 | p03716 | python | s648652479 | s973821392 | 473 | 339 | 40,276 | 40,164 | Accepted | Accepted | 28.33 | from heapq import heapify, heappop, heappush
N, *A = list(map(int, open(0).read().split()))
Q = A[:N]
heapify(Q)
R = [sum(Q)]
for k in range(N, 2 * N):
heappush(Q, A[k])
m = heappop(Q)
R.append(R[-1] + A[k] - m)
Q = [-a for a in A[2 * N:]]
heapify(Q)
B = [sum(Q)]
for k in reversed(list... | from heapq import heapify, heappop, heappush
N, *A = list(map(int, open(0).read().split()))
Q = A[:N]
heapify(Q)
R = [sum(Q)]
for a in A[N:2 * N]:
heappush(Q, a)
R.append(R[-1] + a - heappop(Q))
Q = [-a for a in A[2 * N:]]
heapify(Q)
B = [sum(Q)]
for a in reversed(A[N:2 * N]):
heappush... | 23 | 21 | 457 | 413 | from heapq import heapify, heappop, heappush
N, *A = list(map(int, open(0).read().split()))
Q = A[:N]
heapify(Q)
R = [sum(Q)]
for k in range(N, 2 * N):
heappush(Q, A[k])
m = heappop(Q)
R.append(R[-1] + A[k] - m)
Q = [-a for a in A[2 * N :]]
heapify(Q)
B = [sum(Q)]
for k in reversed(list(range(N, 2 * N))):
... | from heapq import heapify, heappop, heappush
N, *A = list(map(int, open(0).read().split()))
Q = A[:N]
heapify(Q)
R = [sum(Q)]
for a in A[N : 2 * N]:
heappush(Q, a)
R.append(R[-1] + a - heappop(Q))
Q = [-a for a in A[2 * N :]]
heapify(Q)
B = [sum(Q)]
for a in reversed(A[N : 2 * N]):
heappush(Q, -a)
B.ap... | false | 8.695652 | [
"-for k in range(N, 2 * N):",
"- heappush(Q, A[k])",
"- m = heappop(Q)",
"- R.append(R[-1] + A[k] - m)",
"+for a in A[N : 2 * N]:",
"+ heappush(Q, a)",
"+ R.append(R[-1] + a - heappop(Q))",
"-for k in reversed(list(range(N, 2 * N))):",
"- heappush(Q, -A[k])",
"- m = heappop(Q)... | false | 0.047595 | 0.094344 | 0.504486 | [
"s648652479",
"s973821392"
] |
u079022693 | p02624 | python | s351705934 | s918816484 | 607 | 540 | 339,776 | 261,252 | Accepted | Accepted | 11.04 | import numpy as np
n=int(eval(input()))
a=np.arange(1,n+1)
b=n//a*a
c=n//a
print(((c*(a+b)//2).sum())) | import numpy as np
n=int(eval(input()))
a=np.arange(1,n+1)
print(((n//a*(a+n//a*a)//2).sum())) | 6 | 4 | 99 | 89 | import numpy as np
n = int(eval(input()))
a = np.arange(1, n + 1)
b = n // a * a
c = n // a
print(((c * (a + b) // 2).sum()))
| import numpy as np
n = int(eval(input()))
a = np.arange(1, n + 1)
print(((n // a * (a + n // a * a) // 2).sum()))
| false | 33.333333 | [
"-b = n // a * a",
"-c = n // a",
"-print(((c * (a + b) // 2).sum()))",
"+print(((n // a * (a + n // a * a) // 2).sum()))"
] | false | 0.467237 | 0.52052 | 0.897634 | [
"s351705934",
"s918816484"
] |
u615576660 | p02687 | python | s888476930 | s375036835 | 22 | 20 | 8,956 | 9,064 | Accepted | Accepted | 9.09 | contest = eval(input())
S = 'ABC'
if contest == S :
print('ARC')
else:
print('ABC') | if eval(input()) == "ARC":
print('ABC')
else:
print('ARC') | 6 | 4 | 90 | 63 | contest = eval(input())
S = "ABC"
if contest == S:
print("ARC")
else:
print("ABC")
| if eval(input()) == "ARC":
print("ABC")
else:
print("ARC")
| false | 33.333333 | [
"-contest = eval(input())",
"-S = \"ABC\"",
"-if contest == S:",
"+if eval(input()) == \"ARC\":",
"+ print(\"ABC\")",
"+else:",
"-else:",
"- print(\"ABC\")"
] | false | 0.038174 | 0.040572 | 0.940902 | [
"s888476930",
"s375036835"
] |
u334712262 | p02563 | python | s957410994 | s719832173 | 1,431 | 804 | 196,596 | 196,420 | Accepted | Accepted | 43.82 |
def butterfly(arr, MOD):
n = len(arr)
h = (n - 1).bit_length()
sum_e = (911660635, 509520358, 369330050, 332049552, 983190778, 123842337, 238493703, 975955924, 603855026, 856644456, 131300601,
842657263, 730768835, 942482514, 806263778, 151565301, 510815449, 503497456, 743006876, 74104... | MOD = 998244353
def butterfly(arr):
n = len(arr)
h = (n - 1).bit_length()
sum_e = (911660635, 509520358, 369330050, 332049552, 983190778, 123842337, 238493703, 975955924, 603855026, 856644456, 131300601,
842657263, 730768835, 942482514, 806263778, 151565301, 510815449, 503497456, 7430... | 94 | 86 | 2,983 | 2,730 | def butterfly(arr, MOD):
n = len(arr)
h = (n - 1).bit_length()
sum_e = (
911660635,
509520358,
369330050,
332049552,
983190778,
123842337,
238493703,
975955924,
603855026,
856644456,
131300601,
842657263,
... | MOD = 998244353
def butterfly(arr):
n = len(arr)
h = (n - 1).bit_length()
sum_e = (
911660635,
509520358,
369330050,
332049552,
983190778,
123842337,
238493703,
975955924,
603855026,
856644456,
131300601,
84265... | false | 8.510638 | [
"-def butterfly(arr, MOD):",
"+MOD = 998244353",
"+",
"+",
"+def butterfly(arr):",
"-def butterfly_inv(arr, MOD):",
"+def butterfly_inv(arr):",
"-def convolution(a, b, MOD=10**9 + 7):",
"+def convolution(a, b):",
"- butterfly(a, MOD)",
"- butterfly(b, MOD)",
"+ butterfly(a)",
"+ ... | false | 0.046664 | 0.129218 | 0.361127 | [
"s957410994",
"s719832173"
] |
u490642448 | p02632 | python | s864268640 | s593801058 | 1,042 | 337 | 133,368 | 133,256 | Accepted | Accepted | 67.66 | k = int(eval(input()))
s = eval(input())
n = len(s)
mod = 10**9 + 7
## nCkのmodを求める関数
# テーブルを作る(前処理)
max = 2 * 10**6 + 100
fac, finv, inv = [0]*max, [0]*max, [0]*max
def comInit(max):
fac[0] = fac[1] = 1
finv[0] = finv[1] = 1
inv[1] = 1
for i in range(2,max):
fac[i] = fac[i-1]*... | k = int(eval(input()))
s = eval(input())
n = len(s)
mod = 10**9 + 7
## nCkのmodを求める関数
# テーブルを作る(前処理)
max = 2 * 10**6 + 100
fac, finv, inv = [0]*max, [0]*max, [0]*max
def comInit(max):
fac[0] = fac[1] = 1
finv[0] = finv[1] = 1
inv[1] = 1
for i in range(2,max):
fac[i] = fac[i-1]*... | 45 | 44 | 910 | 854 | k = int(eval(input()))
s = eval(input())
n = len(s)
mod = 10**9 + 7
## nCkのmodを求める関数
# テーブルを作る(前処理)
max = 2 * 10**6 + 100
fac, finv, inv = [0] * max, [0] * max, [0] * max
def comInit(max):
fac[0] = fac[1] = 1
finv[0] = finv[1] = 1
inv[1] = 1
for i in range(2, max):
fac[i] = fac[i - 1] * i % mo... | k = int(eval(input()))
s = eval(input())
n = len(s)
mod = 10**9 + 7
## nCkのmodを求める関数
# テーブルを作る(前処理)
max = 2 * 10**6 + 100
fac, finv, inv = [0] * max, [0] * max, [0] * max
def comInit(max):
fac[0] = fac[1] = 1
finv[0] = finv[1] = 1
inv[1] = 1
for i in range(2, max):
fac[i] = fac[i - 1] * i % mo... | false | 2.222222 | [
"- tmp = pow(25, i, mod) * com(n + i - 1, i) * pow(26, j, mod)"
] | false | 0.181602 | 0.157108 | 1.155907 | [
"s864268640",
"s593801058"
] |
u758815106 | p03165 | python | s890431646 | s168659926 | 328 | 284 | 144,500 | 144,592 | Accepted | Accepted | 13.41 | #import
#import math
#import numpy as np
#= int(input())
#= input()
#= map(int, input().split())
#= [input(), input()]
s = eval(input())
t = eval(input())
sl = len(s)
tl = len(t)
dp = [[0] * (tl + 1) for _ in range(sl + 1)]
for i in range(1, sl + 1):
for j in range(1, tl + 1):
if s[i-1... | #!/usr/bin/env python3
#import
#import math
#import numpy as np
#= int(input())
S = eval(input())
T = eval(input())
ls = len(S)
lt = len(T)
dp = [[0] * (lt + 1) for _ in range(ls + 1)]
for i in range(1, ls + 1):
for j in range(1, lt + 1):
if S[i - 1] == T[j - 1]:
dp[i][j] = ... | 38 | 39 | 689 | 673 | # import
# import math
# import numpy as np
# = int(input())
# = input()
# = map(int, input().split())
# = [input(), input()]
s = eval(input())
t = eval(input())
sl = len(s)
tl = len(t)
dp = [[0] * (tl + 1) for _ in range(sl + 1)]
for i in range(1, sl + 1):
for j in range(1, tl + 1):
if s[i - 1] == t[j - 1]... | #!/usr/bin/env python3
# import
# import math
# import numpy as np
# = int(input())
S = eval(input())
T = eval(input())
ls = len(S)
lt = len(T)
dp = [[0] * (lt + 1) for _ in range(ls + 1)]
for i in range(1, ls + 1):
for j in range(1, lt + 1):
if S[i - 1] == T[j - 1]:
dp[i][j] = dp[i - 1][j - 1] ... | false | 2.564103 | [
"+#!/usr/bin/env python3",
"-# = input()",
"-# = map(int, input().split())",
"-# = [input(), input()]",
"-s = eval(input())",
"-t = eval(input())",
"-sl = len(s)",
"-tl = len(t)",
"-dp = [[0] * (tl + 1) for _ in range(sl + 1)]",
"-for i in range(1, sl + 1):",
"- for j in range(1, tl + 1):",
... | false | 0.045359 | 0.045689 | 0.992776 | [
"s890431646",
"s168659926"
] |
u246401133 | p02658 | python | s372524490 | s369321314 | 73 | 63 | 21,632 | 21,632 | Accepted | Accepted | 13.7 | n = int(eval(input()))
a = list(map(int, input().split()))
i = 1
if 0 in a:
i = 0
else:
for j in range(n):
if i >= 0:
i = i * a[j]
if i > 10 ** 18:
i = -1
print((int(i))) | n = int(eval(input()))
a = list(map(int, input().split()))
x = 1
if 0 in a:
x = 0
else:
for i in range(n):
if x != -1:
x = x * a[i]
if x > 10 ** 18:
x = -1
print(x) | 12 | 12 | 221 | 217 | n = int(eval(input()))
a = list(map(int, input().split()))
i = 1
if 0 in a:
i = 0
else:
for j in range(n):
if i >= 0:
i = i * a[j]
if i > 10**18:
i = -1
print((int(i)))
| n = int(eval(input()))
a = list(map(int, input().split()))
x = 1
if 0 in a:
x = 0
else:
for i in range(n):
if x != -1:
x = x * a[i]
if x > 10**18:
x = -1
print(x)
| false | 0 | [
"-i = 1",
"+x = 1",
"- i = 0",
"+ x = 0",
"- for j in range(n):",
"- if i >= 0:",
"- i = i * a[j]",
"- if i > 10**18:",
"- i = -1",
"-print((int(i)))",
"+ for i in range(n):",
"+ if x != -1:",
"+ x = x * a[i]",
"+ if ... | false | 0.043644 | 0.047161 | 0.925416 | [
"s372524490",
"s369321314"
] |
u707498674 | p03309 | python | s238048740 | s577233856 | 209 | 190 | 25,968 | 27,580 | Accepted | Accepted | 9.09 | import math
N = int(eval(input()))
A = list(map(int, input().split()))
A = [A[i] - i - 1 for i in range(N)]
A.sort()
c = int(math.floor(N/2))
answer = sum(list(map(abs,[A[i] - A[c] for i in range(N)])))
print(answer) | def main():
N = int(eval(input()))
A = list(map(int, input().split()))
B = sorted([A[i] - (i+1) for i in range(N)])
b = B[N//2]
print((sum([abs(val - b) for val in B])))
if __name__ == "__main__":
main() | 8 | 9 | 217 | 228 | import math
N = int(eval(input()))
A = list(map(int, input().split()))
A = [A[i] - i - 1 for i in range(N)]
A.sort()
c = int(math.floor(N / 2))
answer = sum(list(map(abs, [A[i] - A[c] for i in range(N)])))
print(answer)
| def main():
N = int(eval(input()))
A = list(map(int, input().split()))
B = sorted([A[i] - (i + 1) for i in range(N)])
b = B[N // 2]
print((sum([abs(val - b) for val in B])))
if __name__ == "__main__":
main()
| false | 11.111111 | [
"-import math",
"+def main():",
"+ N = int(eval(input()))",
"+ A = list(map(int, input().split()))",
"+ B = sorted([A[i] - (i + 1) for i in range(N)])",
"+ b = B[N // 2]",
"+ print((sum([abs(val - b) for val in B])))",
"-N = int(eval(input()))",
"-A = list(map(int, input().split()))",... | false | 0.03815 | 0.096894 | 0.393733 | [
"s238048740",
"s577233856"
] |
u112317104 | p02837 | python | s812571898 | s361532964 | 778 | 582 | 3,064 | 3,064 | Accepted | Accepted | 25.19 | def int_to_list(bit, n):
l = []
for i in range(n):
if bit & (1 << i):
l.append(i)
return l
def solve():
N = int(eval(input()))
l = [[] for _ in range(N)]
for i in range(N):
for _ in range(int(eval(input()))):
p, q = list(map(int, input().split... | def int_to_list(bit, n):
l = []
for i in range(n):
if bit & (1 << i):
l.append(i)
return l
def solve():
N = int(eval(input()))
A = [[] for _ in range(N)]
for i in range(N):
B = int(eval(input()))
for _ in range(B):
x, y = list(map(int, inpu... | 34 | 35 | 805 | 828 | def int_to_list(bit, n):
l = []
for i in range(n):
if bit & (1 << i):
l.append(i)
return l
def solve():
N = int(eval(input()))
l = [[] for _ in range(N)]
for i in range(N):
for _ in range(int(eval(input()))):
p, q = list(map(int, input().split()))
... | def int_to_list(bit, n):
l = []
for i in range(n):
if bit & (1 << i):
l.append(i)
return l
def solve():
N = int(eval(input()))
A = [[] for _ in range(N)]
for i in range(N):
B = int(eval(input()))
for _ in range(B):
x, y = list(map(int, input().sp... | false | 2.857143 | [
"- l = [[] for _ in range(N)]",
"+ A = [[] for _ in range(N)]",
"- for _ in range(int(eval(input()))):",
"- p, q = list(map(int, input().split()))",
"- l[i].append((p - 1, q))",
"+ B = int(eval(input()))",
"+ for _ in range(B):",
"+ x, y = li... | false | 0.086545 | 0.044553 | 1.942511 | [
"s812571898",
"s361532964"
] |
u576917603 | p03212 | python | s663830529 | s741966059 | 87 | 54 | 4,320 | 6,756 | Accepted | Accepted | 37.93 | n=int(eval(input()))
option=[3,5,7]
completed=[]
a=[3,5,7]
ans=0
while option:
number=option.pop()
completed.append(number)
for add_number in a:
new_number=number*10+add_number
if new_number<=n:
option.append(new_number)
for i in completed:
i=list(str(i))
i=... | n=int(eval(input()))
import itertools as it
ans=0
for i in range(3,len(str(n))+1):
pr=list(it.product("753",repeat=i))
for j in pr:
s=set(j)
if len(s)==3:
num=int(''.join(j))
if num<=n:
ans+=1
print(ans) | 18 | 14 | 372 | 280 | n = int(eval(input()))
option = [3, 5, 7]
completed = []
a = [3, 5, 7]
ans = 0
while option:
number = option.pop()
completed.append(number)
for add_number in a:
new_number = number * 10 + add_number
if new_number <= n:
option.append(new_number)
for i in completed:
i = list(st... | n = int(eval(input()))
import itertools as it
ans = 0
for i in range(3, len(str(n)) + 1):
pr = list(it.product("753", repeat=i))
for j in pr:
s = set(j)
if len(s) == 3:
num = int("".join(j))
if num <= n:
ans += 1
print(ans)
| false | 22.222222 | [
"-option = [3, 5, 7]",
"-completed = []",
"-a = [3, 5, 7]",
"+import itertools as it",
"+",
"-while option:",
"- number = option.pop()",
"- completed.append(number)",
"- for add_number in a:",
"- new_number = number * 10 + add_number",
"- if new_number <= n:",
"- ... | false | 0.117511 | 0.05506 | 2.134221 | [
"s663830529",
"s741966059"
] |
u353797797 | p03078 | python | s586428704 | s525810164 | 1,558 | 860 | 4,976 | 4,980 | Accepted | Accepted | 44.8 | an, bn, cn, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
a.sort(reverse=True)
b.sort(reverse=True)
c.sort(reverse=True)
la = len(a)
lb = len(b)
lc = len(c)
ans = [a[0] + b[0] + c[0]]
hq = [[a[0] + b[0] + c[0], 0, 0... | from heapq import *
an, bn, cn, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
a.sort(reverse=True)
b.sort(reverse=True)
c.sort(reverse=True)
la = len(a)
lb = len(b)
lc = len(c)
ans = []
hp = [[-(a[0] + b[0] + c[0... | 33 | 35 | 981 | 983 | an, bn, cn, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
a.sort(reverse=True)
b.sort(reverse=True)
c.sort(reverse=True)
la = len(a)
lb = len(b)
lc = len(c)
ans = [a[0] + b[0] + c[0]]
hq = [[a[0] + b[0] + c[0], 0, 0, 0]]
sumi = ... | from heapq import *
an, bn, cn, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
a.sort(reverse=True)
b.sort(reverse=True)
c.sort(reverse=True)
la = len(a)
lb = len(b)
lc = len(c)
ans = []
hp = [[-(a[0] + b[0] + c[0]), 0, 0, 0]]
h... | false | 5.714286 | [
"+from heapq import *",
"+",
"-ans = [a[0] + b[0] + c[0]]",
"-hq = [[a[0] + b[0] + c[0], 0, 0, 0]]",
"+ans = []",
"+hp = [[-(a[0] + b[0] + c[0]), 0, 0, 0]]",
"+heapify(hp)",
"-for _ in range(k - 1):",
"- mx = hq[0][0]",
"- ai = hq[0][1]",
"- bi = hq[0][2]",
"- ci = hq[0][3]",
"- ... | false | 0.063151 | 0.080249 | 0.786935 | [
"s586428704",
"s525810164"
] |
u762540523 | p02747 | python | s311018134 | s146496563 | 19 | 17 | 3,188 | 2,940 | Accepted | Accepted | 10.53 | import re;print((re.match('(hi)+$',eval(input()))and'Yes'or'No')) | print(("NYoe s"[eval(input())in["hi"*x for x in range(6)]::2])) | 1 | 1 | 57 | 55 | import re
print((re.match("(hi)+$", eval(input())) and "Yes" or "No"))
| print(("NYoe s"[eval(input()) in ["hi" * x for x in range(6)] :: 2]))
| false | 0 | [
"-import re",
"-",
"-print((re.match(\"(hi)+$\", eval(input())) and \"Yes\" or \"No\"))",
"+print((\"NYoe s\"[eval(input()) in [\"hi\" * x for x in range(6)] :: 2]))"
] | false | 0.067273 | 0.150121 | 0.448123 | [
"s311018134",
"s146496563"
] |
u018168283 | p02660 | python | s466925985 | s348176555 | 267 | 245 | 9,120 | 9,260 | Accepted | Accepted | 8.24 | n = int(eval(input()))
ans = 0
i = 2
while n>1 and i*i<=n:
if n % i == 0:
c = 0
while n % i == 0:
n = n / i
c = c + 1
Y=1
U=2
while c>=Y:
ans=ans+1
Y=Y+U
U=U+1
i = i + 1
if n > 1:
ans = 1 + ans
print(ans) | n = int(eval(input()))
ans = 0
i = 2
while n>1 and i*i<=n:
if n % i == 0:
c = 0
while n % i == 0:
n = n / i
c = c + 1
Y=1
U=2
while c>=Y:
ans=ans+1
Y=Y+U
U=U+1
i += 1
if n > 1:
ans = 1 + ans
print(ans) | 24 | 24 | 292 | 289 | n = int(eval(input()))
ans = 0
i = 2
while n > 1 and i * i <= n:
if n % i == 0:
c = 0
while n % i == 0:
n = n / i
c = c + 1
Y = 1
U = 2
while c >= Y:
ans = ans + 1
Y = Y + U
U = U + 1
i = i + 1
if n > 1:
ans ... | n = int(eval(input()))
ans = 0
i = 2
while n > 1 and i * i <= n:
if n % i == 0:
c = 0
while n % i == 0:
n = n / i
c = c + 1
Y = 1
U = 2
while c >= Y:
ans = ans + 1
Y = Y + U
U = U + 1
i += 1
if n > 1:
ans = 1... | false | 0 | [
"- i = i + 1",
"+ i += 1"
] | false | 0.056132 | 0.061905 | 0.906737 | [
"s466925985",
"s348176555"
] |
u404678206 | p02700 | python | s315396938 | s149133430 | 23 | 20 | 9,092 | 9,028 | Accepted | Accepted | 13.04 | import math
a,b,c,d =list(map(int,input().split()))
print(('Yes'if math.ceil(a/d)>=math.ceil(c/b) else 'No')) | a,b,c,d =list(map(int,input().split()))
while True:
c=c-b
if c<=0:
print('Yes')
break
a=a-d
if a<=0:
print('No')
break | 3 | 10 | 103 | 169 | import math
a, b, c, d = list(map(int, input().split()))
print(("Yes" if math.ceil(a / d) >= math.ceil(c / b) else "No"))
| a, b, c, d = list(map(int, input().split()))
while True:
c = c - b
if c <= 0:
print("Yes")
break
a = a - d
if a <= 0:
print("No")
break
| false | 70 | [
"-import math",
"-",
"-print((\"Yes\" if math.ceil(a / d) >= math.ceil(c / b) else \"No\"))",
"+while True:",
"+ c = c - b",
"+ if c <= 0:",
"+ print(\"Yes\")",
"+ break",
"+ a = a - d",
"+ if a <= 0:",
"+ print(\"No\")",
"+ break"
] | false | 0.035521 | 0.065414 | 0.543022 | [
"s315396938",
"s149133430"
] |
u156815136 | p02615 | python | s424966587 | s364412564 | 240 | 219 | 32,948 | 32,936 | Accepted | Accepted | 8.75 | #from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations,accumulate # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counte... | #from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations,accumulate, product # (string,3) 3回
#from collections import deque
from collections import deque,defaultdi... | 42 | 75 | 945 | 1,791 | # from statistics import median
# import collections
# aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations, permutations, accumulate # (string,3) 3回
# from collections import deque
from collections import deque, defaultdict, Co... | # from statistics import median
# import collections
# aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations, permutations, accumulate, product # (string,3) 3回
# from collections import deque
from collections import deque, defaul... | false | 44 | [
"-from itertools import combinations, permutations, accumulate # (string,3) 3回",
"+from itertools import combinations, permutations, accumulate, product # (string,3) 3回",
"+import math",
"+# my_round_int = lambda x:np.round((x*2 + 1)//2)",
"+# 四捨五入g",
"+import sys",
"+",
"+sys.setrecursionlimit(1000... | false | 0.061018 | 0.083796 | 0.728176 | [
"s424966587",
"s364412564"
] |
u389610071 | p02389 | python | s504647495 | s400296287 | 30 | 20 | 6,724 | 7,704 | Accepted | Accepted | 33.33 | nums = input().split()
a = int(nums[0])
b = int(nums[1])
print((a * b, (a + b) * 2)) | nums = input().split()
a = int(nums[0])
b = int(nums[1])
print((a * b, 2 * a + 2 * b)) | 4 | 5 | 85 | 89 | nums = input().split()
a = int(nums[0])
b = int(nums[1])
print((a * b, (a + b) * 2))
| nums = input().split()
a = int(nums[0])
b = int(nums[1])
print((a * b, 2 * a + 2 * b))
| false | 20 | [
"-print((a * b, (a + b) * 2))",
"+print((a * b, 2 * a + 2 * b))"
] | false | 0.042279 | 0.042015 | 1.006288 | [
"s504647495",
"s400296287"
] |
u104171359 | p02385 | python | s313589521 | s964267491 | 30 | 20 | 7,924 | 7,924 | Accepted | Accepted | 33.33 | #!usr/bin/env python3
import sys
class Die:
def __init__(self, pips):
self.pips = pips
def move_die(self, direction):
if direction == 'N':
tmp = self.pips[0]
self.pips[0] = self.pips[1]
self.pips[1] = self.pips[5]
self.pips[5] = s... | #!usr/bin/env python3
import sys
class Die:
def __init__(self, pips):
self.pips = pips
def move_die(self, direction):
if direction == 'N':
tmp = self.pips[0]
self.pips[0] = self.pips[1]
self.pips[1] = self.pips[5]
self.pips[5] = s... | 116 | 118 | 3,065 | 3,104 | #!usr/bin/env python3
import sys
class Die:
def __init__(self, pips):
self.pips = pips
def move_die(self, direction):
if direction == "N":
tmp = self.pips[0]
self.pips[0] = self.pips[1]
self.pips[1] = self.pips[5]
self.pips[5] = self.pips[4]
... | #!usr/bin/env python3
import sys
class Die:
def __init__(self, pips):
self.pips = pips
def move_die(self, direction):
if direction == "N":
tmp = self.pips[0]
self.pips[0] = self.pips[1]
self.pips[1] = self.pips[5]
self.pips[5] = self.pips[4]
... | false | 1.694915 | [
"-def main():",
"- die1 = init_die()",
"- die2 = init_die()",
"+def are_identical(die1, die2):",
"- print(\"No\")",
"+ return \"No\"",
"- print(\"Yes\")",
"- sys.exit(0)",
"+ return \"Yes\"",
"- print(\"No\")",
"... | false | 0.039913 | 0.035162 | 1.135118 | [
"s313589521",
"s964267491"
] |
u923279197 | p03665 | python | s598162125 | s986180509 | 21 | 18 | 3,316 | 3,060 | Accepted | Accepted | 14.29 | from collections import Counter
def combination(n, r): # nCrを求める
r = min(n-r, r)
result = 1
for i in range(n, n-r, -1):
result *= i
for i in range(1, r+1):
result //= i
return result
n,p = list(map(int,input().split()))
a =list(map(int,input().split()))
for i in range(n):
... | n, m = list(map(int,input().split()))
a = list(map(int,input().split()))
a = [i%2 for i in a]
if sum(a)>0:print((2**(n-1)))
else:
if m == 0:print((2**n))
else:print((0)) | 25 | 7 | 547 | 171 | from collections import Counter
def combination(n, r): # nCrを求める
r = min(n - r, r)
result = 1
for i in range(n, n - r, -1):
result *= i
for i in range(1, r + 1):
result //= i
return result
n, p = list(map(int, input().split()))
a = list(map(int, input().split()))
for i in range(... | n, m = list(map(int, input().split()))
a = list(map(int, input().split()))
a = [i % 2 for i in a]
if sum(a) > 0:
print((2 ** (n - 1)))
else:
if m == 0:
print((2**n))
else:
print((0))
| false | 72 | [
"-from collections import Counter",
"-",
"-",
"-def combination(n, r): # nCrを求める",
"- r = min(n - r, r)",
"- result = 1",
"- for i in range(n, n - r, -1):",
"- result *= i",
"- for i in range(1, r + 1):",
"- result //= i",
"- return result",
"-",
"-",
"-n, p =... | false | 0.037432 | 0.035787 | 1.045972 | [
"s598162125",
"s986180509"
] |
u644907318 | p02954 | python | s031568920 | s578409830 | 129 | 118 | 6,408 | 17,844 | Accepted | Accepted | 8.53 | S = input().strip()
A = [0 for _ in range(len(S))]
i = 1
while i<len(S):
if S[i]=="L" and S[i-1]=="R":
cur = i-2
cntR = 0
while cur>=0:
if S[cur]=="R":
cntR += 1
cur -= 1
else:
break
cur = i+1
... | S = input().strip()
N = len(S)
A = []
cur = 0
for i in range(1,N):
if S[i]=="R" and S[i-1]=="L":
x = S[cur:i]
A.append((cur,x))
cur = i
A.append((cur,S[cur:N]))
B = [0 for _ in range(N)]
while A:
cur,x = A.pop()
n = len(x)
for i in range(1,n):
if x[i]=="L" ... | 26 | 29 | 600 | 635 | S = input().strip()
A = [0 for _ in range(len(S))]
i = 1
while i < len(S):
if S[i] == "L" and S[i - 1] == "R":
cur = i - 2
cntR = 0
while cur >= 0:
if S[cur] == "R":
cntR += 1
cur -= 1
else:
break
cur = i + 1
... | S = input().strip()
N = len(S)
A = []
cur = 0
for i in range(1, N):
if S[i] == "R" and S[i - 1] == "L":
x = S[cur:i]
A.append((cur, x))
cur = i
A.append((cur, S[cur:N]))
B = [0 for _ in range(N)]
while A:
cur, x = A.pop()
n = len(x)
for i in range(1, n):
if x[i] == "L" an... | false | 10.344828 | [
"-A = [0 for _ in range(len(S))]",
"-i = 1",
"-while i < len(S):",
"- if S[i] == \"L\" and S[i - 1] == \"R\":",
"- cur = i - 2",
"- cntR = 0",
"- while cur >= 0:",
"- if S[cur] == \"R\":",
"- cntR += 1",
"- cur -= 1",
"- ... | false | 0.217446 | 0.063187 | 3.441318 | [
"s031568920",
"s578409830"
] |
u912237403 | p00097 | python | s731026542 | s210033658 | 250 | 220 | 4,392 | 4,384 | Accepted | Accepted | 12 | m=1001
A=list(range(10))
d=[[0]*m for i in A]
d[0][0]=1
for i in range(101):
for j in A[1:][::-1]:
for k in range(m-i): d[j][k+i]+=d[j-1][k]
while 1:
n,s=list(map(int,input().split()))
if n==s==0: break
print(d[n][s]) | m=1001
A=list(range(9))
d=[[0]*m for i in A]
for i in range(101):
for j in A[1:][::-1]:
for k in range(m-i): d[j][k+i]+=d[j-1][k]
d[0][i]=1
while 1:
n,s=list(map(int,input().split()))
if n==s==0: break
print(d[n-1][s]) | 11 | 11 | 230 | 233 | m = 1001
A = list(range(10))
d = [[0] * m for i in A]
d[0][0] = 1
for i in range(101):
for j in A[1:][::-1]:
for k in range(m - i):
d[j][k + i] += d[j - 1][k]
while 1:
n, s = list(map(int, input().split()))
if n == s == 0:
break
print(d[n][s])
| m = 1001
A = list(range(9))
d = [[0] * m for i in A]
for i in range(101):
for j in A[1:][::-1]:
for k in range(m - i):
d[j][k + i] += d[j - 1][k]
d[0][i] = 1
while 1:
n, s = list(map(int, input().split()))
if n == s == 0:
break
print(d[n - 1][s])
| false | 0 | [
"-A = list(range(10))",
"+A = list(range(9))",
"-d[0][0] = 1",
"+ d[0][i] = 1",
"- print(d[n][s])",
"+ print(d[n - 1][s])"
] | false | 0.374195 | 1.059184 | 0.353286 | [
"s731026542",
"s210033658"
] |
u919902859 | p02879 | python | s743771124 | s725799130 | 176 | 17 | 38,256 | 2,940 | Accepted | Accepted | 90.34 | i = list(map(int, input().split()))
if ((i[0] >= 1 and i[0] <= 9) and (i[1] >= 1 and i[1] <= 9)):
print((i[0] * i[1]))
else:
print((-1)) | i = list(map(int, input().split()))
if ((i[0] <= 9) and (i[1] <= 9)):
print((i[0] * i[1]))
else:
print((-1)) | 5 | 5 | 146 | 118 | i = list(map(int, input().split()))
if (i[0] >= 1 and i[0] <= 9) and (i[1] >= 1 and i[1] <= 9):
print((i[0] * i[1]))
else:
print((-1))
| i = list(map(int, input().split()))
if (i[0] <= 9) and (i[1] <= 9):
print((i[0] * i[1]))
else:
print((-1))
| false | 0 | [
"-if (i[0] >= 1 and i[0] <= 9) and (i[1] >= 1 and i[1] <= 9):",
"+if (i[0] <= 9) and (i[1] <= 9):"
] | false | 0.178096 | 0.045448 | 3.918671 | [
"s743771124",
"s725799130"
] |
u843981036 | p03816 | python | s054137605 | s441008878 | 67 | 61 | 14,396 | 19,000 | Accepted | Accepted | 8.96 | n = int(eval(input()))
l = len(set(list(map(int, input().split()))))
print((l - 1 if (n - l) % 2 else l))
| n = int(eval(input()))
l = len(set(map(int, input().split())))
print((l - (n - l) % 2)) | 3 | 3 | 100 | 81 | n = int(eval(input()))
l = len(set(list(map(int, input().split()))))
print((l - 1 if (n - l) % 2 else l))
| n = int(eval(input()))
l = len(set(map(int, input().split())))
print((l - (n - l) % 2))
| false | 0 | [
"-l = len(set(list(map(int, input().split()))))",
"-print((l - 1 if (n - l) % 2 else l))",
"+l = len(set(map(int, input().split())))",
"+print((l - (n - l) % 2))"
] | false | 0.042063 | 0.042338 | 0.993491 | [
"s054137605",
"s441008878"
] |
u926412290 | p02819 | python | s383389818 | s209352326 | 19 | 17 | 2,940 | 3,064 | Accepted | Accepted | 10.53 | def is_prime(a):
if a == 2:
return True
for i in range(2, int(a**0.5)+2):
if a%i == 0:
return False
return True
X = int(eval(input()))
for i in range(X, 100004):
if is_prime(i):
print(i)
break | def is_prime(a):
for i in range(2, int(a**0.5)+1):
if a%i == 0:
return False
return True
X = int(eval(input()))
for i in range(X, 100004):
if is_prime(i):
print(i)
break | 14 | 12 | 261 | 224 | def is_prime(a):
if a == 2:
return True
for i in range(2, int(a**0.5) + 2):
if a % i == 0:
return False
return True
X = int(eval(input()))
for i in range(X, 100004):
if is_prime(i):
print(i)
break
| def is_prime(a):
for i in range(2, int(a**0.5) + 1):
if a % i == 0:
return False
return True
X = int(eval(input()))
for i in range(X, 100004):
if is_prime(i):
print(i)
break
| false | 14.285714 | [
"- if a == 2:",
"- return True",
"- for i in range(2, int(a**0.5) + 2):",
"+ for i in range(2, int(a**0.5) + 1):"
] | false | 0.086421 | 0.044378 | 1.947392 | [
"s383389818",
"s209352326"
] |
u588341295 | p04046 | python | s668782399 | s470616552 | 362 | 331 | 44,656 | 18,804 | Accepted | Accepted | 8.56 | # -*- coding: utf-8 -*-
H,W,A,B = list(map(int, input().split()))
mod = (10 ** 9 + 7)
# 予め組み合わせ計算に必要な階乗と逆元のテーブルを作っておく
factorial = [0] * (H+W)
factorial[0] = 1
factorial[1] = 1
inverse = [0] * (H+W)
inverse[0] = 1
inverse[1] = 1
for i in range(2,H+W):
factorial[i] = factorial[i-1] * i % mod
# フェル... | # -*- coding: utf-8 -*-
H,W,A,B = list(map(int, input().split()))
mod = (10 ** 9 + 7)
# 予め組み合わせ計算に必要な階乗と逆元のテーブルを作っておく
factorial = [1] * (H+W)
factorial[0] = 1
factorial[1] = 1
for i in range(2,H+W):
factorial[i] = factorial[i-1] * i % mod
inverse = [1] * (H+W)
# フェルマーの小定理から(x! ** mod-2 % mod == x! *... | 38 | 40 | 878 | 956 | # -*- coding: utf-8 -*-
H, W, A, B = list(map(int, input().split()))
mod = 10**9 + 7
# 予め組み合わせ計算に必要な階乗と逆元のテーブルを作っておく
factorial = [0] * (H + W)
factorial[0] = 1
factorial[1] = 1
inverse = [0] * (H + W)
inverse[0] = 1
inverse[1] = 1
for i in range(2, H + W):
factorial[i] = factorial[i - 1] * i % mod
# フェルマーの小定理から... | # -*- coding: utf-8 -*-
H, W, A, B = list(map(int, input().split()))
mod = 10**9 + 7
# 予め組み合わせ計算に必要な階乗と逆元のテーブルを作っておく
factorial = [1] * (H + W)
factorial[0] = 1
factorial[1] = 1
for i in range(2, H + W):
factorial[i] = factorial[i - 1] * i % mod
inverse = [1] * (H + W)
# フェルマーの小定理から(x! ** mod-2 % mod == x! ** -1 % m... | false | 5 | [
"-factorial = [0] * (H + W)",
"+factorial = [1] * (H + W)",
"-inverse = [0] * (H + W)",
"-inverse[0] = 1",
"-inverse[1] = 1",
"- # フェルマーの小定理から(x! ** mod-2 % mod == x! ** -1 % mod)",
"- # powに第三引数入れると冪乗のmod付計算を高速にやってくれる",
"- inverse[i] = pow(factorial[i], mod - 2, mod)",
"+inverse = [1] * (H... | false | 0.040133 | 0.04036 | 0.994374 | [
"s668782399",
"s470616552"
] |
u553987207 | p02953 | python | s935460876 | s825705714 | 90 | 71 | 14,396 | 20,832 | Accepted | Accepted | 21.11 | N = int(eval(input()))
H = list(map(int, input().split()))
H.reverse()
for i in range(1, N):
if H[i-1] < H[i] - 1:
print("No")
break
elif H[i-1] == H[i] - 1:
H[i] -= 1
else:
print("Yes") | N = int(eval(input()))
H = list(map(int, input().split()))
for i in range(N - 2, -1, -1):
if H[i] <= H[i+1]:
continue
elif H[i] - 1 == H[i+1]:
H[i] -= 1
else:
print("No")
break
else:
print("Yes") | 11 | 12 | 226 | 248 | N = int(eval(input()))
H = list(map(int, input().split()))
H.reverse()
for i in range(1, N):
if H[i - 1] < H[i] - 1:
print("No")
break
elif H[i - 1] == H[i] - 1:
H[i] -= 1
else:
print("Yes")
| N = int(eval(input()))
H = list(map(int, input().split()))
for i in range(N - 2, -1, -1):
if H[i] <= H[i + 1]:
continue
elif H[i] - 1 == H[i + 1]:
H[i] -= 1
else:
print("No")
break
else:
print("Yes")
| false | 8.333333 | [
"-H.reverse()",
"-for i in range(1, N):",
"- if H[i - 1] < H[i] - 1:",
"+for i in range(N - 2, -1, -1):",
"+ if H[i] <= H[i + 1]:",
"+ continue",
"+ elif H[i] - 1 == H[i + 1]:",
"+ H[i] -= 1",
"+ else:",
"- elif H[i - 1] == H[i] - 1:",
"- H[i] -= 1"
] | false | 0.048038 | 0.042902 | 1.119707 | [
"s935460876",
"s825705714"
] |
u375253797 | p03013 | python | s710504248 | s165510469 | 490 | 200 | 460,020 | 6,900 | Accepted | Accepted | 59.18 | N, M = list(map(int, input().split()))
dp = [0] * N
for _ in range(M):
a = int(eval(input()))
dp[a-1] = -1
k = 1000000007
for i in range(N):
if dp[i] == -1:
dp[i] = 0
continue
if i == 0:
dp[i] = 1
continue
if i == 1:
dp[i] = dp[i-1] + 1
... | N, M = list(map(int, input().split()))
dp = [0] * N
for _ in range(M):
a = int(eval(input()))
dp[a-1] = -1
k = 1000000007
for i in range(N):
if dp[i] == -1:
dp[i] = 0
continue
if i == 0:
dp[i] = 1
continue
if i == 1:
dp[i] = dp[i-1] + 1
... | 25 | 26 | 386 | 393 | N, M = list(map(int, input().split()))
dp = [0] * N
for _ in range(M):
a = int(eval(input()))
dp[a - 1] = -1
k = 1000000007
for i in range(N):
if dp[i] == -1:
dp[i] = 0
continue
if i == 0:
dp[i] = 1
continue
if i == 1:
dp[i] = dp[i - 1] + 1
continue
... | N, M = list(map(int, input().split()))
dp = [0] * N
for _ in range(M):
a = int(eval(input()))
dp[a - 1] = -1
k = 1000000007
for i in range(N):
if dp[i] == -1:
dp[i] = 0
continue
if i == 0:
dp[i] = 1
continue
if i == 1:
dp[i] = dp[i - 1] + 1
continue
... | false | 3.846154 | [
"-n = dp[-1] % k",
"-print(n)",
"+ dp[i] %= k",
"+print((dp[-1]))"
] | false | 0.092808 | 0.042119 | 2.203458 | [
"s710504248",
"s165510469"
] |
u069838609 | p03283 | python | s116607151 | s063060034 | 1,603 | 600 | 66,836 | 103,132 | Accepted | Accepted | 62.57 | from copy import deepcopy
N, M, Q = [int(elem) for elem in input().split(' ')]
lines = [[int(elem) for elem in input().split(' ')] for _ in range(M)]
queries = [[int(elem) for elem in input().split(' ')] for _ in range(Q)]
def cuml_1d(N, lines, queries):
coords = [[0] * N for _ in range(N)]
for l, r... | import sys
fin = sys.stdin.readline
N, M, Q = [int(elem) for elem in fin().split()]
trains = [[int(elem) - 1 for elem in fin().split()] for _ in range(M)]
queries = [[int(elem) - 1 for elem in fin().split()] for _ in range(Q)]
map_2D = [[0] * N for _ in range(N)]
for l, r in trains:
map_2D[l][r] += 1
... | 52 | 29 | 1,621 | 751 | from copy import deepcopy
N, M, Q = [int(elem) for elem in input().split(" ")]
lines = [[int(elem) for elem in input().split(" ")] for _ in range(M)]
queries = [[int(elem) for elem in input().split(" ")] for _ in range(Q)]
def cuml_1d(N, lines, queries):
coords = [[0] * N for _ in range(N)]
for l, r in lines... | import sys
fin = sys.stdin.readline
N, M, Q = [int(elem) for elem in fin().split()]
trains = [[int(elem) - 1 for elem in fin().split()] for _ in range(M)]
queries = [[int(elem) - 1 for elem in fin().split()] for _ in range(Q)]
map_2D = [[0] * N for _ in range(N)]
for l, r in trains:
map_2D[l][r] += 1
cuml_1D = [[0... | false | 44.230769 | [
"-from copy import deepcopy",
"+import sys",
"-N, M, Q = [int(elem) for elem in input().split(\" \")]",
"-lines = [[int(elem) for elem in input().split(\" \")] for _ in range(M)]",
"-queries = [[int(elem) for elem in input().split(\" \")] for _ in range(Q)]",
"-",
"-",
"-def cuml_1d(N, lines, queries)... | false | 0.058886 | 0.036396 | 1.617922 | [
"s116607151",
"s063060034"
] |
u844646164 | p03339 | python | s667092783 | s278752074 | 1,145 | 234 | 29,424 | 67,824 | Accepted | Accepted | 79.56 | import numpy as np
N = int(eval(input()))
S = np.array(list(eval(input())))
n = []
for i in range(N):
if S[i] == 'E':
S[i] = 1
else:
S[i] = 0
S = np.array(S, dtype=int)
S = np.cumsum(S)
last = S[N-1]
n.append(last-S[0])
for i in range(1, N):
ls = i - S[i-1]
rs = last - S[i... | N = int(eval(input()))
S = list(eval(input()))
e = [0]*(N+1)
w = [0]*(N+1)
if S[0] == 'E':
e[0] += 1
else:
w[0] += 1
for i in range(1, N):
if S[i] == 'E':
e[i] += e[i-1] + 1
w[i] += w[i-1]
else:
e[i] += e[i-1]
w[i] += w[i-1] + 1
ans = float('inf')... | 18 | 21 | 346 | 399 | import numpy as np
N = int(eval(input()))
S = np.array(list(eval(input())))
n = []
for i in range(N):
if S[i] == "E":
S[i] = 1
else:
S[i] = 0
S = np.array(S, dtype=int)
S = np.cumsum(S)
last = S[N - 1]
n.append(last - S[0])
for i in range(1, N):
ls = i - S[i - 1]
rs = last - S[i]
n.... | N = int(eval(input()))
S = list(eval(input()))
e = [0] * (N + 1)
w = [0] * (N + 1)
if S[0] == "E":
e[0] += 1
else:
w[0] += 1
for i in range(1, N):
if S[i] == "E":
e[i] += e[i - 1] + 1
w[i] += w[i - 1]
else:
e[i] += e[i - 1]
w[i] += w[i - 1] + 1
ans = float("inf")
for i in... | false | 14.285714 | [
"-import numpy as np",
"-",
"-S = np.array(list(eval(input())))",
"-n = []",
"+S = list(eval(input()))",
"+e = [0] * (N + 1)",
"+w = [0] * (N + 1)",
"+if S[0] == \"E\":",
"+ e[0] += 1",
"+else:",
"+ w[0] += 1",
"+for i in range(1, N):",
"+ if S[i] == \"E\":",
"+ e[i] += e[i... | false | 0.00678 | 0.040419 | 0.16773 | [
"s667092783",
"s278752074"
] |
u622847899 | p02629 | python | s178188524 | s190176353 | 29 | 25 | 9,240 | 9,160 | Accepted | Accepted | 13.79 | n=int(eval(input()))
alphabet=[None] + [chr(i) for i in range(97,97+26)]
rest=[]
while n!=0:
rest.append(n%26)
n = n // 26
rest.reverse()
for i in range(len(rest)-1):
if rest[len(rest)-1-i]<=0:
rest[len(rest)-1-i]+=26
rest[len(rest)-2-i]-=1
if rest[0]<=0:
rest=rest[1:]
... | n=int(eval(input()))
alphabet=[chr(i) for i in range(97,97+26)]
ans=''
while n>0:
n-=1
ans+=alphabet[n%26]
n //= 26
print((ans[::-1])) | 21 | 10 | 392 | 149 | n = int(eval(input()))
alphabet = [None] + [chr(i) for i in range(97, 97 + 26)]
rest = []
while n != 0:
rest.append(n % 26)
n = n // 26
rest.reverse()
for i in range(len(rest) - 1):
if rest[len(rest) - 1 - i] <= 0:
rest[len(rest) - 1 - i] += 26
rest[len(rest) - 2 - i] -= 1
if rest[0] <= 0:
... | n = int(eval(input()))
alphabet = [chr(i) for i in range(97, 97 + 26)]
ans = ""
while n > 0:
n -= 1
ans += alphabet[n % 26]
n //= 26
print((ans[::-1]))
| false | 52.380952 | [
"-alphabet = [None] + [chr(i) for i in range(97, 97 + 26)]",
"-rest = []",
"-while n != 0:",
"- rest.append(n % 26)",
"- n = n // 26",
"-rest.reverse()",
"-for i in range(len(rest) - 1):",
"- if rest[len(rest) - 1 - i] <= 0:",
"- rest[len(rest) - 1 - i] += 26",
"- rest[len(r... | false | 0.038935 | 0.038905 | 1.000776 | [
"s178188524",
"s190176353"
] |
u951031728 | p02577 | python | s882089756 | s804104246 | 244 | 207 | 9,264 | 9,324 | Accepted | Accepted | 15.16 | N = eval(input())
sum = 0
if int(N) != 0:
data_size = len(N)
for data_size in range(data_size):
sum += int(N[data_size])
else:
sum = 0
if sum%9 == 0:
print('Yes')
else:
print('No') | if int(eval(input()))%9 == 0:
print('Yes')
else:
print('No') | 15 | 4 | 219 | 61 | N = eval(input())
sum = 0
if int(N) != 0:
data_size = len(N)
for data_size in range(data_size):
sum += int(N[data_size])
else:
sum = 0
if sum % 9 == 0:
print("Yes")
else:
print("No")
| if int(eval(input())) % 9 == 0:
print("Yes")
else:
print("No")
| false | 73.333333 | [
"-N = eval(input())",
"-sum = 0",
"-if int(N) != 0:",
"- data_size = len(N)",
"- for data_size in range(data_size):",
"- sum += int(N[data_size])",
"-else:",
"- sum = 0",
"-if sum % 9 == 0:",
"+if int(eval(input())) % 9 == 0:"
] | false | 0.041966 | 0.044785 | 0.937052 | [
"s882089756",
"s804104246"
] |
u002663801 | p02683 | python | s706369620 | s569034613 | 96 | 88 | 9,324 | 9,364 | Accepted | Accepted | 8.33 | import copy
s = input().split()
n = int(s[0])
m = int(s[1])
x = int(s[2])
s_list = [[0 for i in range(m+1)] for j in range(n)]
for i in range(n):
r = input().split()
s_list[i][0] = int(r[0])
for j in range(1,m + 1):
s_list[i][j] = int(r[j])
gen = [0] * (m + 1)
kakaku = -1
fo... | import copy
s = input().split()
n = int(s[0])
m = int(s[1])
x = int(s[2])
s_list = [[0 for i in range(m+1)] for j in range(n)]
for i in range(n):
r = input().split()
s_list[i][0] = int(r[0])
for j in range(1,m + 1):
s_list[i][j] = int(r[j])
gen = [0] * (m + 1)
kakaku = -1
fo... | 37 | 35 | 754 | 711 | import copy
s = input().split()
n = int(s[0])
m = int(s[1])
x = int(s[2])
s_list = [[0 for i in range(m + 1)] for j in range(n)]
for i in range(n):
r = input().split()
s_list[i][0] = int(r[0])
for j in range(1, m + 1):
s_list[i][j] = int(r[j])
gen = [0] * (m + 1)
kakaku = -1
for i in range(2**n):
... | import copy
s = input().split()
n = int(s[0])
m = int(s[1])
x = int(s[2])
s_list = [[0 for i in range(m + 1)] for j in range(n)]
for i in range(n):
r = input().split()
s_list[i][0] = int(r[0])
for j in range(1, m + 1):
s_list[i][j] = int(r[j])
gen = [0] * (m + 1)
kakaku = -1
for i in range(2**n):
... | false | 5.405405 | [
"- k = i",
"- for j in reversed(list(range(n))):",
"- if k >= 2**j:",
"- k -= 2**j",
"+ for j in range(n):",
"+ if (i >> j) & 1:"
] | false | 0.03955 | 0.038812 | 1.019016 | [
"s706369620",
"s569034613"
] |
u007991836 | p03107 | python | s967098155 | s837048563 | 38 | 34 | 3,188 | 3,188 | Accepted | Accepted | 10.53 | s = eval(input())
0
count_0 = 0
count_1 = 0
for i in range(len(s)):
if s[i] == '0':
count_0 += 1
else:
count_1 += 1
print((min(count_0,count_1) * 2))
| s = eval(input())
count_0 = 0
count_1 = 0
for i in range(len(s)):
if s[i] == '0':
count_0 += 1
else:
count_1 += 1
print((min(count_0,count_1) * 2))
| 12 | 11 | 179 | 176 | s = eval(input())
0
count_0 = 0
count_1 = 0
for i in range(len(s)):
if s[i] == "0":
count_0 += 1
else:
count_1 += 1
print((min(count_0, count_1) * 2))
| s = eval(input())
count_0 = 0
count_1 = 0
for i in range(len(s)):
if s[i] == "0":
count_0 += 1
else:
count_1 += 1
print((min(count_0, count_1) * 2))
| false | 8.333333 | [
"-0"
] | false | 0.037956 | 0.039805 | 0.953535 | [
"s967098155",
"s837048563"
] |
u652656291 | p02708 | python | s423952514 | s990876568 | 142 | 123 | 9,124 | 9,172 | Accepted | Accepted | 13.38 | n,k=list(map(int,input().split()))
ans=0
for i in range(k,n+2):
a=0.5*i*(i-1)
b=0.5*n*(n+1)-0.5*(n-i)*(n-i+1)
ans+=int(b-a+1)
print((ans%(10**9+7))) | MOD = 10 ** 9 + 7
n, k = list(map(int, input().split()))
def calc(a):
smallest = a * (a-1) // 2
largest = smallest + a * (n-a+1)
return largest - smallest + 1
ans = 0
for a in range(k, n+2):
ans += calc(a)
ans %= MOD
print(ans)
| 9 | 15 | 162 | 260 | n, k = list(map(int, input().split()))
ans = 0
for i in range(k, n + 2):
a = 0.5 * i * (i - 1)
b = 0.5 * n * (n + 1) - 0.5 * (n - i) * (n - i + 1)
ans += int(b - a + 1)
print((ans % (10**9 + 7)))
| MOD = 10**9 + 7
n, k = list(map(int, input().split()))
def calc(a):
smallest = a * (a - 1) // 2
largest = smallest + a * (n - a + 1)
return largest - smallest + 1
ans = 0
for a in range(k, n + 2):
ans += calc(a)
ans %= MOD
print(ans)
| false | 40 | [
"+MOD = 10**9 + 7",
"+",
"+",
"+def calc(a):",
"+ smallest = a * (a - 1) // 2",
"+ largest = smallest + a * (n - a + 1)",
"+ return largest - smallest + 1",
"+",
"+",
"-for i in range(k, n + 2):",
"- a = 0.5 * i * (i - 1)",
"- b = 0.5 * n * (n + 1) - 0.5 * (n - i) * (n - i + 1)"... | false | 0.188334 | 0.007815 | 24.099631 | [
"s423952514",
"s990876568"
] |
u620084012 | p03612 | python | s180463128 | s770047995 | 82 | 67 | 14,008 | 14,008 | Accepted | Accepted | 18.29 | N = int(eval(input()))
p = list(map(int,input().split()))
l = [0 for k in range(N+2)]
for k in range(N):
if p[k] == k+1:
l[k+1] = 1
t = 0
ans = 0
for e in l:
if e == 1:
t += 1
else:
ans += (t+1)//2
t = 0
print(ans)
| N = int(eval(input()))
p = list(map(int,input().split()))
ans = 0
k = 0
while k < N:
if p[k] == k+1:
k += 1
ans += 1
k += 1
print(ans)
| 17 | 10 | 271 | 162 | N = int(eval(input()))
p = list(map(int, input().split()))
l = [0 for k in range(N + 2)]
for k in range(N):
if p[k] == k + 1:
l[k + 1] = 1
t = 0
ans = 0
for e in l:
if e == 1:
t += 1
else:
ans += (t + 1) // 2
t = 0
print(ans)
| N = int(eval(input()))
p = list(map(int, input().split()))
ans = 0
k = 0
while k < N:
if p[k] == k + 1:
k += 1
ans += 1
k += 1
print(ans)
| false | 41.176471 | [
"-l = [0 for k in range(N + 2)]",
"-for k in range(N):",
"+ans = 0",
"+k = 0",
"+while k < N:",
"- l[k + 1] = 1",
"-t = 0",
"-ans = 0",
"-for e in l:",
"- if e == 1:",
"- t += 1",
"- else:",
"- ans += (t + 1) // 2",
"- t = 0",
"+ k += 1",
"+ ... | false | 0.037199 | 0.03686 | 1.009199 | [
"s180463128",
"s770047995"
] |
u077291787 | p03846 | python | s767964934 | s415911937 | 66 | 44 | 16,624 | 14,324 | Accepted | Accepted | 33.33 | # ARC066C - Lining Up (ABC050C)
from collections import Counter
def main():
n = int(eval(input()))
a = sorted(Counter(list(map(int, input().rstrip().split()))).items())
MOD = 10 ** 9 + 7
if n % 2 == 1 and a[0][1] != 1:
print((0))
elif not all(i[1] == 2 for i in a[1:]):
p... | # ARC066C - Lining Up (ABC050C)
from collections import Counter
def main():
n = int(eval(input()))
a = tuple(map(int, input().rstrip().split()))
MOD = 10 ** 9 + 7
s = (n // 2) * 2
l = (n + 1) // 2
p = l if n % 2 == 0 else l - 1
if sum(a) == s * l:
print((2 ** p % MOD))
... | 21 | 19 | 489 | 384 | # ARC066C - Lining Up (ABC050C)
from collections import Counter
def main():
n = int(eval(input()))
a = sorted(Counter(list(map(int, input().rstrip().split()))).items())
MOD = 10**9 + 7
if n % 2 == 1 and a[0][1] != 1:
print((0))
elif not all(i[1] == 2 for i in a[1:]):
print((0))
... | # ARC066C - Lining Up (ABC050C)
from collections import Counter
def main():
n = int(eval(input()))
a = tuple(map(int, input().rstrip().split()))
MOD = 10**9 + 7
s = (n // 2) * 2
l = (n + 1) // 2
p = l if n % 2 == 0 else l - 1
if sum(a) == s * l:
print((2**p % MOD))
else:
... | false | 9.52381 | [
"- a = sorted(Counter(list(map(int, input().rstrip().split()))).items())",
"+ a = tuple(map(int, input().rstrip().split()))",
"- if n % 2 == 1 and a[0][1] != 1:",
"+ s = (n // 2) * 2",
"+ l = (n + 1) // 2",
"+ p = l if n % 2 == 0 else l - 1",
"+ if sum(a) == s * l:",
"+ pri... | false | 0.059992 | 0.059514 | 1.008046 | [
"s767964934",
"s415911937"
] |
u423665486 | p02688 | python | s889733480 | s010623895 | 56 | 22 | 67,876 | 9,112 | Accepted | Accepted | 60.71 | def resolve():
n, k = list(map(int, input().split()))
p = [0]*n
for _ in range(k):
eval(input())
t = list(map(int, input().split()))
for i in t:
p[i-1] += 1
ans = 0
for i in p:
if i == 0:
ans += 1
print(ans)
resolve() | def resolve():
n, k = list(map(int, input().split()))
s = [False]*n
for i in range(k):
eval(input())
for j in list(map(int, input().split())):
s[j-1] = True
print((s.count(False)))
resolve() | 14 | 9 | 238 | 195 | def resolve():
n, k = list(map(int, input().split()))
p = [0] * n
for _ in range(k):
eval(input())
t = list(map(int, input().split()))
for i in t:
p[i - 1] += 1
ans = 0
for i in p:
if i == 0:
ans += 1
print(ans)
resolve()
| def resolve():
n, k = list(map(int, input().split()))
s = [False] * n
for i in range(k):
eval(input())
for j in list(map(int, input().split())):
s[j - 1] = True
print((s.count(False)))
resolve()
| false | 35.714286 | [
"- p = [0] * n",
"- for _ in range(k):",
"+ s = [False] * n",
"+ for i in range(k):",
"- t = list(map(int, input().split()))",
"- for i in t:",
"- p[i - 1] += 1",
"- ans = 0",
"- for i in p:",
"- if i == 0:",
"- ans += 1",
"- prin... | false | 0.080731 | 0.037319 | 2.163306 | [
"s889733480",
"s010623895"
] |
u753386263 | p03163 | python | s159413471 | s582537618 | 483 | 252 | 120,300 | 148,692 | Accepted | Accepted | 47.83 | N, W = list(map(int, input().split()))
w, v = [0] * N, [0] * N
for i in range(N):
w[i], v[i] = list(map(int, input().split()))
dp = [[0] * (W + 1) for _ in range(N + 1)]
# dp[i][j](j=0,1,...,W)の値が求まっている状態で、dp[i+1][j]を更新することを考える
for i in range(N):
for j in range(W+1):#重さ0からWまでチェック
if j-w[i]>=0:#... | N, W = list(map(int, input().split()))
w, v = [0] * N, [0] * N
for i in range(N):
w[i], v[i] = list(map(int, input().split()))
DP = [[0] * (W + 2) for i in range(N + 2)]
"""
DP[0][W]
DP[i][j]
i:荷物の個数
j:残り容量
"""
for i in range(N):
for j in range(W+1):
if j>=w[i]:#残り容量に余裕があるとき
DP[... | 15 | 20 | 462 | 417 | N, W = list(map(int, input().split()))
w, v = [0] * N, [0] * N
for i in range(N):
w[i], v[i] = list(map(int, input().split()))
dp = [[0] * (W + 1) for _ in range(N + 1)]
# dp[i][j](j=0,1,...,W)の値が求まっている状態で、dp[i+1][j]を更新することを考える
for i in range(N):
for j in range(W + 1): # 重さ0からWまでチェック
if j - w[i] >= 0: ... | N, W = list(map(int, input().split()))
w, v = [0] * N, [0] * N
for i in range(N):
w[i], v[i] = list(map(int, input().split()))
DP = [[0] * (W + 2) for i in range(N + 2)]
"""
DP[0][W]
DP[i][j]
i:荷物の個数
j:残り容量
"""
for i in range(N):
for j in range(W + 1):
if j >= w[i]: # 残り容量に余裕があるとき
DP[i + 1]... | false | 25 | [
"-dp = [[0] * (W + 1) for _ in range(N + 1)]",
"-# dp[i][j](j=0,1,...,W)の値が求まっている状態で、dp[i+1][j]を更新することを考える",
"+DP = [[0] * (W + 2) for i in range(N + 2)]",
"+\"\"\"",
"+DP[0][W]",
"+DP[i][j]",
"+i:荷物の個数",
"+j:残り容量",
"+\"\"\"",
"- for j in range(W + 1): # 重さ0からWまでチェック",
"- if j - w[i] ... | false | 0.082082 | 0.082328 | 0.997002 | [
"s159413471",
"s582537618"
] |
u936985471 | p03044 | python | s571320926 | s038881242 | 748 | 388 | 45,396 | 42,684 | Accepted | Accepted | 48.13 | import sys
readline = sys.stdin.readline
# スタートを0で塗り、行先が奇数であれば違う色で塗る、を繰り返せばよい
N = int(readline())
G = [[] for i in range(N)]
for i in range(N - 1):
u,v,w = list(map(int,readline().split()))
G[u - 1].append([v - 1, w])
G[v - 1].append([u - 1, w])
ans = [-1] * N
stack = []
# 頂点, 色
stack.append([... | import sys
readline = sys.stdin.readline
N = int(readline())
G = [[] for i in range(N)]
for i in range(N - 1):
u,v,w = list(map(int,readline().split()))
G[u - 1].append((v - 1, w))
G[v - 1].append((u - 1, w))
color = [-1] * N
stack = []
stack.append([0, -1, 0])
while stack:
v,parent,cost = s... | 30 | 24 | 556 | 496 | import sys
readline = sys.stdin.readline
# スタートを0で塗り、行先が奇数であれば違う色で塗る、を繰り返せばよい
N = int(readline())
G = [[] for i in range(N)]
for i in range(N - 1):
u, v, w = list(map(int, readline().split()))
G[u - 1].append([v - 1, w])
G[v - 1].append([u - 1, w])
ans = [-1] * N
stack = []
# 頂点, 色
stack.append([0, 0])
whi... | import sys
readline = sys.stdin.readline
N = int(readline())
G = [[] for i in range(N)]
for i in range(N - 1):
u, v, w = list(map(int, readline().split()))
G[u - 1].append((v - 1, w))
G[v - 1].append((u - 1, w))
color = [-1] * N
stack = []
stack.append([0, -1, 0])
while stack:
v, parent, cost = stack.p... | false | 20 | [
"-# スタートを0で塗り、行先が奇数であれば違う色で塗る、を繰り返せばよい",
"- G[u - 1].append([v - 1, w])",
"- G[v - 1].append([u - 1, w])",
"-ans = [-1] * N",
"+ G[u - 1].append((v - 1, w))",
"+ G[v - 1].append((u - 1, w))",
"+color = [-1] * N",
"-# 頂点, 色",
"-stack.append([0, 0])",
"+stack.append([0, -1, 0])",
"- ... | false | 0.168455 | 0.086779 | 1.941187 | [
"s571320926",
"s038881242"
] |
u852690916 | p03240 | python | s760459903 | s168935451 | 651 | 209 | 3,064 | 42,972 | Accepted | Accepted | 67.9 | N=int(eval(input()))
xyh=[list(map(int,input().split())) for _ in range(N)]
def calcH(x,y,h,Cx,Cy):
if h>0:
return(h+abs(x-Cx)+abs(y-Cy))
return -1
for Cx in range(100+1):
for Cy in range(100+1):
H=-1
check=[]
for x,y,h in xyh:
Hi=calcH(x,y,h,Cx,Cy)... | import sys
def main():
input = sys.stdin.readline
N = int(eval(input()))
xyh = [tuple(map(int, input().split())) for _ in range(N)]
xyh.sort(reverse=True, key=lambda x:x[2])
def check(cx, cy):
def dist(x, y): return abs(x-cx) + abs(y-cy)
tmp = 0
for x, y, h in xyh:... | 28 | 28 | 679 | 754 | N = int(eval(input()))
xyh = [list(map(int, input().split())) for _ in range(N)]
def calcH(x, y, h, Cx, Cy):
if h > 0:
return h + abs(x - Cx) + abs(y - Cy)
return -1
for Cx in range(100 + 1):
for Cy in range(100 + 1):
H = -1
check = []
for x, y, h in xyh:
Hi =... | import sys
def main():
input = sys.stdin.readline
N = int(eval(input()))
xyh = [tuple(map(int, input().split())) for _ in range(N)]
xyh.sort(reverse=True, key=lambda x: x[2])
def check(cx, cy):
def dist(x, y):
return abs(x - cx) + abs(y - cy)
tmp = 0
for x, y,... | false | 0 | [
"-N = int(eval(input()))",
"-xyh = [list(map(int, input().split())) for _ in range(N)]",
"+import sys",
"-def calcH(x, y, h, Cx, Cy):",
"- if h > 0:",
"- return h + abs(x - Cx) + abs(y - Cy)",
"- return -1",
"+def main():",
"+ input = sys.stdin.readline",
"+ N = int(eval(input()... | false | 0.04579 | 0.038578 | 1.186939 | [
"s760459903",
"s168935451"
] |
u089032001 | p02910 | python | s074942846 | s635349537 | 25 | 19 | 3,188 | 3,188 | Accepted | Accepted | 24 | import re
def inpl():
return list(map(int, input().split()))
S = eval(input())
p = re.compile(r'([^L][^R])*[^L]?$')
if p.match(S):
print('Yes')
else:
print('No') | import re
def inpl():
return list(map(int, input().split()))
S = eval(input())
p = re.compile(r'^([^L][^R])*[^L]?$')
if p.match(S):
print('Yes')
else:
print('No') | 15 | 15 | 187 | 188 | import re
def inpl():
return list(map(int, input().split()))
S = eval(input())
p = re.compile(r"([^L][^R])*[^L]?$")
if p.match(S):
print("Yes")
else:
print("No")
| import re
def inpl():
return list(map(int, input().split()))
S = eval(input())
p = re.compile(r"^([^L][^R])*[^L]?$")
if p.match(S):
print("Yes")
else:
print("No")
| false | 0 | [
"-p = re.compile(r\"([^L][^R])*[^L]?$\")",
"+p = re.compile(r\"^([^L][^R])*[^L]?$\")"
] | false | 0.041382 | 0.040495 | 1.021896 | [
"s074942846",
"s635349537"
] |
u432551953 | p02954 | python | s054077242 | s176547143 | 506 | 411 | 54,616 | 57,264 | Accepted | Accepted | 18.77 | import sys
input = sys.stdin.readline
def main():
s = input().strip()
rc = 0
lc = 0
i = 0
n = len(s)
ans = [0] * n
while i <= n-2:
if s[i] == 'R':
rc += 1
if s[i] == 'R' and s[i+1] == 'L':
# 上でカウントしたのを覗く
rc -= 1
k = 0
while i+2+k < n and s[i+2+k] != 'R':
k += 1
# pr... | import sys
input = sys.stdin.readline
def main():
S = input().strip()
n = len(S)
ans = [0] * n
for _ in range(2):
cnt = 0
for i in range(n):
if S[i] == 'R':
cnt += 1
else:
ans[i] += cnt // 2
ans[i-1] += (cnt + 1) // 2
cnt = 0
ans = ans[::-1]
S = S[::-1]
S = ['R' if... | 40 | 25 | 738 | 472 | import sys
input = sys.stdin.readline
def main():
s = input().strip()
rc = 0
lc = 0
i = 0
n = len(s)
ans = [0] * n
while i <= n - 2:
if s[i] == "R":
rc += 1
if s[i] == "R" and s[i + 1] == "L":
# 上でカウントしたのを覗く
rc -= 1
k = 0
... | import sys
input = sys.stdin.readline
def main():
S = input().strip()
n = len(S)
ans = [0] * n
for _ in range(2):
cnt = 0
for i in range(n):
if S[i] == "R":
cnt += 1
else:
ans[i] += cnt // 2
ans[i - 1] += (cnt + 1... | false | 37.5 | [
"- s = input().strip()",
"- rc = 0",
"- lc = 0",
"- i = 0",
"- n = len(s)",
"+ S = input().strip()",
"+ n = len(S)",
"- while i <= n - 2:",
"- if s[i] == \"R\":",
"- rc += 1",
"- if s[i] == \"R\" and s[i + 1] == \"L\":",
"- # 上でカウントした... | false | 0.035699 | 0.036597 | 0.975482 | [
"s054077242",
"s176547143"
] |
u941047297 | p03705 | python | s444791824 | s545182271 | 168 | 35 | 38,412 | 9,160 | Accepted | Accepted | 79.17 | def main():
n, a, b = list(map(int, input().split()))
if (n == 1 and a != b) or (b < a):
print((0))
exit()
mini = a * (n - 1) + b
maxi = a + b * (n - 1)
print((maxi - mini + 1))
if __name__ == '__main__':
main()
| def main():
n, a, b = list(map(int, input().split()))
print((0 if (n == 1 and a != b) or a > b else (b - a) * (n - 1) + a - b + 1))
if __name__ == '__main__':
main()
| 12 | 6 | 261 | 180 | def main():
n, a, b = list(map(int, input().split()))
if (n == 1 and a != b) or (b < a):
print((0))
exit()
mini = a * (n - 1) + b
maxi = a + b * (n - 1)
print((maxi - mini + 1))
if __name__ == "__main__":
main()
| def main():
n, a, b = list(map(int, input().split()))
print((0 if (n == 1 and a != b) or a > b else (b - a) * (n - 1) + a - b + 1))
if __name__ == "__main__":
main()
| false | 50 | [
"- if (n == 1 and a != b) or (b < a):",
"- print((0))",
"- exit()",
"- mini = a * (n - 1) + b",
"- maxi = a + b * (n - 1)",
"- print((maxi - mini + 1))",
"+ print((0 if (n == 1 and a != b) or a > b else (b - a) * (n - 1) + a - b + 1))"
] | false | 0.032664 | 0.039364 | 0.829782 | [
"s444791824",
"s545182271"
] |
u788260274 | p03013 | python | s798566961 | s405856857 | 608 | 204 | 522,316 | 95,856 | Accepted | Accepted | 66.45 | from sys import stdin
import sys
import math
from functools import reduce
import functools
import itertools
from collections import deque,Counter,defaultdict
from operator import mul
import copy
# ! /usr/bin/env python
# -*- coding: utf-8 -*-
import heapq
sys.setrecursionlimit(10**6)
# INF = float("inf")
... | from sys import stdin
import sys
import math
from functools import reduce
import functools
import itertools
from collections import deque,Counter,defaultdict
from operator import mul
import copy
# ! /usr/bin/env python
# -*- coding: utf-8 -*-
import heapq
sys.setrecursionlimit(10**6)
# INF = float("inf")
... | 44 | 39 | 790 | 730 | from sys import stdin
import sys
import math
from functools import reduce
import functools
import itertools
from collections import deque, Counter, defaultdict
from operator import mul
import copy
# ! /usr/bin/env python
# -*- coding: utf-8 -*-
import heapq
sys.setrecursionlimit(10**6)
# INF = float("inf")
INF = 10*... | from sys import stdin
import sys
import math
from functools import reduce
import functools
import itertools
from collections import deque, Counter, defaultdict
from operator import mul
import copy
# ! /usr/bin/env python
# -*- coding: utf-8 -*-
import heapq
sys.setrecursionlimit(10**6)
# INF = float("inf")
INF = 10*... | false | 11.363636 | [
"+a = set()",
"+for i in range(M):",
"+ a.add(int(eval(input())))",
"-dp[1] = 1",
"+if 1 not in a:",
"+ dp[1] = 1",
"+else:",
"+ dp[1] = 0",
"- dp[i] = dp[i - 1] + dp[i - 2]",
"-ans = 1",
"-a = -1",
"-for i in range(M):",
"- b = int(eval(input()))",
"- c = b - a - 2",
"... | false | 0.035615 | 0.007678 | 4.638492 | [
"s798566961",
"s405856857"
] |
u372144784 | p03363 | python | s350621635 | s065636115 | 322 | 266 | 85,780 | 83,988 | Accepted | Accepted | 17.39 | import sys
readline = sys.stdin.buffer.readline
from collections import Counter
n = int(readline())
lst1 = list(map(int,readline().split()))
def cumsum(lst): #元のリストを保持
res = lst[:]
for i in range(1,len(res)):
res[i] += res[i-1]
return res
lst2 = [0]+cumsum(lst1)
c = Counter(lst2)
... | import sys
readline = sys.stdin.buffer.readline
n = int(readline())
lst1 = list(map(int,readline().split()))
def cumsum(lst): #元のリストを保持
res = lst[:]
for i in range(1,len(res)):
res[i] += res[i-1]
return res
lst2 = [0] + cumsum(lst1)
ans = 0
dic1 = dict()
for i in lst2:
if i ... | 22 | 24 | 416 | 420 | import sys
readline = sys.stdin.buffer.readline
from collections import Counter
n = int(readline())
lst1 = list(map(int, readline().split()))
def cumsum(lst): # 元のリストを保持
res = lst[:]
for i in range(1, len(res)):
res[i] += res[i - 1]
return res
lst2 = [0] + cumsum(lst1)
c = Counter(lst2)
ans =... | import sys
readline = sys.stdin.buffer.readline
n = int(readline())
lst1 = list(map(int, readline().split()))
def cumsum(lst): # 元のリストを保持
res = lst[:]
for i in range(1, len(res)):
res[i] += res[i - 1]
return res
lst2 = [0] + cumsum(lst1)
ans = 0
dic1 = dict()
for i in lst2:
if i in dic1:
... | false | 8.333333 | [
"-from collections import Counter",
"-",
"-c = Counter(lst2)",
"-for i in range(len(lst2) - 1):",
"- c[lst2[i]] -= 1",
"- ans += c[lst2[i]]",
"+dic1 = dict()",
"+for i in lst2:",
"+ if i in dic1:",
"+ ans += dic1[i]",
"+ dic1[i] += 1",
"+ else:",
"+ dic1[i] =... | false | 0.042033 | 0.044376 | 0.947218 | [
"s350621635",
"s065636115"
] |
u624475441 | p03339 | python | s984995822 | s215419537 | 216 | 161 | 15,244 | 3,700 | Accepted | Accepted | 25.46 | N = int(eval(input()))
S = eval(input())
ans = N
E = [0] * (N + 1)
for i in range(N):
E[i+1] = E[i] + (S[i] == 'E')
for i in range(N):
LR = i - E[i] + E[N] - E[i+1]
if LR < ans: ans = LR
print(ans) | eval(input())
S = eval(input())
res = cnt = S.count('E')
for c in S:
cnt -= c == 'E'
res = min(res, cnt)
cnt += c == 'W'
print(res) | 10 | 8 | 206 | 138 | N = int(eval(input()))
S = eval(input())
ans = N
E = [0] * (N + 1)
for i in range(N):
E[i + 1] = E[i] + (S[i] == "E")
for i in range(N):
LR = i - E[i] + E[N] - E[i + 1]
if LR < ans:
ans = LR
print(ans)
| eval(input())
S = eval(input())
res = cnt = S.count("E")
for c in S:
cnt -= c == "E"
res = min(res, cnt)
cnt += c == "W"
print(res)
| false | 20 | [
"-N = int(eval(input()))",
"+eval(input())",
"-ans = N",
"-E = [0] * (N + 1)",
"-for i in range(N):",
"- E[i + 1] = E[i] + (S[i] == \"E\")",
"-for i in range(N):",
"- LR = i - E[i] + E[N] - E[i + 1]",
"- if LR < ans:",
"- ans = LR",
"-print(ans)",
"+res = cnt = S.count(\"E\")",... | false | 0.043716 | 0.044403 | 0.984511 | [
"s984995822",
"s215419537"
] |
u608088992 | p03013 | python | s166105881 | s334610579 | 103 | 95 | 12,392 | 7,668 | Accepted | Accepted | 7.77 | import sys, math, collections, heapq, itertools
def gcd(a, b):
a, b = max(a, b), min(a, b)
while a % b > 0: a, b = b, a % b
return b
def solve():
file = sys.stdin.readline #single: int(file()), line: map(int, file().split())
INF = 10 ** 25
mod = 7 + 10 ** 9
N, M = list(map(int, ... | import sys
def solve():
input = sys.stdin.readline
N, M= list(map(int, input().split()))
mod = 7 + 10 ** 9
A = [True] * (N + 1)
for _ in range(M):
A[int(eval(input()))] = False
DP = [0] * (N + 1)
DP[0] = 1
for i in range(N):
if i < N - 1:
if A[i ... | 29 | 26 | 759 | 547 | import sys, math, collections, heapq, itertools
def gcd(a, b):
a, b = max(a, b), min(a, b)
while a % b > 0:
a, b = b, a % b
return b
def solve():
file = sys.stdin.readline # single: int(file()), line: map(int, file().split())
INF = 10**25
mod = 7 + 10**9
N, M = list(map(int, fil... | import sys
def solve():
input = sys.stdin.readline
N, M = list(map(int, input().split()))
mod = 7 + 10**9
A = [True] * (N + 1)
for _ in range(M):
A[int(eval(input()))] = False
DP = [0] * (N + 1)
DP[0] = 1
for i in range(N):
if i < N - 1:
if A[i + 2]:
... | false | 10.344828 | [
"-import sys, math, collections, heapq, itertools",
"-",
"-",
"-def gcd(a, b):",
"- a, b = max(a, b), min(a, b)",
"- while a % b > 0:",
"- a, b = b, a % b",
"- return b",
"+import sys",
"- file = sys.stdin.readline # single: int(file()), line: map(int, file().split())",
"- ... | false | 0.049463 | 0.049622 | 0.996793 | [
"s166105881",
"s334610579"
] |
u354638986 | p03607 | python | s726417700 | s459998340 | 276 | 239 | 11,884 | 15,076 | Accepted | Accepted | 13.41 | n = int(eval(input()))
nums = set()
for i in range(n):
a = int(eval(input()))
try:
nums.remove(a)
except KeyError:
nums.add(a)
print((len(nums)))
| n = int(eval(input()))
times = {}
for i in range(n):
a = int(eval(input()))
times[a] = times.get(a, 0) + 1
cnt = 0
for i in times:
if times[i]%2 == 1:
cnt += 1
print(cnt)
| 12 | 14 | 174 | 196 | n = int(eval(input()))
nums = set()
for i in range(n):
a = int(eval(input()))
try:
nums.remove(a)
except KeyError:
nums.add(a)
print((len(nums)))
| n = int(eval(input()))
times = {}
for i in range(n):
a = int(eval(input()))
times[a] = times.get(a, 0) + 1
cnt = 0
for i in times:
if times[i] % 2 == 1:
cnt += 1
print(cnt)
| false | 14.285714 | [
"-nums = set()",
"+times = {}",
"- try:",
"- nums.remove(a)",
"- except KeyError:",
"- nums.add(a)",
"-print((len(nums)))",
"+ times[a] = times.get(a, 0) + 1",
"+cnt = 0",
"+for i in times:",
"+ if times[i] % 2 == 1:",
"+ cnt += 1",
"+print(cnt)"
] | false | 0.047647 | 0.037984 | 1.254398 | [
"s726417700",
"s459998340"
] |
u882460931 | p03273 | python | s965021054 | s236339950 | 29 | 22 | 4,468 | 3,064 | Accepted | Accepted | 24.14 | h, w = (int(v) for v in input().split())
a = [input() for _ in range(h)]
my = [True for _ in range(h)]
mx = [True for _ in range(w)]
for y in range(h):
for x in range(w):
if a[y][x] != '.':
break
else:
my[y] = False
for x in range(w):
for y in range(h):
... | h, w = (int(v) for v in input().split())
a = [input() for _ in range(h)]
my = [True for _ in range(h)]
mx = [True for _ in range(w)]
for y in range(h):
for x in range(w):
if a[y][x] != '.':
break
else:
my[y] = False
for x in range(w):
for y in range(h):
... | 26 | 28 | 534 | 552 | h, w = (int(v) for v in input().split())
a = [input() for _ in range(h)]
my = [True for _ in range(h)]
mx = [True for _ in range(w)]
for y in range(h):
for x in range(w):
if a[y][x] != ".":
break
else:
my[y] = False
for x in range(w):
for y in range(h):
if a[y][x] != ".":... | h, w = (int(v) for v in input().split())
a = [input() for _ in range(h)]
my = [True for _ in range(h)]
mx = [True for _ in range(w)]
for y in range(h):
for x in range(w):
if a[y][x] != ".":
break
else:
my[y] = False
for x in range(w):
for y in range(h):
if a[y][x] != ".":... | false | 7.142857 | [
"+s = \"\"",
"- print(a[y][x], end=\"\")",
"+ s += a[y][x]",
"- print()",
"+ s += \"\\n\"",
"+print(s, end=\"\")"
] | false | 0.041198 | 0.1145 | 0.359806 | [
"s965021054",
"s236339950"
] |
u707808519 | p02727 | python | s966244303 | s450553002 | 293 | 252 | 23,644 | 24,064 | Accepted | Accepted | 13.99 | X, Y, R, G, N = list(map(int, input().split()))
r = [int(x) for x in input().split()]
g = [int(x) for x in input().split()]
n = [int(x) for x in input().split()]
r = sorted(r)[R-X:]
g = sorted(g)[G-Y:]
n = sorted(n, reverse=True)
nr = 0; ng = 0; nn = 0
for i in range(N):
if n[nn] <= min(r[nr], g[ng]):
... | X, Y, R, G, N = list(map(int, input().split()))
r = [int(x) for x in input().split()]
g = [int(x) for x in input().split()]
n = [int(x) for x in input().split()]
r = sorted(r)[R-X:]
g = sorted(g)[G-Y:]
apple = r + g + n
apple = sorted(apple)[len(apple)-(X+Y):]
print((sum(apple))) | 25 | 10 | 565 | 282 | X, Y, R, G, N = list(map(int, input().split()))
r = [int(x) for x in input().split()]
g = [int(x) for x in input().split()]
n = [int(x) for x in input().split()]
r = sorted(r)[R - X :]
g = sorted(g)[G - Y :]
n = sorted(n, reverse=True)
nr = 0
ng = 0
nn = 0
for i in range(N):
if n[nn] <= min(r[nr], g[ng]):
b... | X, Y, R, G, N = list(map(int, input().split()))
r = [int(x) for x in input().split()]
g = [int(x) for x in input().split()]
n = [int(x) for x in input().split()]
r = sorted(r)[R - X :]
g = sorted(g)[G - Y :]
apple = r + g + n
apple = sorted(apple)[len(apple) - (X + Y) :]
print((sum(apple)))
| false | 60 | [
"-n = sorted(n, reverse=True)",
"-nr = 0",
"-ng = 0",
"-nn = 0",
"-for i in range(N):",
"- if n[nn] <= min(r[nr], g[ng]):",
"- break",
"- if r[nr] < g[ng]:",
"- r[nr] = n[nn]",
"- nr += 1",
"- if nr == X:",
"- nr = X - 1",
"- else:",
"- ... | false | 0.034765 | 0.033354 | 1.042315 | [
"s966244303",
"s450553002"
] |
u340781749 | p03097 | python | s520375017 | s486883283 | 310 | 189 | 11,364 | 11,276 | Accepted | Accepted | 39.03 | def split(n, a, b, used, ai, ans, width):
# print(n, a, b, used, ai, ans, width)
# print(*(f'{c:5d}' for c in ans))
# print(*(f'{c:05b}' for c in ans))
if width == 2:
ans[ai] = a
ans[ai + 1] = b
return
x = a ^ b
y = x & -x # Rightmost Bit where is different a an... | def split(n, a, b, remain, ai, ans, width):
# print(n, a, b, remain, ai, ans, width)
# print(*(f'{c:5d}' for c in ans))
# print(*(f'{c:05b}' for c in ans))
if width == 2:
ans[ai] = a
ans[ai + 1] = b
return
x = a ^ b
y = x & -x # Rightmost Bit at which is differe... | 37 | 34 | 935 | 911 | def split(n, a, b, used, ai, ans, width):
# print(n, a, b, used, ai, ans, width)
# print(*(f'{c:5d}' for c in ans))
# print(*(f'{c:05b}' for c in ans))
if width == 2:
ans[ai] = a
ans[ai + 1] = b
return
x = a ^ b
y = x & -x # Rightmost Bit where is different a and b
l... | def split(n, a, b, remain, ai, ans, width):
# print(n, a, b, remain, ai, ans, width)
# print(*(f'{c:5d}' for c in ans))
# print(*(f'{c:05b}' for c in ans))
if width == 2:
ans[ai] = a
ans[ai + 1] = b
return
x = a ^ b
y = x & -x # Rightmost Bit at which is different for a ... | false | 8.108108 | [
"-def split(n, a, b, used, ai, ans, width):",
"- # print(n, a, b, used, ai, ans, width)",
"+def split(n, a, b, remain, ai, ans, width):",
"+ # print(n, a, b, remain, ai, ans, width)",
"- y = x & -x # Rightmost Bit where is different a and b",
"+ y = x & -x # Rightmost Bit at which is differe... | false | 0.14862 | 0.048454 | 3.06722 | [
"s520375017",
"s486883283"
] |
u936985471 | p02947 | python | s979621907 | s673022054 | 398 | 354 | 11,368 | 19,748 | Accepted | Accepted | 11.06 | n=int(eval(input()))
s=[None]*n
for i in range(n):
s[i]="".join(sorted(eval(input())))
s=sorted(s)
total=0
count=1
for j in range(1,n):
if s[j]==s[j-1]:
count = count+1
else:
if count>1:
total = total+(count*(count-1))//2
count=1
if count>1:
total = total+(count*(count-1))... | n=int(eval(input()))
s=[None]*n
for i in range(n):
s[i]="".join(sorted(eval(input())))
import collections
c=collections.Counter(s)
ans=0
for v in list(c.values()):
ans+=(v*(v-1))//2
print(ans) | 21 | 10 | 327 | 187 | n = int(eval(input()))
s = [None] * n
for i in range(n):
s[i] = "".join(sorted(eval(input())))
s = sorted(s)
total = 0
count = 1
for j in range(1, n):
if s[j] == s[j - 1]:
count = count + 1
else:
if count > 1:
total = total + (count * (count - 1)) // 2
count = 1
if count ... | n = int(eval(input()))
s = [None] * n
for i in range(n):
s[i] = "".join(sorted(eval(input())))
import collections
c = collections.Counter(s)
ans = 0
for v in list(c.values()):
ans += (v * (v - 1)) // 2
print(ans)
| false | 52.380952 | [
"-s = sorted(s)",
"-total = 0",
"-count = 1",
"-for j in range(1, n):",
"- if s[j] == s[j - 1]:",
"- count = count + 1",
"- else:",
"- if count > 1:",
"- total = total + (count * (count - 1)) // 2",
"- count = 1",
"-if count > 1:",
"- total = total + (c... | false | 0.03279 | 0.036574 | 0.896561 | [
"s979621907",
"s673022054"
] |
u191874006 | p03504 | python | s645510581 | s995012618 | 669 | 443 | 138,632 | 67,420 | Accepted | Accepted | 33.78 | #!/usr/bin/env python3
#ABC80 D
import sys
import math
import bisect
sys.setrecursionlimit(1000000000)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import item... | #!/usr/bin/env python3
#ABC80 D
import sys
import math
import bisect
sys.setrecursionlimit(1000000000)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import item... | 56 | 44 | 1,341 | 1,088 | #!/usr/bin/env python3
# ABC80 D
import sys
import math
import bisect
sys.setrecursionlimit(1000000000)
from heapq import heappush, heappop, heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
fro... | #!/usr/bin/env python3
# ABC80 D
import sys
import math
import bisect
sys.setrecursionlimit(1000000000)
from heapq import heappush, heappop, heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
fro... | false | 21.428571 | [
"-stc = [LI() for _ in range(n)]",
"-L = []",
"+cha = [[] for _ in range(C)]",
"+ans = 0",
"+lst = [0] * (10**5 + 2)",
"+for _ in range(n):",
"+ s, t, c = LI()",
"+ cha[c - 1].append([s, t])",
"- lst = []",
"- for j in range(n):",
"- s, t, c = stc[j]",
"- if i + 1 == ... | false | 0.195129 | 0.145403 | 1.341988 | [
"s645510581",
"s995012618"
] |
u312025627 | p02900 | python | s163103159 | s098358732 | 388 | 80 | 40,556 | 67,556 | Accepted | Accepted | 79.38 | def main():
A, B = (int(i) for i in input().split())
def trial_division(n):
divs = []
for i in range(1, int(n**0.5)+1):
if n % i == 0:
divs.append(i)
if i != n//i:
divs.append(n//i)
return set(divs)
dA = tria... | def main():
N, M = (int(i) for i in input().split())
def enum_divisors(n):
# 約数列挙
divs = set()
for i in range(1, n+1):
if i*i > n:
break
if n % i == 0:
divs.add(i)
if n//i != i:
# i が... | 25 | 31 | 638 | 684 | def main():
A, B = (int(i) for i in input().split())
def trial_division(n):
divs = []
for i in range(1, int(n**0.5) + 1):
if n % i == 0:
divs.append(i)
if i != n // i:
divs.append(n // i)
return set(divs)
dA = trial_di... | def main():
N, M = (int(i) for i in input().split())
def enum_divisors(n):
# 約数列挙
divs = set()
for i in range(1, n + 1):
if i * i > n:
break
if n % i == 0:
divs.add(i)
if n // i != i:
# i が平方数でない... | false | 19.354839 | [
"- A, B = (int(i) for i in input().split())",
"+ N, M = (int(i) for i in input().split())",
"- def trial_division(n):",
"- divs = []",
"- for i in range(1, int(n**0.5) + 1):",
"+ def enum_divisors(n):",
"+ # 約数列挙",
"+ divs = set()",
"+ for i in range(1,... | false | 0.03895 | 0.038395 | 1.014465 | [
"s163103159",
"s098358732"
] |
u192154323 | p03329 | python | s764451181 | s320262104 | 216 | 103 | 46,032 | 74,828 | Accepted | Accepted | 52.31 | import math
n = int(eval(input()))
target_ls = [1]
target_6 = 6
while target_6 <= n:
target_ls.append(target_6)
target_6 *= 6
target_9 = 9
while target_9 <= n:
target_ls.append(target_9)
target_9 *= 9
dp = [float('inf')] * (n+1)
dp[0] = 0
for i in range(n):
for j in target_ls:
... | n = int(eval(input()))
min_time = [float('inf')] * (n+1)
min_time[0] = 0
for i in range(n):
min_time[i+1] = min(min_time[i+1],min_time[i]+1)
times_6 = 1
while i+6**times_6<=n:
min_time[i+6**times_6] = min(min_time[i+6**times_6],min_time[i]+1)
times_6 += 1
times_9 = 1
while ... | 21 | 18 | 397 | 458 | import math
n = int(eval(input()))
target_ls = [1]
target_6 = 6
while target_6 <= n:
target_ls.append(target_6)
target_6 *= 6
target_9 = 9
while target_9 <= n:
target_ls.append(target_9)
target_9 *= 9
dp = [float("inf")] * (n + 1)
dp[0] = 0
for i in range(n):
for j in target_ls:
if i + j <=... | n = int(eval(input()))
min_time = [float("inf")] * (n + 1)
min_time[0] = 0
for i in range(n):
min_time[i + 1] = min(min_time[i + 1], min_time[i] + 1)
times_6 = 1
while i + 6**times_6 <= n:
min_time[i + 6**times_6] = min(min_time[i + 6**times_6], min_time[i] + 1)
times_6 += 1
times_9 = 1
... | false | 14.285714 | [
"-import math",
"-",
"-target_ls = [1]",
"-target_6 = 6",
"-while target_6 <= n:",
"- target_ls.append(target_6)",
"- target_6 *= 6",
"-target_9 = 9",
"-while target_9 <= n:",
"- target_ls.append(target_9)",
"- target_9 *= 9",
"-dp = [float(\"inf\")] * (n + 1)",
"-dp[0] = 0",
"... | false | 0.098318 | 0.211441 | 0.464989 | [
"s764451181",
"s320262104"
] |
u058433718 | p02392 | python | s904566845 | s043296013 | 30 | 20 | 7,616 | 5,600 | Accepted | Accepted | 33.33 | import sys
data = sys.stdin.readline().strip()
a, b, c = data.split(' ')
a = int(a)
b = int(b)
c = int(c)
if a < b and b < c:
print('Yes')
else:
print('No') | data = eval(input())
a, b, c = [int(i) for i in data.split()]
if a < b < c:
print('Yes')
else:
print('No') | 12 | 7 | 177 | 115 | import sys
data = sys.stdin.readline().strip()
a, b, c = data.split(" ")
a = int(a)
b = int(b)
c = int(c)
if a < b and b < c:
print("Yes")
else:
print("No")
| data = eval(input())
a, b, c = [int(i) for i in data.split()]
if a < b < c:
print("Yes")
else:
print("No")
| false | 41.666667 | [
"-import sys",
"-",
"-data = sys.stdin.readline().strip()",
"-a, b, c = data.split(\" \")",
"-a = int(a)",
"-b = int(b)",
"-c = int(c)",
"-if a < b and b < c:",
"+data = eval(input())",
"+a, b, c = [int(i) for i in data.split()]",
"+if a < b < c:"
] | false | 0.057317 | 0.04333 | 1.322822 | [
"s904566845",
"s043296013"
] |
u079022693 | p02693 | python | s492824866 | s925617491 | 22 | 20 | 9,140 | 9,132 | Accepted | Accepted | 9.09 | from sys import stdin
def main():
#入力
readline=stdin.readline
K=int(readline())
A,B=list(map(int,readline().split()))
if A%K==0:
print("OK")
elif A//K<B//K:
print("OK")
else:
print("NG")
if __name__=="__main__":
main() | k=int(input())
a,b=map(int,input().split())
print("OK") if a<=b//k*k else print("NG")
| 14 | 3 | 281 | 87 | from sys import stdin
def main():
# 入力
readline = stdin.readline
K = int(readline())
A, B = list(map(int, readline().split()))
if A % K == 0:
print("OK")
elif A // K < B // K:
print("OK")
else:
print("NG")
if __name__ == "__main__":
main()
| k = int(input())
a, b = map(int, input().split())
print("OK") if a <= b // k * k else print("NG")
| false | 78.571429 | [
"-from sys import stdin",
"-",
"-",
"-def main():",
"- # 入力",
"- readline = stdin.readline",
"- K = int(readline())",
"- A, B = list(map(int, readline().split()))",
"- if A % K == 0:",
"- print(\"OK\")",
"- elif A // K < B // K:",
"- print(\"OK\")",
"- else... | false | 0.041389 | 0.046903 | 0.882449 | [
"s492824866",
"s925617491"
] |
u189479417 | p03680 | python | s707940117 | s899245492 | 225 | 159 | 13,216 | 12,996 | Accepted | Accepted | 29.33 | N = int(eval(input()))
A = [0]
for _ in range(N):
A.append(int(eval(input())))
S = set()
i = 1
cnt = 0
while i != 2 and not i in S:
S.add(i)
i = A[i]
cnt += 1
if i == 2:
print(cnt)
else:
print((-1)) | import sys
N = int(eval(input()))
A = [int(eval(input())) for _ in range(N)]
x = 0
cnt = 0
for _ in range(N):
x = A[x] - 1
cnt += 1
if x == 1:
print(cnt)
sys.exit()
print((-1)) | 15 | 12 | 222 | 201 | N = int(eval(input()))
A = [0]
for _ in range(N):
A.append(int(eval(input())))
S = set()
i = 1
cnt = 0
while i != 2 and not i in S:
S.add(i)
i = A[i]
cnt += 1
if i == 2:
print(cnt)
else:
print((-1))
| import sys
N = int(eval(input()))
A = [int(eval(input())) for _ in range(N)]
x = 0
cnt = 0
for _ in range(N):
x = A[x] - 1
cnt += 1
if x == 1:
print(cnt)
sys.exit()
print((-1))
| false | 20 | [
"+import sys",
"+",
"-A = [0]",
"+A = [int(eval(input())) for _ in range(N)]",
"+x = 0",
"+cnt = 0",
"- A.append(int(eval(input())))",
"-S = set()",
"-i = 1",
"-cnt = 0",
"-while i != 2 and not i in S:",
"- S.add(i)",
"- i = A[i]",
"+ x = A[x] - 1",
"-if i == 2:",
"- pri... | false | 0.035514 | 0.053911 | 0.658754 | [
"s707940117",
"s899245492"
] |
u198440493 | p03128 | python | s236677705 | s856220290 | 154 | 39 | 14,516 | 14,452 | Accepted | Accepted | 74.68 | INF = float('inf')
n, m = list(map(int, input().split()))
a = list(map(int, input().split()))
cost = [2, 5, 5, 4, 5, 6, 3, 7, 6]
l = [[x, cost[x-1]] for x in a]
l = sorted(l, key = lambda x: x[1]*10-x[0])
r = l[0]
_max = [0] + [-INF]*n
for i in range(1, n+1):
for x in l:
ind = i-x[1]
if ind >= 0:
... | INF = float('inf')
n, m = list(map(int, input().split()))
a = list(map(int, input().split()))
cost = [2, 5, 5, 4, 5, 6, 3, 7, 6]
l = [[x, cost[x-1]] for x in a]
l = sorted(l, key = lambda x: x[1]*10-x[0])
r = l[0]
_max = [0] + [-INF]*n
for i in range(1, n+1):
if 42 < i < n-42:
_max[i] = max(_max[i], _ma... | 15 | 18 | 395 | 485 | INF = float("inf")
n, m = list(map(int, input().split()))
a = list(map(int, input().split()))
cost = [2, 5, 5, 4, 5, 6, 3, 7, 6]
l = [[x, cost[x - 1]] for x in a]
l = sorted(l, key=lambda x: x[1] * 10 - x[0])
r = l[0]
_max = [0] + [-INF] * n
for i in range(1, n + 1):
for x in l:
ind = i - x[1]
if in... | INF = float("inf")
n, m = list(map(int, input().split()))
a = list(map(int, input().split()))
cost = [2, 5, 5, 4, 5, 6, 3, 7, 6]
l = [[x, cost[x - 1]] for x in a]
l = sorted(l, key=lambda x: x[1] * 10 - x[0])
r = l[0]
_max = [0] + [-INF] * n
for i in range(1, n + 1):
if 42 < i < n - 42:
_max[i] = max(_max[i... | false | 16.666667 | [
"- for x in l:",
"- ind = i - x[1]",
"- if ind >= 0:",
"- _max[i] = max(_max[i], _max[ind] * 10 + x[0])",
"+ if 42 < i < n - 42:",
"+ _max[i] = max(_max[i], _max[i - r[1]] * 10 + r[0])",
"+ else:",
"+ for x in l:",
"+ ind = i - x[1]",
"+ ... | false | 0.039087 | 0.039492 | 0.989747 | [
"s236677705",
"s856220290"
] |
u223133214 | p02725 | python | s354085702 | s492396176 | 282 | 257 | 78,668 | 86,140 | Accepted | Accepted | 8.87 | k, n = list(map(int, input().split()))
A = list(map(int, input().split()))
big = 0
for i in range(n - 1):
big = max(big, abs(A[i + 1] - A[i]))
b = (k - A[-1]) + A[0]
big = max(big, b)
print((k - big))
| k, n = list(map(int, input().split()))
A = list(map(int, input().split()))
kyori = []
for i in range(n - 1):
kyori.append(abs(A[i] - A[i + 1]))
kyori.append(A[0] + (k-A[-1]))
ans = k - max(kyori)
print(ans) | 12 | 11 | 212 | 217 | k, n = list(map(int, input().split()))
A = list(map(int, input().split()))
big = 0
for i in range(n - 1):
big = max(big, abs(A[i + 1] - A[i]))
b = (k - A[-1]) + A[0]
big = max(big, b)
print((k - big))
| k, n = list(map(int, input().split()))
A = list(map(int, input().split()))
kyori = []
for i in range(n - 1):
kyori.append(abs(A[i] - A[i + 1]))
kyori.append(A[0] + (k - A[-1]))
ans = k - max(kyori)
print(ans)
| false | 8.333333 | [
"-big = 0",
"+kyori = []",
"- big = max(big, abs(A[i + 1] - A[i]))",
"-b = (k - A[-1]) + A[0]",
"-big = max(big, b)",
"-print((k - big))",
"+ kyori.append(abs(A[i] - A[i + 1]))",
"+kyori.append(A[0] + (k - A[-1]))",
"+ans = k - max(kyori)",
"+print(ans)"
] | false | 0.043525 | 0.105829 | 0.411278 | [
"s354085702",
"s492396176"
] |
u957843607 | p02837 | python | s580859994 | s119588864 | 1,549 | 716 | 3,064 | 8,976 | Accepted | Accepted | 53.78 | N = int(eval(input()))
a = [[] for _ in range(N)]
for i in range(N):
A_i = int(eval(input()))
for j in range(A_i):
a[i].append(list(map(int, input().split())))
max_honest = 0
for i in range(2**N):
contradiction = False
honest_p = []
unkind_p = []
doubt_honest_p = []
doubt_unkind_p = []
... | N = int(eval(input()))
a = [[] for _ in range(N)]
for i in range(N):
A_i = int(eval(input()))
for j in range(A_i):
a[i].append(list(map(int, input().split())))
max_person = 0
for i in range(2**N):
judge = True
bin_num = bin(i)
times = 0
end = False
for j in reversed(bin_num):
if j =... | 42 | 25 | 1,133 | 576 | N = int(eval(input()))
a = [[] for _ in range(N)]
for i in range(N):
A_i = int(eval(input()))
for j in range(A_i):
a[i].append(list(map(int, input().split())))
max_honest = 0
for i in range(2**N):
contradiction = False
honest_p = []
unkind_p = []
doubt_honest_p = []
doubt_unkind_p = ... | N = int(eval(input()))
a = [[] for _ in range(N)]
for i in range(N):
A_i = int(eval(input()))
for j in range(A_i):
a[i].append(list(map(int, input().split())))
max_person = 0
for i in range(2**N):
judge = True
bin_num = bin(i)
times = 0
end = False
for j in reversed(bin_num):
... | false | 40.47619 | [
"-max_honest = 0",
"+max_person = 0",
"- contradiction = False",
"- honest_p = []",
"- unkind_p = []",
"- doubt_honest_p = []",
"- doubt_unkind_p = []",
"- length = len(format(2**N - 1, \"b\"))",
"- bin_num = format(i, \"b\").zfill(length)",
"- for j in range(length):",
"... | false | 0.008253 | 0.041539 | 0.198672 | [
"s580859994",
"s119588864"
] |
u761529120 | p02845 | python | s446425036 | s379027099 | 216 | 94 | 52,696 | 84,760 | Accepted | Accepted | 56.48 | def main():
MOD = 10 ** 9 + 7
N = int(eval(input()))
A = list(map(int, input().split()))
ans = 1
d = [0] * (max(A) + 1)
for a in A:
if a == 0:
ans *= 3 - d[a]
ans %= MOD
d[a] += 1
else:
ans *= d[a-1] - d[a]
... | def main():
N = int(eval(input()))
A = list(map(int, input().split()))
MOD = 10 ** 9 + 7
ans = 1
cnt = [0] * (N + 1)
for i in range(N):
if A[i] == 0:
ans *= 3 - cnt[A[i]]
cnt[A[i]] += 1
else:
ans *= cnt[A[i]-1] - cnt[A[i]]
... | 22 | 23 | 411 | 423 | def main():
MOD = 10**9 + 7
N = int(eval(input()))
A = list(map(int, input().split()))
ans = 1
d = [0] * (max(A) + 1)
for a in A:
if a == 0:
ans *= 3 - d[a]
ans %= MOD
d[a] += 1
else:
ans *= d[a - 1] - d[a]
d[a] += 1
... | def main():
N = int(eval(input()))
A = list(map(int, input().split()))
MOD = 10**9 + 7
ans = 1
cnt = [0] * (N + 1)
for i in range(N):
if A[i] == 0:
ans *= 3 - cnt[A[i]]
cnt[A[i]] += 1
else:
ans *= cnt[A[i] - 1] - cnt[A[i]]
cnt[A[i]]... | false | 4.347826 | [
"- MOD = 10**9 + 7",
"+ MOD = 10**9 + 7",
"- d = [0] * (max(A) + 1)",
"- for a in A:",
"- if a == 0:",
"- ans *= 3 - d[a]",
"- ans %= MOD",
"- d[a] += 1",
"+ cnt = [0] * (N + 1)",
"+ for i in range(N):",
"+ if A[i] == 0:",
"+ ... | false | 0.043219 | 0.082884 | 0.52144 | [
"s446425036",
"s379027099"
] |
u197955752 | p02744 | python | s199345990 | s122761268 | 191 | 174 | 22,772 | 19,188 | Accepted | Accepted | 8.9 | from collections import deque
N = int(eval(input()))
alphabet = "abcdefghij"
visited = 1
st = deque([["a", visited]])
while len(st) > 0:
str, visited = st.popleft()
if len(str) == N:
print(str)
else:
# すでに使った文字を使う
for x in alphabet[0 : visited]:
st.appen... | from collections import deque
N = int(eval(input()))
alphabet = "abcdefghij"
visited = 1
st = deque([("a", visited)])
while len(st) > 0:
str, visited = st.popleft()
if len(str) == N:
print(str)
else:
# すでに使った文字を使う
for x in alphabet[0 : visited]:
st.appen... | 19 | 19 | 459 | 458 | from collections import deque
N = int(eval(input()))
alphabet = "abcdefghij"
visited = 1
st = deque([["a", visited]])
while len(st) > 0:
str, visited = st.popleft()
if len(str) == N:
print(str)
else:
# すでに使った文字を使う
for x in alphabet[0:visited]:
st.append([str + x, visited... | from collections import deque
N = int(eval(input()))
alphabet = "abcdefghij"
visited = 1
st = deque([("a", visited)])
while len(st) > 0:
str, visited = st.popleft()
if len(str) == N:
print(str)
else:
# すでに使った文字を使う
for x in alphabet[0:visited]:
st.append((str + x, visited... | false | 0 | [
"-st = deque([[\"a\", visited]])",
"+st = deque([(\"a\", visited)])",
"- st.append([str + x, visited])",
"+ st.append((str + x, visited))",
"- st.append([str + alphabet[visited], visited + 1])",
"+ st.append((str + alphabet[visited], visited + 1))"
] | false | 0.044733 | 0.042734 | 1.046761 | [
"s199345990",
"s122761268"
] |
u906501980 | p02901 | python | s003161438 | s391778468 | 1,404 | 1,288 | 3,300 | 3,188 | Accepted | Accepted | 8.26 | n, m = list(map(int, input().split()))
ac = []
for _ in range(m):
a, _ = list(map(int, input().split()))
c = sum([2**(int(i)-1) for i in input().split()])
ac.append([a, c])
dp = [float('inf')] * 2**n
dp[0] = 0
for s in range(2**n):
for a, c in ac:
t = s|c
if dp[t] > dp[s] + a:... | n, m = list(map(int, input().split()))
dp = [float('inf')] * 2**n
dp[0] = 0
for _ in range(m):
a, _ = list(map(int, input().split()))
c = sum([2**(int(i)-1) for i in input().split()])
for s in range(2**n):
t = s|c
if dp[t] > dp[s] + a:
dp[t] = dp[s] + a
ans ... | 17 | 14 | 404 | 367 | n, m = list(map(int, input().split()))
ac = []
for _ in range(m):
a, _ = list(map(int, input().split()))
c = sum([2 ** (int(i) - 1) for i in input().split()])
ac.append([a, c])
dp = [float("inf")] * 2**n
dp[0] = 0
for s in range(2**n):
for a, c in ac:
t = s | c
if dp[t] > dp[s] + a:
... | n, m = list(map(int, input().split()))
dp = [float("inf")] * 2**n
dp[0] = 0
for _ in range(m):
a, _ = list(map(int, input().split()))
c = sum([2 ** (int(i) - 1) for i in input().split()])
for s in range(2**n):
t = s | c
if dp[t] > dp[s] + a:
dp[t] = dp[s] + a
ans = dp[-1]
if ans ... | false | 17.647059 | [
"-ac = []",
"+dp = [float(\"inf\")] * 2**n",
"+dp[0] = 0",
"- ac.append([a, c])",
"-dp = [float(\"inf\")] * 2**n",
"-dp[0] = 0",
"-for s in range(2**n):",
"- for a, c in ac:",
"+ for s in range(2**n):"
] | false | 0.040894 | 0.123025 | 0.332406 | [
"s003161438",
"s391778468"
] |
u562935282 | p02716 | python | s567606893 | s085207986 | 670 | 501 | 144,528 | 201,596 | Accepted | Accepted | 25.22 | def main():
from collections import defaultdict
inf = 10 ** 15
N = int(eval(input()))
*a, = list(map(int, input().split()))
it = iter(a)
dp = [defaultdict(lambda: -inf) for _ in range(N + 1)]
dp[0][0] = 0
dp[1][0] = 0
dp[1][1] = next(it)
for i, x in enumerate(it... | def main():
from functools import lru_cache
import sys
sys.setrecursionlimit(10 ** 7)
inf = 2 * 10 ** 14 + 1
N = int(eval(input()))
*a, = list(map(int, input().split()))
@lru_cache(maxsize=None)
def recursion(cur, need):
"""
cur: pickableなindex
... | 30 | 38 | 647 | 742 | def main():
from collections import defaultdict
inf = 10**15
N = int(eval(input()))
(*a,) = list(map(int, input().split()))
it = iter(a)
dp = [defaultdict(lambda: -inf) for _ in range(N + 1)]
dp[0][0] = 0
dp[1][0] = 0
dp[1][1] = next(it)
for i, x in enumerate(it, 2):
mi ... | def main():
from functools import lru_cache
import sys
sys.setrecursionlimit(10**7)
inf = 2 * 10**14 + 1
N = int(eval(input()))
(*a,) = list(map(int, input().split()))
@lru_cache(maxsize=None)
def recursion(cur, need):
"""
cur: pickableなindex
"""
if cur ... | false | 21.052632 | [
"- from collections import defaultdict",
"+ from functools import lru_cache",
"+ import sys",
"- inf = 10**15",
"+ sys.setrecursionlimit(10**7)",
"+ inf = 2 * 10**14 + 1",
"- it = iter(a)",
"- dp = [defaultdict(lambda: -inf) for _ in range(N + 1)]",
"- dp[0][0] = 0",
"- ... | false | 0.048357 | 0.039481 | 1.224807 | [
"s567606893",
"s085207986"
] |
u633068244 | p00174 | python | s868599118 | s953819373 | 20 | 10 | 4,196 | 4,196 | Accepted | Accepted | 50 | import sys
while True:
for i in range(3):
game = input()
if game == "0":sys.exit()
game = game[1:]+game[-1]
print(game.count("A"),game.count("B")) | import sys
while 1:
for i in range(3):
g=input()
if g=="0":sys.exit()
g=g[1:]+g[-1]
print(g.count("A"),g.count("B")) | 7 | 7 | 164 | 134 | import sys
while True:
for i in range(3):
game = input()
if game == "0":
sys.exit()
game = game[1:] + game[-1]
print(game.count("A"), game.count("B"))
| import sys
while 1:
for i in range(3):
g = input()
if g == "0":
sys.exit()
g = g[1:] + g[-1]
print(g.count("A"), g.count("B"))
| false | 0 | [
"-while True:",
"+while 1:",
"- game = input()",
"- if game == \"0\":",
"+ g = input()",
"+ if g == \"0\":",
"- game = game[1:] + game[-1]",
"- print(game.count(\"A\"), game.count(\"B\"))",
"+ g = g[1:] + g[-1]",
"+ print(g.count(\"A\"), g.co... | false | 0.040723 | 0.069101 | 0.589325 | [
"s868599118",
"s953819373"
] |
u476604182 | p03550 | python | s066431331 | s958447935 | 188 | 18 | 39,408 | 3,188 | Accepted | Accepted | 90.43 | N, Z, W = list(map(int, input().split()))
a = [int(i) for i in input().split()]
if N==1:
print((abs(a[0]-W)))
else:
print((max(abs(a[-1]-W), abs(a[-1]-a[-2])))) | N, Z, W, *A = list(map(int, open(0).read().split()))
if N==1:
print((abs(A[0]-W)))
else:
print((max(abs(A[-1]-A[-2]),abs(A[-1]-W)))) | 6 | 5 | 160 | 130 | N, Z, W = list(map(int, input().split()))
a = [int(i) for i in input().split()]
if N == 1:
print((abs(a[0] - W)))
else:
print((max(abs(a[-1] - W), abs(a[-1] - a[-2]))))
| N, Z, W, *A = list(map(int, open(0).read().split()))
if N == 1:
print((abs(A[0] - W)))
else:
print((max(abs(A[-1] - A[-2]), abs(A[-1] - W))))
| false | 16.666667 | [
"-N, Z, W = list(map(int, input().split()))",
"-a = [int(i) for i in input().split()]",
"+N, Z, W, *A = list(map(int, open(0).read().split()))",
"- print((abs(a[0] - W)))",
"+ print((abs(A[0] - W)))",
"- print((max(abs(a[-1] - W), abs(a[-1] - a[-2]))))",
"+ print((max(abs(A[-1] - A[-2]), abs... | false | 0.047308 | 0.047708 | 0.991617 | [
"s066431331",
"s958447935"
] |
u932465688 | p03724 | python | s097847733 | s168617519 | 454 | 340 | 28,132 | 3,828 | Accepted | Accepted | 25.11 | N,M = list(map(int,input().split()))
L = []
for i in range(M):
L.append(list(map(int,input().split())))
K = [0]*(10**5)
for i in range(M):
for j in range(2):
K[L[i][j]-1] += 1
flag = True
for i in range(10**5):
if K[i]%2 != 0:
flag = False
break
if flag:
print('YES')
else:
print('N... | N,M = list(map(int,input().split()))
K = [0]*(10**5)
for i in range(M):
P,Q = list(map(int,input().split()))
K[P-1] += 1
K[Q-1] += 1
flag = True
for i in range(10**5):
if K[i]%2 != 0:
flag = False
break
if flag:
print('YES')
else:
print('NO') | 17 | 15 | 317 | 264 | N, M = list(map(int, input().split()))
L = []
for i in range(M):
L.append(list(map(int, input().split())))
K = [0] * (10**5)
for i in range(M):
for j in range(2):
K[L[i][j] - 1] += 1
flag = True
for i in range(10**5):
if K[i] % 2 != 0:
flag = False
break
if flag:
print("YES")
els... | N, M = list(map(int, input().split()))
K = [0] * (10**5)
for i in range(M):
P, Q = list(map(int, input().split()))
K[P - 1] += 1
K[Q - 1] += 1
flag = True
for i in range(10**5):
if K[i] % 2 != 0:
flag = False
break
if flag:
print("YES")
else:
print("NO")
| false | 11.764706 | [
"-L = []",
"-for i in range(M):",
"- L.append(list(map(int, input().split())))",
"- for j in range(2):",
"- K[L[i][j] - 1] += 1",
"+ P, Q = list(map(int, input().split()))",
"+ K[P - 1] += 1",
"+ K[Q - 1] += 1"
] | false | 0.093775 | 0.008054 | 11.642977 | [
"s097847733",
"s168617519"
] |
u133936772 | p02574 | python | s209102315 | s833363870 | 661 | 350 | 121,456 | 189,160 | Accepted | Accepted | 47.05 | M=10**6+1
f=lambda p: exit(print(['pairwise','setwise','not'][p]+' coprime'))
n,*l=map(int,open(0).read().split())
from math import *
g,C=0,[0]*M
for x in l:
g=gcd(g,x)
C[x]=1
if g>1: f(2)
if any(sum(C[i::i])>1 for i in range(2,M)): f(1)
f(0)
| M=10**6+1
f=lambda p: exit(print(['pairwise','setwise','not'][p]+' coprime'))
n=int(input())
l=[*map(int,input().split())]
g=0
from math import *
for x in l:
g=gcd(g,x)
if g>1: f(2)
def sieve(x):
p=[]
s=[0]*x
for i in range(2,x):
if s[i]<1:
p+=[i]
for j in range(i,x,i): s[j]=i
... | 11 | 28 | 256 | 470 | M = 10**6 + 1
f = lambda p: exit(print(["pairwise", "setwise", "not"][p] + " coprime"))
n, *l = map(int, open(0).read().split())
from math import *
g, C = 0, [0] * M
for x in l:
g = gcd(g, x)
C[x] = 1
if g > 1:
f(2)
if any(sum(C[i::i]) > 1 for i in range(2, M)):
f(1)
f(0)
| M = 10**6 + 1
f = lambda p: exit(print(["pairwise", "setwise", "not"][p] + " coprime"))
n = int(input())
l = [*map(int, input().split())]
g = 0
from math import *
for x in l:
g = gcd(g, x)
if g > 1:
f(2)
def sieve(x):
p = []
s = [0] * x
for i in range(2, x):
if s[i] < 1:
p += ... | false | 60.714286 | [
"-n, *l = map(int, open(0).read().split())",
"+n = int(input())",
"+l = [*map(int, input().split())]",
"+g = 0",
"-g, C = 0, [0] * M",
"- C[x] = 1",
"-if any(sum(C[i::i]) > 1 for i in range(2, M)):",
"- f(1)",
"+",
"+",
"+def sieve(x):",
"+ p = []",
"+ s = [0] * x",
"+ for i... | false | 1.283329 | 0.931198 | 1.378148 | [
"s209102315",
"s833363870"
] |
u959421160 | p03073 | python | s165618124 | s592149998 | 79 | 67 | 3,188 | 3,188 | Accepted | Accepted | 15.19 | inpl = eval(input())
c1 = 0
c2 = 0
for i in range(1,len(inpl)+1):
if i % 2 != 0:
if inpl[i-1] == '0':
c1 += 1
else:
if inpl[i-1] == '1':
c1 += 1
for i in range(1,len(inpl)+1):
if i % 2 != 1:
if inpl[i-1] == '0':
c2 += 1
else:
... | inpl = eval(input())
c1 = 0
c2 = 0
for i,s in enumerate(inpl):
if i % 2 != 0:
if s == '0':
c1 += 1
else:
if s == '1':
c1 += 1
for i,s in enumerate(inpl):
if i % 2 != 1:
if s == '0':
c2 += 1
else:
if s == '1':
... | 20 | 20 | 394 | 356 | inpl = eval(input())
c1 = 0
c2 = 0
for i in range(1, len(inpl) + 1):
if i % 2 != 0:
if inpl[i - 1] == "0":
c1 += 1
else:
if inpl[i - 1] == "1":
c1 += 1
for i in range(1, len(inpl) + 1):
if i % 2 != 1:
if inpl[i - 1] == "0":
c2 += 1
else:
... | inpl = eval(input())
c1 = 0
c2 = 0
for i, s in enumerate(inpl):
if i % 2 != 0:
if s == "0":
c1 += 1
else:
if s == "1":
c1 += 1
for i, s in enumerate(inpl):
if i % 2 != 1:
if s == "0":
c2 += 1
else:
if s == "1":
c2 += 1
print... | false | 0 | [
"-for i in range(1, len(inpl) + 1):",
"+for i, s in enumerate(inpl):",
"- if inpl[i - 1] == \"0\":",
"+ if s == \"0\":",
"- if inpl[i - 1] == \"1\":",
"+ if s == \"1\":",
"-for i in range(1, len(inpl) + 1):",
"+for i, s in enumerate(inpl):",
"- if inpl[i - 1] == \"... | false | 0.038548 | 0.087357 | 0.441271 | [
"s165618124",
"s592149998"
] |
u647766105 | p01646 | python | s798047124 | s214339927 | 80 | 70 | 4,344 | 4,340 | Accepted | Accepted | 12.5 | graph = []
def init():
global graph
graph = [[False] * 26 + [True] for _ in range(27)]
graph[26][26] = False
def atoi(c):#index
if c == "#":
return 26
return ord(c) - ord("a")
def make_graph(L):
global graph, count
cur = 0
L = [L[0]] + [L[i] for i in range(1, le... | graph = []
def init():
global graph
graph = [[False] * 26 + [True] for _ in range(27)]
graph[26][26] = False
def atoi(c):#index
if c == "#":
return 26
return ord(c) - ord("a")
def make_graph(L):
global graph
cur = 0
L = [L[0]] + [L[i] for i in range(1, len(L)) i... | 54 | 54 | 1,272 | 1,265 | graph = []
def init():
global graph
graph = [[False] * 26 + [True] for _ in range(27)]
graph[26][26] = False
def atoi(c): # index
if c == "#":
return 26
return ord(c) - ord("a")
def make_graph(L):
global graph, count
cur = 0
L = [L[0]] + [L[i] for i in range(1, len(L)) if ... | graph = []
def init():
global graph
graph = [[False] * 26 + [True] for _ in range(27)]
graph[26][26] = False
def atoi(c): # index
if c == "#":
return 26
return ord(c) - ord("a")
def make_graph(L):
global graph
cur = 0
L = [L[0]] + [L[i] for i in range(1, len(L)) if L[i] !=... | false | 0 | [
"- global graph, count",
"+ global graph"
] | false | 0.04158 | 0.047011 | 0.884475 | [
"s798047124",
"s214339927"
] |
u271934630 | p04030 | python | s080429109 | s172689425 | 168 | 24 | 38,384 | 3,436 | Accepted | Accepted | 85.71 | S = input()
ans = []
for s in S:
if s == 'B' and ans:
ans.pop()
elif s != 'B':
ans.append(s)
print(*ans, sep='')
| import sys
stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)
from collections import deque
i_i = lambda: int(i_s())
i_l = lambda: list(map(int, stdin.readline().split()))
i_s = lambda: stdin.readline().rstrip()
s = i_s()
d = deque()
for x in s:
if d and x == 'B':
d.pop()
elif x == '0' o... | 10 | 19 | 148 | 374 | S = input()
ans = []
for s in S:
if s == "B" and ans:
ans.pop()
elif s != "B":
ans.append(s)
print(*ans, sep="")
| import sys
stdin = sys.stdin
sys.setrecursionlimit(10**7)
from collections import deque
i_i = lambda: int(i_s())
i_l = lambda: list(map(int, stdin.readline().split()))
i_s = lambda: stdin.readline().rstrip()
s = i_s()
d = deque()
for x in s:
if d and x == "B":
d.pop()
elif x == "0" or x == "1":
... | false | 47.368421 | [
"-S = input()",
"-ans = []",
"-for s in S:",
"- if s == \"B\" and ans:",
"- ans.pop()",
"- elif s != \"B\":",
"- ans.append(s)",
"-print(*ans, sep=\"\")",
"+import sys",
"+",
"+stdin = sys.stdin",
"+sys.setrecursionlimit(10**7)",
"+from collections import deque",
"+",
... | false | 0.046564 | 0.046854 | 0.993817 | [
"s080429109",
"s172689425"
] |
u837673618 | p02709 | python | s862402215 | s475911594 | 1,560 | 1,139 | 9,984 | 9,948 | Accepted | Accepted | 26.99 | from collections import *
from itertools import *
N = int(eval(input()))
A = list(map(int, input().split()))
SA = SB = 0
ABI = sorted(((b:=max(N-i, i-1)*a, SA:=SA+a, SB:=SB+b) and (a, b, i) for i, a in enumerate(A, 1)), reverse=True)
prev = {0:0}
prev_max = 0
for k, (a, b, i) in enumerate(ABI):
curr = ... | from collections import *
from itertools import *
N = int(eval(input()))
A = list(map(int, input().split()))
SA = SB = 0
ABI = sorted(((b:=max(N-i, i-1)*a, SA:=SA+a, SB:=SB+b) and (a, b, i) for i, a in enumerate(A, 1)), reverse=True)
prev = {0:0}
prev_max = 0
for k, (a, b, i) in enumerate(ABI):
curr = ... | 27 | 27 | 645 | 645 | from collections import *
from itertools import *
N = int(eval(input()))
A = list(map(int, input().split()))
SA = SB = 0
ABI = sorted(
(
(b := max(N - i, i - 1) * a, SA := SA + a, SB := SB + b) and (a, b, i)
for i, a in enumerate(A, 1)
),
reverse=True,
)
prev = {0: 0}
prev_max = 0
for k, (a... | from collections import *
from itertools import *
N = int(eval(input()))
A = list(map(int, input().split()))
SA = SB = 0
ABI = sorted(
(
(b := max(N - i, i - 1) * a, SA := SA + a, SB := SB + b) and (a, b, i)
for i, a in enumerate(A, 1)
),
reverse=True,
)
prev = {0: 0}
prev_max = 0
for k, (a... | false | 0 | [
"- if p + SB - min(l, r) * SA < prev_max:",
"+ if p + SB - max(l, r) * SA < prev_max:"
] | false | 0.281922 | 0.170879 | 1.649834 | [
"s862402215",
"s475911594"
] |
u558242240 | p03128 | python | s703541039 | s762412627 | 294 | 236 | 46,428 | 51,804 | Accepted | Accepted | 19.73 | #123456789
#255456376
n, m = list(map(int, input().split()))
a = list(map(int , input().split()))
a.sort()
t = [2,5,5,4,5,6,3,7,6]
cost = []
for i in range(m):
cost.append(t[a[i]-1])
#print(a)
#print(cost)
min_c = min(cost)
digit = n // min_c # 最大桁数
s = n % min_c # 最大桁まで作った余りの本数
max_ai = 0
import i... | n, m = list(map(int, input().split()))
a = list(map(int , input().split()))
t = [2,5,5,4,5,6,3,7,6]
cost = {ai: t[ai-1] for ai in a}
dp = [0] + [-1] * n
for i in range(n+1):
tmp = []
for ai, ci in list(cost.items()):
if i - ci >= 0 and dp[i-ci] >= 0:
tmp.append(dp[i-ci] * 10 + a... | 69 | 15 | 1,621 | 372 | # 123456789
# 255456376
n, m = list(map(int, input().split()))
a = list(map(int, input().split()))
a.sort()
t = [2, 5, 5, 4, 5, 6, 3, 7, 6]
cost = []
for i in range(m):
cost.append(t[a[i] - 1])
# print(a)
# print(cost)
min_c = min(cost)
digit = n // min_c # 最大桁数
s = n % min_c # 最大桁まで作った余りの本数
max_ai = 0
import ite... | n, m = list(map(int, input().split()))
a = list(map(int, input().split()))
t = [2, 5, 5, 4, 5, 6, 3, 7, 6]
cost = {ai: t[ai - 1] for ai in a}
dp = [0] + [-1] * n
for i in range(n + 1):
tmp = []
for ai, ci in list(cost.items()):
if i - ci >= 0 and dp[i - ci] >= 0:
tmp.append(dp[i - ci] * 10 +... | false | 78.26087 | [
"-# 123456789",
"-# 255456376",
"-a.sort()",
"-cost = []",
"-for i in range(m):",
"- cost.append(t[a[i] - 1])",
"-# print(a)",
"-# print(cost)",
"-min_c = min(cost)",
"-digit = n // min_c # 最大桁数",
"-s = n % min_c # 最大桁まで作った余りの本数",
"-max_ai = 0",
"-import itertools",
"-",
"-for i in ... | false | 0.105196 | 0.12415 | 0.847326 | [
"s703541039",
"s762412627"
] |
u071680334 | p02662 | python | s395345444 | s118115839 | 352 | 299 | 97,532 | 97,580 | Accepted | Accepted | 15.06 | import numpy as np
MOD = 998244353
def main():
n, s = list(map(int, input().split()))
a = list(map(int, input().split()))
dp = np.zeros((n+1, s+1), dtype=np.int64)
dp[0][0] = 1
for i in range(n):
dp[i][dp[i] >= MOD] %= MOD
dp[i+1] += dp[i]*2
if a[i] <= s:
... | import numpy as np
MOD = 998244353
def main():
n, s = list(map(int, input().split()))
a = list(map(int, input().split()))
dp = np.zeros((n+1, s+1), dtype=np.int64)
dp[0][0] = 1
for i, v in enumerate(a):
dp[i+1] += dp[i]*2
if v <= s:
dp[i+1][v:] += dp[i][:-v]... | 17 | 18 | 417 | 411 | import numpy as np
MOD = 998244353
def main():
n, s = list(map(int, input().split()))
a = list(map(int, input().split()))
dp = np.zeros((n + 1, s + 1), dtype=np.int64)
dp[0][0] = 1
for i in range(n):
dp[i][dp[i] >= MOD] %= MOD
dp[i + 1] += dp[i] * 2
if a[i] <= s:
... | import numpy as np
MOD = 998244353
def main():
n, s = list(map(int, input().split()))
a = list(map(int, input().split()))
dp = np.zeros((n + 1, s + 1), dtype=np.int64)
dp[0][0] = 1
for i, v in enumerate(a):
dp[i + 1] += dp[i] * 2
if v <= s:
dp[i + 1][v:] += dp[i][:-v]
... | false | 5.555556 | [
"- for i in range(n):",
"- dp[i][dp[i] >= MOD] %= MOD",
"+ for i, v in enumerate(a):",
"- if a[i] <= s:",
"- dp[i + 1][a[i] :] += dp[i][: -a[i]]",
"- print((dp[n][s] % MOD))",
"+ if v <= s:",
"+ dp[i + 1][v:] += dp[i][:-v]",
"+ dp[i + 1] %= ... | false | 0.334539 | 0.254556 | 1.314204 | [
"s395345444",
"s118115839"
] |
u281303342 | p03354 | python | s846107482 | s493169803 | 654 | 479 | 25,220 | 25,188 | Accepted | Accepted | 26.76 | N,M = list(map(int,input().split()))
P = list(map(int,input().split()))
XY = [tuple(map(int,input().split())) for _ in range(M)]
class UnionFind:
def __init__(self, n):
self.par = [i for i in range(n+1)]
self.rank = [0] * (n+1)
def find(self, x):
if self.par[x] == x:
... | # Python3 (3.4.3)
import sys
input = sys.stdin.readline
# -------------------------------------------------------------
# function
# -------------------------------------------------------------
class UnionFind:
def __init__(self, n):
self.par = [i for i in range(n+1)]
self.rank = [0]*(n+... | 38 | 48 | 972 | 1,332 | N, M = list(map(int, input().split()))
P = list(map(int, input().split()))
XY = [tuple(map(int, input().split())) for _ in range(M)]
class UnionFind:
def __init__(self, n):
self.par = [i for i in range(n + 1)]
self.rank = [0] * (n + 1)
def find(self, x):
if self.par[x] == x:
... | # Python3 (3.4.3)
import sys
input = sys.stdin.readline
# -------------------------------------------------------------
# function
# -------------------------------------------------------------
class UnionFind:
def __init__(self, n):
self.par = [i for i in range(n + 1)]
self.rank = [0] * (n + 1)
... | false | 20.833333 | [
"-N, M = list(map(int, input().split()))",
"-P = list(map(int, input().split()))",
"-XY = [tuple(map(int, input().split())) for _ in range(M)]",
"+# Python3 (3.4.3)",
"+import sys",
"-",
"+input = sys.stdin.readline",
"+# function",
"+# main",
"+N, M = list(map(int, input().split()))",
"+P = lis... | false | 0.046939 | 0.17633 | 0.266202 | [
"s846107482",
"s493169803"
] |
u405660020 | p02679 | python | s978830373 | s268373636 | 934 | 533 | 46,492 | 121,684 | Accepted | Accepted | 42.93 | import math
n=int(eval(input()))
D={}
for _ in range(n):
a,b=list(map(int, input().split()))
if a==0 and b==0:
key=(0,0)
elif a==0:
key=(0,1)
elif b==0:
key=(1,0)
else:
if a<0:
a=-a
b=-b
g=math.gcd(a, abs(b))
k... | import math
n=int(eval(input()))
D={}
for _ in range(n):
a,b=list(map(int, input().split()))
if a==0 and b==0:
key=(0,0)
elif a==0:
key=(0,1)
elif b==0:
key=(1,0)
else:
if a<0:
a=-a
b=-b
g=math.gcd(a, abs(b))
k... | 47 | 47 | 812 | 812 | import math
n = int(eval(input()))
D = {}
for _ in range(n):
a, b = list(map(int, input().split()))
if a == 0 and b == 0:
key = (0, 0)
elif a == 0:
key = (0, 1)
elif b == 0:
key = (1, 0)
else:
if a < 0:
a = -a
b = -b
g = math.gcd(a, ab... | import math
n = int(eval(input()))
D = {}
for _ in range(n):
a, b = list(map(int, input().split()))
if a == 0 and b == 0:
key = (0, 0)
elif a == 0:
key = (0, 1)
elif b == 0:
key = (1, 0)
else:
if a < 0:
a = -a
b = -b
g = math.gcd(a, ab... | false | 0 | [
"+ if v1 == 0:",
"+ continue",
"- continue",
"- if v1 == 0:"
] | false | 0.039617 | 0.038573 | 1.027051 | [
"s978830373",
"s268373636"
] |
u409306788 | p03578 | python | s609944595 | s292401785 | 293 | 257 | 41,816 | 41,316 | Accepted | Accepted | 12.29 | # B - Problem Set
def is_create(dic_d, t):
for ti in t:
if not ti in list(dic_d.keys()):
return False
elif dic[ti] == 0:
return False
else:
dic[ti] -= 1
return True
n = int(eval(input()))
d = list(map(int, input().split()))
m = int(eval(input()))
t = list(map(int, input().split()))... | # B - Problem Set
def is_create(dic_d, t):
for ti in t:
if not ti in list(dic_d.keys()):
return False
elif dic[ti] == 0:
return False
else:
dic[ti] -= 1
return True
n = int(eval(input()))
d = list(map(int, input().split()))
m = int(eval(input()))
t = list(map(int, input().split()))... | 30 | 32 | 457 | 502 | # B - Problem Set
def is_create(dic_d, t):
for ti in t:
if not ti in list(dic_d.keys()):
return False
elif dic[ti] == 0:
return False
else:
dic[ti] -= 1
return True
n = int(eval(input()))
d = list(map(int, input().split()))
m = int(eval(input()))
t =... | # B - Problem Set
def is_create(dic_d, t):
for ti in t:
if not ti in list(dic_d.keys()):
return False
elif dic[ti] == 0:
return False
else:
dic[ti] -= 1
return True
n = int(eval(input()))
d = list(map(int, input().split()))
m = int(eval(input()))
t =... | false | 6.25 | [
"- if di in list(dic.keys()):",
"- dic[di] += 1",
"- else:",
"- dic[di] = 1",
"+ dic.setdefault(di, 0)",
"+ dic[di] += 1",
"+ \"\"\"if di in dic.keys():",
"+\t\tdic[di] += 1",
"+\telse:",
"+\t\tdic[di] = 1\"\"\""
] | false | 0.036346 | 0.036247 | 1.002742 | [
"s609944595",
"s292401785"
] |
u182898140 | p02712 | python | s152105520 | s730336518 | 155 | 142 | 9,156 | 9,064 | Accepted | Accepted | 8.39 | N=int(eval(input()))
total=0
for i in range(N+1):
if i%3==0 or i%5==0:
continue
else:
total+=i
print(total) | N=int(eval(input()))
total=0
for i in range(1,N+1):
if i%3==0 or i%5==0:
pass
else:
total +=i
print(total) | 12 | 11 | 130 | 125 | N = int(eval(input()))
total = 0
for i in range(N + 1):
if i % 3 == 0 or i % 5 == 0:
continue
else:
total += i
print(total)
| N = int(eval(input()))
total = 0
for i in range(1, N + 1):
if i % 3 == 0 or i % 5 == 0:
pass
else:
total += i
print(total)
| false | 8.333333 | [
"-for i in range(N + 1):",
"+for i in range(1, N + 1):",
"- continue",
"+ pass"
] | false | 0.135035 | 0.276298 | 0.488728 | [
"s152105520",
"s730336518"
] |
u638795007 | p04034 | python | s275096290 | s581064931 | 322 | 227 | 52,188 | 5,492 | Accepted | Accepted | 29.5 | def examA():
a, b = LI()
if a>0:
ans = "Positive"
print(ans)
return
if b>=0:
ans = "Zero"
else:
judge = b-a
if judge%2==1:
ans = "Positive"
else:
ans = "Negative"
print(ans)
return
def examB():
... | def examA():
a, b = LI()
if b<a:
a,b = b,a
if a<=0 and 0<=b:
print("Zero")
elif 0<a:
print("Positive")
else:
judge = b-a+1
if judge%2==0:
print("Positive")
else:
print("Negative")
return
def examB():
N,... | 47 | 78 | 1,125 | 1,562 | def examA():
a, b = LI()
if a > 0:
ans = "Positive"
print(ans)
return
if b >= 0:
ans = "Zero"
else:
judge = b - a
if judge % 2 == 1:
ans = "Positive"
else:
ans = "Negative"
print(ans)
return
def examB():
N, M =... | def examA():
a, b = LI()
if b < a:
a, b = b, a
if a <= 0 and 0 <= b:
print("Zero")
elif 0 < a:
print("Positive")
else:
judge = b - a + 1
if judge % 2 == 0:
print("Positive")
else:
print("Negative")
return
def examB():
... | false | 39.74359 | [
"- if a > 0:",
"- ans = \"Positive\"",
"- print(ans)",
"- return",
"- if b >= 0:",
"- ans = \"Zero\"",
"+ if b < a:",
"+ a, b = b, a",
"+ if a <= 0 and 0 <= b:",
"+ print(\"Zero\")",
"+ elif 0 < a:",
"+ print(\"Positive\")",
"- ... | false | 0.056448 | 0.095258 | 0.592579 | [
"s275096290",
"s581064931"
] |
u888337853 | p03030 | python | s519019330 | s264327838 | 187 | 18 | 38,384 | 3,064 | Accepted | Accepted | 90.37 | import math
import copy
class Score:
def set_data(self, town, score, idx):
self.town = set_town
self.score = set_score
self.idx = set_idx
inputa = input().split()
# inputb = input().split()
a = int(inputa[0])
# b = int(inputa[1])
# c = int(inputa[2])
# x = int(inputb[0])
... | import sys
# import math
# import bisect
# import copy
# import heapq
# from collections import deque
# import decimal
# sys.setrecursionlimit(100001)
# INF = sys.maxsize
# MOD = 10 ** 9 + 7
ni = lambda: int(sys.stdin.readline())
ns = lambda: list(map(int, sys.stdin.readline().split()))
na = lambda:... | 40 | 38 | 854 | 703 | import math
import copy
class Score:
def set_data(self, town, score, idx):
self.town = set_town
self.score = set_score
self.idx = set_idx
inputa = input().split()
# inputb = input().split()
a = int(inputa[0])
# b = int(inputa[1])
# c = int(inputa[2])
# x = int(inputb[0])
# y = int(inputb... | import sys
# import math
# import bisect
# import copy
# import heapq
# from collections import deque
# import decimal
# sys.setrecursionlimit(100001)
# INF = sys.maxsize
# MOD = 10 ** 9 + 7
ni = lambda: int(sys.stdin.readline())
ns = lambda: list(map(int, sys.stdin.readline().split()))
na = lambda: list(map(int, sys.... | false | 5 | [
"-import math",
"-import copy",
"+import sys",
"+",
"+# import math",
"+# import bisect",
"+# import copy",
"+# import heapq",
"+# from collections import deque",
"+# import decimal",
"+# sys.setrecursionlimit(100001)",
"+# INF = sys.maxsize",
"+# MOD = 10 ** 9 + 7",
"+ni = lambda: int(sys... | false | 0.066521 | 0.040049 | 1.660995 | [
"s519019330",
"s264327838"
] |
u176645218 | p02798 | python | s053147295 | s565820784 | 1,483 | 504 | 220,680 | 75,868 | Accepted | Accepted | 66.01 | from itertools import permutations, combinations, chain
from collections import defaultdict
N = int(eval(input()))
A = list(map(int,input().split()))
B = list(map(int,input().split()))
def dpinit(ps, val=0):
import copy
res = [val for i in [0]*ps[-1]]
for i in ps[:-1][::-1]:
res = [copy.d... | from itertools import chain
N = int(eval(input()))
A = list(map(int,input().split()))
B = list(map(int,input().split()))
def count_bit(x):
res = 0
while x:
res += x % 2
x >>= 1
return res
def int2bin(x,N):
res = [0]*N
for i in range(N):
res[N-1-i] = x % 2
... | 38 | 65 | 956 | 1,540 | from itertools import permutations, combinations, chain
from collections import defaultdict
N = int(eval(input()))
A = list(map(int, input().split()))
B = list(map(int, input().split()))
def dpinit(ps, val=0):
import copy
res = [val for i in [0] * ps[-1]]
for i in ps[:-1][::-1]:
res = [copy.deep... | from itertools import chain
N = int(eval(input()))
A = list(map(int, input().split()))
B = list(map(int, input().split()))
def count_bit(x):
res = 0
while x:
res += x % 2
x >>= 1
return res
def int2bin(x, N):
res = [0] * N
for i in range(N):
res[N - 1 - i] = x % 2
... | false | 41.538462 | [
"-from itertools import permutations, combinations, chain",
"-from collections import defaultdict",
"+from itertools import chain",
"-def dpinit(ps, val=0):",
"- import copy",
"+def count_bit(x):",
"+ res = 0",
"+ while x:",
"+ res += x % 2",
"+ x >>= 1",
"+ return res"... | false | 0.06911 | 0.15485 | 0.446303 | [
"s053147295",
"s565820784"
] |
u346395915 | p02954 | python | s101591432 | s993955730 | 136 | 125 | 7,260 | 6,400 | Accepted | Accepted | 8.09 | s = list(eval(input()))
ans = [0] * len(s)
cnt = 0
r_temp = 0
l_temp = 0
temp = "R"
for i in range(len(s)):
if temp != s[i] and temp == "R":
r_temp = cnt
cnt = 0
temp = "L"
if temp != s[i] and temp == "L":
l_temp = cnt
cnt = 0
temp = "R"
... | s = eval(input())
res = [0] * len(s)
cnt_r = 0
cnt_l = 0
curr = "R"
last_idx = 0
for idx, char in enumerate(s):
if curr == "R":
if char == "R":
cnt_r += 1
continue
else:
res[idx] += cnt_r // 2
res[idx - 1] += (cnt_r - cnt_r // 2)
... | 65 | 36 | 1,991 | 780 | s = list(eval(input()))
ans = [0] * len(s)
cnt = 0
r_temp = 0
l_temp = 0
temp = "R"
for i in range(len(s)):
if temp != s[i] and temp == "R":
r_temp = cnt
cnt = 0
temp = "L"
if temp != s[i] and temp == "L":
l_temp = cnt
cnt = 0
temp = "R"
if (r_temp - l_tem... | s = eval(input())
res = [0] * len(s)
cnt_r = 0
cnt_l = 0
curr = "R"
last_idx = 0
for idx, char in enumerate(s):
if curr == "R":
if char == "R":
cnt_r += 1
continue
else:
res[idx] += cnt_r // 2
res[idx - 1] += cnt_r - cnt_r // 2
last_idx = i... | false | 44.615385 | [
"-s = list(eval(input()))",
"-ans = [0] * len(s)",
"-cnt = 0",
"-r_temp = 0",
"-l_temp = 0",
"-temp = \"R\"",
"-for i in range(len(s)):",
"- if temp != s[i] and temp == \"R\":",
"- r_temp = cnt",
"- cnt = 0",
"- temp = \"L\"",
"- if temp != s[i] and temp == \"L\":",
... | false | 0.042596 | 0.040248 | 1.05833 | [
"s101591432",
"s993955730"
] |
u579699847 | p03352 | python | s568638367 | s526399095 | 154 | 17 | 12,204 | 2,940 | Accepted | Accepted | 88.96 | import bisect,collections,copy,itertools,math,numpy,string
def I(): return int(eval(input()))
def S(): return eval(input())
def LI(): return list(map(int,input().split()))
def LS(): return list(input().split())
##################################################
X = I()
kouho = []
ans = 1
kouho.append(1)
for i... | x = int(eval(input()))
kouho = [1]
for i in range(2,32):
j = 2
while i**j<=x:
kouho.append(i**j)
j += 1
print((max(kouho)))
| 23 | 8 | 533 | 147 | import bisect, collections, copy, itertools, math, numpy, string
def I():
return int(eval(input()))
def S():
return eval(input())
def LI():
return list(map(int, input().split()))
def LS():
return list(input().split())
##################################################
X = I()
kouho = []
ans = ... | x = int(eval(input()))
kouho = [1]
for i in range(2, 32):
j = 2
while i**j <= x:
kouho.append(i**j)
j += 1
print((max(kouho)))
| false | 65.217391 | [
"-import bisect, collections, copy, itertools, math, numpy, string",
"-",
"-",
"-def I():",
"- return int(eval(input()))",
"-",
"-",
"-def S():",
"- return eval(input())",
"-",
"-",
"-def LI():",
"- return list(map(int, input().split()))",
"-",
"-",
"-def LS():",
"- retur... | false | 0.041976 | 0.033908 | 1.237949 | [
"s568638367",
"s526399095"
] |
u870297120 | p02681 | python | s074895045 | s937977024 | 23 | 20 | 9,040 | 8,968 | Accepted | Accepted | 13.04 | S=eval(input())
T=eval(input())
ans='No'
if S.islower() and T.islower() and 1<=len(S)<=10 and T[0:len(S)]==S:
ans='Yes'
print(ans) | S=eval(input())
T=eval(input())
if T[0:-1]==S:
print('Yes')
else:
print('No') | 6 | 7 | 127 | 80 | S = eval(input())
T = eval(input())
ans = "No"
if S.islower() and T.islower() and 1 <= len(S) <= 10 and T[0 : len(S)] == S:
ans = "Yes"
print(ans)
| S = eval(input())
T = eval(input())
if T[0:-1] == S:
print("Yes")
else:
print("No")
| false | 14.285714 | [
"-ans = \"No\"",
"-if S.islower() and T.islower() and 1 <= len(S) <= 10 and T[0 : len(S)] == S:",
"- ans = \"Yes\"",
"-print(ans)",
"+if T[0:-1] == S:",
"+ print(\"Yes\")",
"+else:",
"+ print(\"No\")"
] | false | 0.114224 | 0.110874 | 1.030212 | [
"s074895045",
"s937977024"
] |
u656995812 | p03062 | python | s494543028 | s610836426 | 96 | 77 | 14,412 | 14,412 | Accepted | Accepted | 19.79 | n = int(eval(input()))
a = list(map(int, input().split()))
count = 0
minus = 0
total = 0
for i in range(n):
if a[i] == 0:
count = i
if count == 0:
while count < n:
if a[count] < 0:
minus += 1
count += 1
else:
minus = 0
if minus%2 == 0:
for i in ran... | n = int(eval(input()))
a = list(map(int, input().split()))
count = 0
for i in range(n):
if a[i] < 0:
count += 1
if count % 2 == 0:
for i in range(n):
a[i] = abs(a[i])
total = sum(a)
else:
for i in range(n):
a[i] = abs(a[i])
total = sum(a) - min(a)*2
print(... | 27 | 18 | 470 | 320 | n = int(eval(input()))
a = list(map(int, input().split()))
count = 0
minus = 0
total = 0
for i in range(n):
if a[i] == 0:
count = i
if count == 0:
while count < n:
if a[count] < 0:
minus += 1
count += 1
else:
minus = 0
if minus % 2 == 0:
for i in range(n):
a[i... | n = int(eval(input()))
a = list(map(int, input().split()))
count = 0
for i in range(n):
if a[i] < 0:
count += 1
if count % 2 == 0:
for i in range(n):
a[i] = abs(a[i])
total = sum(a)
else:
for i in range(n):
a[i] = abs(a[i])
total = sum(a) - min(a) * 2
print(total)
| false | 33.333333 | [
"-minus = 0",
"-total = 0",
"- if a[i] == 0:",
"- count = i",
"-if count == 0:",
"- while count < n:",
"- if a[count] < 0:",
"- minus += 1",
"+ if a[i] < 0:",
"-else:",
"- minus = 0",
"-if minus % 2 == 0:",
"+if count % 2 == 0:"
] | false | 0.071087 | 0.047205 | 1.505925 | [
"s494543028",
"s610836426"
] |
u887207211 | p03495 | python | s556348321 | s398279958 | 117 | 93 | 32,184 | 35,996 | Accepted | Accepted | 20.51 | N, K = list(map(int,input().split()))
A = list(map(int,input().split()))
d = {}
for a in A:
if(a in d):
d[a] += 1
else:
d[a] = 1
print((sum(sorted(d.values())[:-K]))) | from collections import Counter
N, K = list(map(int,input().split()))
A = input().split()
a = Counter(A)
print((sum(sorted(list(a.values()), reverse = True)[K:]))) | 10 | 7 | 180 | 157 | N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
d = {}
for a in A:
if a in d:
d[a] += 1
else:
d[a] = 1
print((sum(sorted(d.values())[:-K])))
| from collections import Counter
N, K = list(map(int, input().split()))
A = input().split()
a = Counter(A)
print((sum(sorted(list(a.values()), reverse=True)[K:])))
| false | 30 | [
"+from collections import Counter",
"+",
"-A = list(map(int, input().split()))",
"-d = {}",
"-for a in A:",
"- if a in d:",
"- d[a] += 1",
"- else:",
"- d[a] = 1",
"-print((sum(sorted(d.values())[:-K])))",
"+A = input().split()",
"+a = Counter(A)",
"+print((sum(sorted(lis... | false | 0.042958 | 0.042994 | 0.999145 | [
"s556348321",
"s398279958"
] |
u340781303 | p02779 | python | s139851926 | s313489584 | 207 | 94 | 32,692 | 31,152 | Accepted | Accepted | 54.59 | n=int(eval(input()))
a=sorted(input().split())
print(('YES'if len(set(a))==n else 'NO')) | n=int(eval(input()))
a=list(map(int, input().split()))
print(('YES' if len(set(a))==n else 'NO')) | 3 | 3 | 82 | 91 | n = int(eval(input()))
a = sorted(input().split())
print(("YES" if len(set(a)) == n else "NO"))
| n = int(eval(input()))
a = list(map(int, input().split()))
print(("YES" if len(set(a)) == n else "NO"))
| false | 0 | [
"-a = sorted(input().split())",
"+a = list(map(int, input().split()))"
] | false | 0.035828 | 0.034155 | 1.048973 | [
"s139851926",
"s313489584"
] |
u816587940 | p02839 | python | s450557616 | s127362489 | 345 | 296 | 64,732 | 63,452 | Accepted | Accepted | 14.2 | import sys
def main():
input=sys.stdin.readline
h,w=list(map(int,input().split()))
a=[list(map(int,input().split())) for _ in range(h)]
b=[list(map(int,input().split())) for _ in range(h)]
ofset = 80*164
mask = (1 << (ofset*2)) - 1
dp=[[0 for i in range(w)] for j in range(h)]
dp... | import sys
def main():
input=sys.stdin.readline
h,w=list(map(int,input().split()))
a=[list(map(int,input().split())) for _ in range(h)]
b=[list(map(int,input().split())) for _ in range(h)]
ofset = 80*164
#mask = (1 << (ofset*2)) - 1
dp=[[0 for i in range(w)] for j in range(h)]
d... | 29 | 29 | 1,082 | 1,055 | import sys
def main():
input = sys.stdin.readline
h, w = list(map(int, input().split()))
a = [list(map(int, input().split())) for _ in range(h)]
b = [list(map(int, input().split())) for _ in range(h)]
ofset = 80 * 164
mask = (1 << (ofset * 2)) - 1
dp = [[0 for i in range(w)] for j in range... | import sys
def main():
input = sys.stdin.readline
h, w = list(map(int, input().split()))
a = [list(map(int, input().split())) for _ in range(h)]
b = [list(map(int, input().split())) for _ in range(h)]
ofset = 80 * 164
# mask = (1 << (ofset*2)) - 1
dp = [[0 for i in range(w)] for j in range... | false | 0 | [
"- mask = (1 << (ofset * 2)) - 1",
"+ # mask = (1 << (ofset*2)) - 1",
"- dp[i + 1][j] |= (dp[i][j] << A) & mask",
"- dp[i + 1][j] |= (dp[i][j] >> A) & mask",
"+ dp[i + 1][j] |= dp[i][j] << A",
"+ dp[i + 1][j] |= dp[i][j] >> A",
"- ... | false | 0.051015 | 0.050457 | 1.011047 | [
"s450557616",
"s127362489"
] |
u312025627 | p04035 | python | s199985181 | s230811909 | 296 | 260 | 63,984 | 59,624 | Accepted | Accepted | 12.16 | def main():
N, L = (int(i) for i in input().split())
A = [int(i) for i in input().split()]
ma = 0
idx = -1
for i in range(N-1):
if ma < A[i] + A[i+1]:
ma = A[i] + A[i+1]
idx = i+1
if ma < L:
return print("Impossible")
print("Possible")
... | def main():
import sys
input = sys.stdin.buffer.readline
N, L = (int(i) for i in input().split())
A = [int(i) for i in input().split()]
last = -1
for i in range(N-1):
if L <= A[i] + A[i+1]:
last = i+1
if last < 0:
return print("Impossible")
ans = [i... | 21 | 19 | 461 | 498 | def main():
N, L = (int(i) for i in input().split())
A = [int(i) for i in input().split()]
ma = 0
idx = -1
for i in range(N - 1):
if ma < A[i] + A[i + 1]:
ma = A[i] + A[i + 1]
idx = i + 1
if ma < L:
return print("Impossible")
print("Possible")
for ... | def main():
import sys
input = sys.stdin.buffer.readline
N, L = (int(i) for i in input().split())
A = [int(i) for i in input().split()]
last = -1
for i in range(N - 1):
if L <= A[i] + A[i + 1]:
last = i + 1
if last < 0:
return print("Impossible")
ans = [i for... | false | 9.52381 | [
"+ import sys",
"+",
"+ input = sys.stdin.buffer.readline",
"- ma = 0",
"- idx = -1",
"+ last = -1",
"- if ma < A[i] + A[i + 1]:",
"- ma = A[i] + A[i + 1]",
"- idx = i + 1",
"- if ma < L:",
"+ if L <= A[i] + A[i + 1]:",
"+ last =... | false | 0.039866 | 0.046282 | 0.861363 | [
"s199985181",
"s230811909"
] |
u089230684 | p03547 | python | s208540072 | s959770493 | 17 | 11 | 2,940 | 2,568 | Accepted | Accepted | 35.29 | x=input().split()
if x[0] == x[1] :
print('=')
elif x[0] > x[1] :
print('>')
else :
print('<')
| temp=list(input().split())
if temp[0]>temp[1]:
print('>')
elif temp[0]<temp[1]:
print('<')
else:
print('=') | 10 | 8 | 123 | 119 | x = input().split()
if x[0] == x[1]:
print("=")
elif x[0] > x[1]:
print(">")
else:
print("<")
| temp = list(input().split())
if temp[0] > temp[1]:
print(">")
elif temp[0] < temp[1]:
print("<")
else:
print("=")
| false | 20 | [
"-x = input().split()",
"-if x[0] == x[1]:",
"+temp = list(input().split())",
"+if temp[0] > temp[1]:",
"+ print(\">\")",
"+elif temp[0] < temp[1]:",
"+ print(\"<\")",
"+else:",
"-elif x[0] > x[1]:",
"- print(\">\")",
"-else:",
"- print(\"<\")"
] | false | 0.042784 | 0.034368 | 1.24489 | [
"s208540072",
"s959770493"
] |
u850491413 | p03332 | python | s643540820 | s641642436 | 1,085 | 312 | 65,500 | 65,880 | Accepted | Accepted | 71.24 | import sys
def input():
return sys.stdin.readline().strip()
N, A, B, K = list(map(int, input().split()))
mod = 998244353
fact_list = [1]
for i in range(1, N + 1):
fact_list.append((fact_list[-1]*i) % mod)
def pow(x, y, mod=1000000007):
pow_list = [x]
i = 1
while 2**i <= y:
a = pow_list[-1]**2... |
import sys
def input():
return sys.stdin.readline().strip()
N, A, B, K = list(map(int, input().split()))
mod = 998244353
fact_list = [1]
for i in range(1, N + 1):
fact_list.append((fact_list[-1]*i) % mod)
def pow(x, y, mod=1000000007):
pow_list = [x]
i = 1
while 2**i <= y:
a = pow_list[-1]*... | 66 | 76 | 1,255 | 1,418 | import sys
def input():
return sys.stdin.readline().strip()
N, A, B, K = list(map(int, input().split()))
mod = 998244353
fact_list = [1]
for i in range(1, N + 1):
fact_list.append((fact_list[-1] * i) % mod)
def pow(x, y, mod=1000000007):
pow_list = [x]
i = 1
while 2**i <= y:
a = pow_li... | import sys
def input():
return sys.stdin.readline().strip()
N, A, B, K = list(map(int, input().split()))
mod = 998244353
fact_list = [1]
for i in range(1, N + 1):
fact_list.append((fact_list[-1] * i) % mod)
def pow(x, y, mod=1000000007):
pow_list = [x]
i = 1
while 2**i <= y:
a = pow_li... | false | 13.157895 | [
"-rev_list = [1]",
"-for i in range(N):",
"- rev_list.append(pow(fact(i + 1, mod), mod - 2, mod))",
"+inv_t = [0] + [1]",
"+for i in range(2, N + 1):",
"+ inv_t += [inv_t[mod % i] * (mod - int(mod / i)) % mod]",
"- return rev_list[x]",
"+ return inv_t[x]",
"+",
"+",
"+inv_fact = [1] ... | false | 0.925322 | 0.236352 | 3.915018 | [
"s643540820",
"s641642436"
] |
u108617242 | p03014 | python | s059525701 | s611796913 | 1,982 | 1,683 | 426,188 | 249,608 | Accepted | Accepted | 15.09 | H, W = list(map(int, input().split()))
S = [list(eval(input())) for h in range(H)]
count_matw = [[0 for w in range(W)]for h in range(H)]
count_math = [[0 for w in range(W)]for h in range(H)]
for h in range(H):
count = 0
for w in range(W):
if '#' == S[h][w]:
count = 0
else:... | H, W = list(map(int, input().split()))
S = [list(eval(input())) for h in range(H)]
count_matw = [[0 for w in range(W)]for h in range(H)]
count_math = [[0 for w in range(W)]for h in range(H)]
for h in range(H):
count = 0
for w in range(W):
if '#' == S[h][w]:
count = 0
else:... | 38 | 38 | 1,142 | 1,138 | H, W = list(map(int, input().split()))
S = [list(eval(input())) for h in range(H)]
count_matw = [[0 for w in range(W)] for h in range(H)]
count_math = [[0 for w in range(W)] for h in range(H)]
for h in range(H):
count = 0
for w in range(W):
if "#" == S[h][w]:
count = 0
else:
... | H, W = list(map(int, input().split()))
S = [list(eval(input())) for h in range(H)]
count_matw = [[0 for w in range(W)] for h in range(H)]
count_math = [[0 for w in range(W)] for h in range(H)]
for h in range(H):
count = 0
for w in range(W):
if "#" == S[h][w]:
count = 0
else:
... | false | 0 | [
"-# for h in range(H):",
"-# for w in range(W):",
"-# ans = max(ans, count_math[h][w] + count_matw[h][w])",
"-ans = max([count_math[h][w] + count_matw[h][w] for h in range(H) for w in range(W)])",
"+for h in range(H):",
"+ for w in range(W):",
"+ ans = max(ans, count_math[h][w] + c... | false | 0.047379 | 0.041986 | 1.128468 | [
"s059525701",
"s611796913"
] |
u461454424 | p02630 | python | s603611625 | s723862266 | 534 | 377 | 90,316 | 29,988 | Accepted | Accepted | 29.4 | #atcoder template
def main():
import sys
imput = sys.stdin.readline
#文字列入力の時は上記はerrorとなる。
#ここにコード
#input
from collections import Counter
N = int(eval(input()))
A = list(map(int, input().split()))
D = Counter(A)
S = sum(A)
Q = int(eval(input()))
B = [0] * Q
... | #atcoder template
def main():
import sys
imput = sys.stdin.readline
#文字列入力の時は上記はerrorとなる。
#ここにコード
#input
N = int(eval(input()))
A = list(map(int, input().split()))
Q = int(eval(input()))
B = [0] * Q
C = [0] * Q
for i in range(Q):
B[i], C[i] = list(map(int... | 28 | 31 | 610 | 662 | # atcoder template
def main():
import sys
imput = sys.stdin.readline
# 文字列入力の時は上記はerrorとなる。
# ここにコード
# input
from collections import Counter
N = int(eval(input()))
A = list(map(int, input().split()))
D = Counter(A)
S = sum(A)
Q = int(eval(input()))
B = [0] * Q
C = [... | # atcoder template
def main():
import sys
imput = sys.stdin.readline
# 文字列入力の時は上記はerrorとなる。
# ここにコード
# input
N = int(eval(input()))
A = list(map(int, input().split()))
Q = int(eval(input()))
B = [0] * Q
C = [0] * Q
for i in range(Q):
B[i], C[i] = list(map(int, input(... | false | 9.677419 | [
"- from collections import Counter",
"-",
"- D = Counter(A)",
"- S = sum(A)",
"- b, c = list(map(int, input().split()))",
"- x = D[b]",
"- y = D[c]",
"- temp = -x * b + x * c",
"- print((S + temp))",
"- S += temp",
"- D[b] = 0",
"- ... | false | 0.04194 | 0.0346 | 1.212132 | [
"s603611625",
"s723862266"
] |
u499381410 | p03726 | python | s219393492 | s404465540 | 511 | 419 | 100,132 | 98,984 | Accepted | Accepted | 18 | from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, ... | from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, ... | 63 | 66 | 1,656 | 1,732 | from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor
fro... | from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor
fro... | false | 4.545455 | [
"+ matched[v] = u",
"- cnt += int(dfs(i, set()))",
"+ if matched[i] != -1:",
"+ continue",
"+ cnt += int(dfs(i, set())) * 2"
] | false | 0.035743 | 0.036661 | 0.974958 | [
"s219393492",
"s404465540"
] |
u537782349 | p02983 | python | s766112002 | s647061673 | 80 | 60 | 2,940 | 2,940 | Accepted | Accepted | 25 | a, b = list(map(int, input().split()))
c = a * b
for i in range(a, b+1):
for j in range(a, b+1):
if i != j:
if c > i * j % 2019:
c = i * j % 2019
if c == 0:
print((0))
exit()
print(c)
| a, b = list(map(int, input().split()))
c = 10 ** 9
for i in range(a, b+1):
for j in range(i+1, b+1):
c = min(c, i * j % 2019)
if c == 0:
print(c)
exit()
print(c)
| 11 | 10 | 270 | 210 | a, b = list(map(int, input().split()))
c = a * b
for i in range(a, b + 1):
for j in range(a, b + 1):
if i != j:
if c > i * j % 2019:
c = i * j % 2019
if c == 0:
print((0))
exit()
print(c)
| a, b = list(map(int, input().split()))
c = 10**9
for i in range(a, b + 1):
for j in range(i + 1, b + 1):
c = min(c, i * j % 2019)
if c == 0:
print(c)
exit()
print(c)
| false | 9.090909 | [
"-c = a * b",
"+c = 10**9",
"- for j in range(a, b + 1):",
"- if i != j:",
"- if c > i * j % 2019:",
"- c = i * j % 2019",
"- if c == 0:",
"- print((0))",
"- exit()",
"+ for j in range(i + 1, b + 1):",
"+ c = ... | false | 0.042701 | 0.042727 | 0.999379 | [
"s766112002",
"s647061673"
] |
u150984829 | p00056 | python | s149268894 | s429715472 | 2,380 | 1,790 | 7,800 | 7,796 | Accepted | Accepted | 24.79 | import bisect
from itertools import *
n=list(range(50001));a=list(n);a[1]=0
for i in range(2,224):a[i*2::i]=[0]*len(a[i*2::i])
p=list(compress(n,a))
for x in iter(input,'0'):x=int(x);print((sum(a[x-d]>0 for d in p[:bisect.bisect(p,x//2)])))
| import bisect
from itertools import *
n=list(range(50001));a=list(n);a[1]=0
for i in range(2,224):a[i*2::i]=[0]*len(a[i*2::i])
p=list(compress(n,a))
for x in iter(input,'0'):x=int(x);print((sum(1 for d in p[:bisect.bisect(p,x//2)]if a[x-d])))
| 6 | 6 | 238 | 240 | import bisect
from itertools import *
n = list(range(50001))
a = list(n)
a[1] = 0
for i in range(2, 224):
a[i * 2 :: i] = [0] * len(a[i * 2 :: i])
p = list(compress(n, a))
for x in iter(input, "0"):
x = int(x)
print((sum(a[x - d] > 0 for d in p[: bisect.bisect(p, x // 2)])))
| import bisect
from itertools import *
n = list(range(50001))
a = list(n)
a[1] = 0
for i in range(2, 224):
a[i * 2 :: i] = [0] * len(a[i * 2 :: i])
p = list(compress(n, a))
for x in iter(input, "0"):
x = int(x)
print((sum(1 for d in p[: bisect.bisect(p, x // 2)] if a[x - d])))
| false | 0 | [
"- print((sum(a[x - d] > 0 for d in p[: bisect.bisect(p, x // 2)])))",
"+ print((sum(1 for d in p[: bisect.bisect(p, x // 2)] if a[x - d])))"
] | false | 0.048136 | 0.103306 | 0.465954 | [
"s149268894",
"s429715472"
] |
u787456042 | p03862 | python | s341255219 | s285937151 | 112 | 95 | 14,092 | 14,092 | Accepted | Accepted | 15.18 | N,x,*A=list(map(int,open(0).read().split()));s=sum(A);A=[min(x,a)for a in A]
for i in range(N-1):A[i+1]-=max(0,A[i]+A[i+1]-x)
print((s-sum(A))) | N,x,*A=list(map(int,open(0).read().split()));s=sum(A);A+=0,
for i in range(N):A[i]-=max(0,A[i]+A[i-1]-x)
print((s-sum(A))) | 3 | 3 | 137 | 116 | N, x, *A = list(map(int, open(0).read().split()))
s = sum(A)
A = [min(x, a) for a in A]
for i in range(N - 1):
A[i + 1] -= max(0, A[i] + A[i + 1] - x)
print((s - sum(A)))
| N, x, *A = list(map(int, open(0).read().split()))
s = sum(A)
A += (0,)
for i in range(N):
A[i] -= max(0, A[i] + A[i - 1] - x)
print((s - sum(A)))
| false | 0 | [
"-A = [min(x, a) for a in A]",
"-for i in range(N - 1):",
"- A[i + 1] -= max(0, A[i] + A[i + 1] - x)",
"+A += (0,)",
"+for i in range(N):",
"+ A[i] -= max(0, A[i] + A[i - 1] - x)"
] | false | 0.04135 | 0.145105 | 0.284962 | [
"s341255219",
"s285937151"
] |
u422104747 | p03222 | python | s239209400 | s529769581 | 195 | 150 | 41,200 | 12,500 | Accepted | Accepted | 23.08 | l=[[] for i in range(9)]
l[1]=[""]
l[2]=["0","1"]
for i in range(3,9):
for s in l[i-1]:
l[i].append("0"+s)
if s[0]!="1":
l[i].append("1"+s)
mod=1000000007
s=input().split()
h,w,k=int(s[0]),int(s[1]),int(s[2])
dp=[[0]*(w) for i in range(h+1)]
dp[0][0]=1
for i in range(h):
... | import numpy as np
mod=1000000007
s=input().split()
h,w,k=int(s[0]),int(s[1]),int(s[2])
l=[]
for i in range(2**(w-1)):
s=bin(i)[2:].zfill(w-1)
if s.find("11")==-1:
l.append(s)
mat=np.zeros((w,w),dtype="int64")
for s in l:
dest=[i for i in range(w)]
for i in range(w-1):
if ... | 28 | 25 | 806 | 583 | l = [[] for i in range(9)]
l[1] = [""]
l[2] = ["0", "1"]
for i in range(3, 9):
for s in l[i - 1]:
l[i].append("0" + s)
if s[0] != "1":
l[i].append("1" + s)
mod = 1000000007
s = input().split()
h, w, k = int(s[0]), int(s[1]), int(s[2])
dp = [[0] * (w) for i in range(h + 1)]
dp[0][0] = 1
f... | import numpy as np
mod = 1000000007
s = input().split()
h, w, k = int(s[0]), int(s[1]), int(s[2])
l = []
for i in range(2 ** (w - 1)):
s = bin(i)[2:].zfill(w - 1)
if s.find("11") == -1:
l.append(s)
mat = np.zeros((w, w), dtype="int64")
for s in l:
dest = [i for i in range(w)]
for i in range(w -... | false | 10.714286 | [
"-l = [[] for i in range(9)]",
"-l[1] = [\"\"]",
"-l[2] = [\"0\", \"1\"]",
"-for i in range(3, 9):",
"- for s in l[i - 1]:",
"- l[i].append(\"0\" + s)",
"- if s[0] != \"1\":",
"- l[i].append(\"1\" + s)",
"+import numpy as np",
"+",
"-dp = [[0] * (w) for i in range(h +... | false | 0.040377 | 0.330512 | 0.122165 | [
"s239209400",
"s529769581"
] |
u885899351 | p03309 | python | s628574206 | s986048831 | 308 | 257 | 26,708 | 26,184 | Accepted | Accepted | 16.56 | n=int(eval(input()))
a=list(map(int,input().split()))
for i in range(n):a[i]-=i+1
a.sort()
if n%2==1:
ans=0
for i in a:ans+=abs(i-a[n//2])
else:
ans,ans2=0,0
for i in a:
ans+=abs(i-a[n//2])
ans2+=abs(i-a[n//2+1])
ans=min(ans,ans2)
print(ans) | n=int(eval(input()))
a=list(map(int,input().split()))
for i in range(n):a[i]-=i+1
a.sort()
if n%2==1:
ans,j=0,a[n//2]
for i in a:ans+=abs(i-j)
else:
ans,ans2,j,k=0,0,a[n//2],a[n//2+1]
for i in a:
ans+=abs(i-j)
ans2+=abs(i-k)
ans=min(ans,ans2)
print(ans) | 14 | 14 | 284 | 296 | n = int(eval(input()))
a = list(map(int, input().split()))
for i in range(n):
a[i] -= i + 1
a.sort()
if n % 2 == 1:
ans = 0
for i in a:
ans += abs(i - a[n // 2])
else:
ans, ans2 = 0, 0
for i in a:
ans += abs(i - a[n // 2])
ans2 += abs(i - a[n // 2 + 1])
ans = min(ans, ans... | n = int(eval(input()))
a = list(map(int, input().split()))
for i in range(n):
a[i] -= i + 1
a.sort()
if n % 2 == 1:
ans, j = 0, a[n // 2]
for i in a:
ans += abs(i - j)
else:
ans, ans2, j, k = 0, 0, a[n // 2], a[n // 2 + 1]
for i in a:
ans += abs(i - j)
ans2 += abs(i - k)
... | false | 0 | [
"- ans = 0",
"+ ans, j = 0, a[n // 2]",
"- ans += abs(i - a[n // 2])",
"+ ans += abs(i - j)",
"- ans, ans2 = 0, 0",
"+ ans, ans2, j, k = 0, 0, a[n // 2], a[n // 2 + 1]",
"- ans += abs(i - a[n // 2])",
"- ans2 += abs(i - a[n // 2 + 1])",
"+ ans += abs(i ... | false | 0.050426 | 0.049172 | 1.025494 | [
"s628574206",
"s986048831"
] |
u197955752 | p03379 | python | s708580977 | s384906410 | 266 | 203 | 30,732 | 30,772 | Accepted | Accepted | 23.68 | N = int(eval(input()))
X = [int(x) for x in input().split()]
ind = [i for i in range(N)]
# XのindexをXが昇順になるように並び替える
ind = sorted(ind, key = lambda i : X[i])
ans = [0] * N
for i in range(N // 2):
ans[ind[i]] = X[ind[N // 2]]
for i in range(N // 2, N):
ans[ind[i]] = X[ind[N // 2 - 1]]
for i in range(... | N = int(eval(input()))
X = [int(x) for x in input().split()]
Y = sorted(X)
for i in range(N):
if X[i] < Y[N // 2]:
print((Y[N // 2]))
else:
print((Y[N // 2 - 1])) | 14 | 9 | 336 | 185 | N = int(eval(input()))
X = [int(x) for x in input().split()]
ind = [i for i in range(N)]
# XのindexをXが昇順になるように並び替える
ind = sorted(ind, key=lambda i: X[i])
ans = [0] * N
for i in range(N // 2):
ans[ind[i]] = X[ind[N // 2]]
for i in range(N // 2, N):
ans[ind[i]] = X[ind[N // 2 - 1]]
for i in range(N):
print((an... | N = int(eval(input()))
X = [int(x) for x in input().split()]
Y = sorted(X)
for i in range(N):
if X[i] < Y[N // 2]:
print((Y[N // 2]))
else:
print((Y[N // 2 - 1]))
| false | 35.714286 | [
"-ind = [i for i in range(N)]",
"-# XのindexをXが昇順になるように並び替える",
"-ind = sorted(ind, key=lambda i: X[i])",
"-ans = [0] * N",
"-for i in range(N // 2):",
"- ans[ind[i]] = X[ind[N // 2]]",
"-for i in range(N // 2, N):",
"- ans[ind[i]] = X[ind[N // 2 - 1]]",
"+Y = sorted(X)",
"- print((ans[i]))... | false | 0.04131 | 0.040465 | 1.020881 | [
"s708580977",
"s384906410"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.