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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
u191394596 | p02712 | python | s123166769 | s551286778 | 166 | 98 | 9,156 | 73,132 | Accepted | Accepted | 40.96 | N = int(eval(input()))
def fizz_buzz(n):
return 0 if n % 5 == 0 or n % 3 == 0 else n
print((sum(
fizz_buzz(i)
for i in range(1, N + 1)
))) | N = int(eval(input()))
print((sum(
i
for i in range(1, N + 1)
if i % 3 != 0 and i % 5 != 0
)))
| 9 | 7 | 146 | 100 | N = int(eval(input()))
def fizz_buzz(n):
return 0 if n % 5 == 0 or n % 3 == 0 else n
print((sum(fizz_buzz(i) for i in range(1, N + 1))))
| N = int(eval(input()))
print((sum(i for i in range(1, N + 1) if i % 3 != 0 and i % 5 != 0)))
| false | 22.222222 | [
"-",
"-",
"-def fizz_buzz(n):",
"- return 0 if n % 5 == 0 or n % 3 == 0 else n",
"-",
"-",
"-print((sum(fizz_buzz(i) for i in range(1, N + 1))))",
"+print((sum(i for i in range(1, N + 1) if i % 3 != 0 and i % 5 != 0)))"
] | false | 0.378218 | 0.097638 | 3.87368 | [
"s123166769",
"s551286778"
] |
u279955105 | p02390 | python | s623232564 | s976673961 | 30 | 20 | 7,660 | 5,588 | Accepted | Accepted | 33.33 | t = int(eval(input()))
a = int(t / 3600)
b = int(t % 3600 / 60)
c = int(t % 3600 % 60)
print((str(a)+':'+str(b)+':'+str(c))) | Input = int(eval(input()))
h = Input//3600
m = (Input % 3600)//60
s = (Input % 3600) % 60
print((str(h) + ':' + str(m) + ':' + str(s)))
| 5 | 5 | 120 | 132 | t = int(eval(input()))
a = int(t / 3600)
b = int(t % 3600 / 60)
c = int(t % 3600 % 60)
print((str(a) + ":" + str(b) + ":" + str(c)))
| Input = int(eval(input()))
h = Input // 3600
m = (Input % 3600) // 60
s = (Input % 3600) % 60
print((str(h) + ":" + str(m) + ":" + str(s)))
| false | 0 | [
"-t = int(eval(input()))",
"-a = int(t / 3600)",
"-b = int(t % 3600 / 60)",
"-c = int(t % 3600 % 60)",
"-print((str(a) + \":\" + str(b) + \":\" + str(c)))",
"+Input = int(eval(input()))",
"+h = Input // 3600",
"+m = (Input % 3600) // 60",
"+s = (Input % 3600) % 60",
"+print((str(h) + \":\" + str(m... | false | 0.040131 | 0.049741 | 0.806795 | [
"s623232564",
"s976673961"
] |
u254871849 | p02814 | python | s822402034 | s646026869 | 621 | 491 | 14,588 | 14,588 | Accepted | Accepted | 20.93 | import sys
from functools import reduce
def gcd(a, b):
while b:
a, b = b, a % b
return abs(a)
def lcm(a, b):
return abs(a // gcd(a, b) * b)
n, m, *a = list(map(int, sys.stdin.read().split()))
def main():
for i in range(n):
a[i] //= 2
res = 1
while True:
... | import sys
from functools import reduce
def gcd(a, b):
while b:
a, b = b, a % b
return abs(a)
def lcm(a, b):
return abs(a // gcd(a, b) * b)
def cnt_2(n):
cnt = 0
while n % 2 == 0:
cnt += 1
n //= 2
return cnt
n, m, *a = list(map(int, sys.stdin.read().... | 39 | 36 | 782 | 624 | import sys
from functools import reduce
def gcd(a, b):
while b:
a, b = b, a % b
return abs(a)
def lcm(a, b):
return abs(a // gcd(a, b) * b)
n, m, *a = list(map(int, sys.stdin.read().split()))
def main():
for i in range(n):
a[i] //= 2
res = 1
while True:
oe = a[0] ... | import sys
from functools import reduce
def gcd(a, b):
while b:
a, b = b, a % b
return abs(a)
def lcm(a, b):
return abs(a // gcd(a, b) * b)
def cnt_2(n):
cnt = 0
while n % 2 == 0:
cnt += 1
n //= 2
return cnt
n, m, *a = list(map(int, sys.stdin.read().split()))
de... | false | 7.692308 | [
"+def cnt_2(n):",
"+ cnt = 0",
"+ while n % 2 == 0:",
"+ cnt += 1",
"+ n //= 2",
"+ return cnt",
"+",
"+",
"- res = 1",
"- while True:",
"- oe = a[0] & 1",
"- if oe == 0:",
"- for i in range(n):",
"- if a[i] & 1 == 1:",
... | false | 0.038815 | 0.04572 | 0.848975 | [
"s822402034",
"s646026869"
] |
u733814820 | p03127 | python | s938532724 | s875389404 | 91 | 80 | 16,240 | 20,084 | Accepted | Accepted | 12.09 | # ABC 118 C
import fractions
N = int(eval(input()))
a = list(map(int, input().split()))
g = a[0]
for i in a:
g = fractions.gcd(g, i)
print(g)
| def gcd(x, y):
if y == 0:
return x
else:
return gcd(y, x % y)
def resolve():
n = int(eval(input()))
a = list(map(int, input().split()))
ans = a[0]
for x in a:
ans = gcd(ans, x)
print(ans)
return
if __name__ == "__main__":
resolve()
| 14 | 18 | 159 | 276 | # ABC 118 C
import fractions
N = int(eval(input()))
a = list(map(int, input().split()))
g = a[0]
for i in a:
g = fractions.gcd(g, i)
print(g)
| def gcd(x, y):
if y == 0:
return x
else:
return gcd(y, x % y)
def resolve():
n = int(eval(input()))
a = list(map(int, input().split()))
ans = a[0]
for x in a:
ans = gcd(ans, x)
print(ans)
return
if __name__ == "__main__":
resolve()
| false | 22.222222 | [
"-# ABC 118 C",
"-import fractions",
"+def gcd(x, y):",
"+ if y == 0:",
"+ return x",
"+ else:",
"+ return gcd(y, x % y)",
"-N = int(eval(input()))",
"-a = list(map(int, input().split()))",
"-g = a[0]",
"-for i in a:",
"- g = fractions.gcd(g, i)",
"-print(g)",
"+",
... | false | 0.081062 | 0.042582 | 1.903641 | [
"s938532724",
"s875389404"
] |
u906501980 | p02684 | python | s282847403 | s488504444 | 688 | 545 | 175,636 | 184,348 | Accepted | Accepted | 20.78 | def main():
n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
to = [[None]*n for _ in range(60)]
to[0] = a
for i in range(1, 60):
for j in range(n):
to[i][j] = to[i-1][to[i-1][j]-1]
p = 1
for i in range(59, -1, -1):
num = 1 << i
... | def main():
n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
to = [[None]*n for _ in range(60)]
to[0] = a[:]
for i in range(1, 60):
for j in range(n):
to[i][j] = to[i-1][to[i-1][j]-1]
p = 1
for i in range(59, -1, -1):
num = 1 <<... | 19 | 19 | 455 | 454 | def main():
n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
to = [[None] * n for _ in range(60)]
to[0] = a
for i in range(1, 60):
for j in range(n):
to[i][j] = to[i - 1][to[i - 1][j] - 1]
p = 1
for i in range(59, -1, -1):
num = 1 << i
... | def main():
n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
to = [[None] * n for _ in range(60)]
to[0] = a[:]
for i in range(1, 60):
for j in range(n):
to[i][j] = to[i - 1][to[i - 1][j] - 1]
p = 1
for i in range(59, -1, -1):
num = 1 << i... | false | 0 | [
"- to[0] = a",
"+ to[0] = a[:]"
] | false | 0.044287 | 0.04375 | 1.012265 | [
"s282847403",
"s488504444"
] |
u562935282 | p02775 | python | s751414785 | s304399395 | 1,161 | 660 | 14,628 | 20,464 | Accepted | Accepted | 43.15 | def main():
*e, = list(map(int, eval(input())))
e.reverse()
inf = 20 * len(e)
dp = [0, inf] # 繰り下がり無,有
for x in e:
ndp = [-1, -1] # 繰り下がり無,有
ndp[0] = min(
dp[0] + x,
dp[1] + ((x + 1) if x < 9 else inf) # ちょうど支払えないのでinf
) # ちょうど支払う... | # https://atcoder.jp/contests/abc155/submissions/10157837
# 写経
def main():
a = [0]
a += list(map(int, eval(input())))
a.reverse()
n = len(a)
b = a.copy()
for i in range(n):
if b[i] > 5 or (b[i] == 5 and b[i + 1] >= 5):
b[i] = 0
b[i + 1] += 1
... | 45 | 27 | 917 | 511 | def main():
(*e,) = list(map(int, eval(input())))
e.reverse()
inf = 20 * len(e)
dp = [0, inf] # 繰り下がり無,有
for x in e:
ndp = [-1, -1] # 繰り下がり無,有
ndp[0] = min(
dp[0] + x, dp[1] + ((x + 1) if x < 9 else inf) # ちょうど支払えないのでinf
) # ちょうど支払う
ndp[1] = min(
... | # https://atcoder.jp/contests/abc155/submissions/10157837
# 写経
def main():
a = [0]
a += list(map(int, eval(input())))
a.reverse()
n = len(a)
b = a.copy()
for i in range(n):
if b[i] > 5 or (b[i] == 5 and b[i + 1] >= 5):
b[i] = 0
b[i + 1] += 1
cnt = sum(b)
f... | false | 40 | [
"+# https://atcoder.jp/contests/abc155/submissions/10157837",
"+# 写経",
"- (*e,) = list(map(int, eval(input())))",
"- e.reverse()",
"- inf = 20 * len(e)",
"- dp = [0, inf] # 繰り下がり無,有",
"- for x in e:",
"- ndp = [-1, -1] # 繰り下がり無,有",
"- ndp[0] = min(",
"- dp... | false | 0.06847 | 0.04518 | 1.515497 | [
"s751414785",
"s304399395"
] |
u340781749 | p03472 | python | s264616302 | s052829638 | 496 | 435 | 59,224 | 59,224 | Accepted | Accepted | 12.3 | from bisect import bisect_left
from itertools import accumulate, takewhile
from math import ceil
def solve(h, aa, bb):
max_a = max(aa)
bba = list(accumulate(takewhile(lambda x: x > max_a, sorted(bb, reverse=True))))
if not bba:
return ceil(h / max_a)
remain = h - bba[-1]
if rema... | from bisect import bisect_left, bisect
from itertools import accumulate
from math import ceil
def solve(h, aa, bb):
max_a = max(aa)
bs = sorted(bb)
i = bisect(bs, max_a)
if i == n:
return ceil(h / max_a)
bba = list(accumulate(reversed(bs[i:])))
remain = h - bba[-1]
if ... | 20 | 22 | 540 | 544 | from bisect import bisect_left
from itertools import accumulate, takewhile
from math import ceil
def solve(h, aa, bb):
max_a = max(aa)
bba = list(accumulate(takewhile(lambda x: x > max_a, sorted(bb, reverse=True))))
if not bba:
return ceil(h / max_a)
remain = h - bba[-1]
if remain <= 0:
... | from bisect import bisect_left, bisect
from itertools import accumulate
from math import ceil
def solve(h, aa, bb):
max_a = max(aa)
bs = sorted(bb)
i = bisect(bs, max_a)
if i == n:
return ceil(h / max_a)
bba = list(accumulate(reversed(bs[i:])))
remain = h - bba[-1]
if remain <= 0:
... | false | 9.090909 | [
"-from bisect import bisect_left",
"-from itertools import accumulate, takewhile",
"+from bisect import bisect_left, bisect",
"+from itertools import accumulate",
"- bba = list(accumulate(takewhile(lambda x: x > max_a, sorted(bb, reverse=True))))",
"- if not bba:",
"+ bs = sorted(bb)",
"+ ... | false | 0.048174 | 0.038347 | 1.256288 | [
"s264616302",
"s052829638"
] |
u226155577 | p03201 | python | s044475496 | s761002520 | 1,666 | 982 | 121,508 | 57,484 | Accepted | Accepted | 41.06 | from bisect import bisect
N = int(eval(input()))
*A, = list(map(int, input().split()))
B = {}
for a in A:
B[a] = B.get(a, 0) + 1
R = sorted(B.items())
C = []; D = []
for k, v in sorted(B.items()):
C.append(k)
D.append(v)
M = len(C)
j = 0
ans = 0
for i in range(M-1, -1, -1):
if D[i] == 0:
... | from bisect import bisect
N = int(eval(input()))
*A, = list(map(int, input().split()))
B = {}
for a in A:
B[a] = B.get(a, 0) + 1
R = sorted(B.items())
C = []; D = []
for k, v in sorted(B.items()):
C.append(k)
D.append(v)
M = len(C)
j = 0
ans = 0
for i in range(M-1, -1, -1):
if D[i] == 0:
... | 29 | 28 | 612 | 576 | from bisect import bisect
N = int(eval(input()))
(*A,) = list(map(int, input().split()))
B = {}
for a in A:
B[a] = B.get(a, 0) + 1
R = sorted(B.items())
C = []
D = []
for k, v in sorted(B.items()):
C.append(k)
D.append(v)
M = len(C)
j = 0
ans = 0
for i in range(M - 1, -1, -1):
if D[i] == 0:
con... | from bisect import bisect
N = int(eval(input()))
(*A,) = list(map(int, input().split()))
B = {}
for a in A:
B[a] = B.get(a, 0) + 1
R = sorted(B.items())
C = []
D = []
for k, v in sorted(B.items()):
C.append(k)
D.append(v)
M = len(C)
j = 0
ans = 0
for i in range(M - 1, -1, -1):
if D[i] == 0:
con... | false | 3.448276 | [
"- b = 2 ** (a).bit_length()",
"+ b = 2 ** a.bit_length()",
"- ans += D[i] // 2",
"- D[i] %= 2",
"+ c = D[i] // 2",
"- ans += c",
"- D[i] -= c",
"- D[j] -= c",
"+ ans += c",
"+ D[i] -= c",
"+ D[j] -= c"
... | false | 0.038625 | 0.037732 | 1.023667 | [
"s044475496",
"s761002520"
] |
u689562091 | p03141 | python | s303344496 | s928555396 | 427 | 369 | 7,504 | 7,388 | Accepted | Accepted | 13.58 | N = int(eval(input()))
l = []
sumB = 0
for i in range(N):
tmp = list(map(int, input().split()))
l.append(tmp[0] + tmp[1])
sumB += tmp[1]
l.sort(reverse=True)
A = 0
for i in range(N):
if i % 2 ==0:
A += l[i]
print((A - sumB)) | N = int(eval(input()))
l = []
sumB = 0
for i in range(N):
a, b = list(map(int, input().split()))
l.append(a + b)
sumB += b
l.sort(reverse=True)
A = 0
for i in range(0, N, 2):
A += l[i]
print((A - sumB)) | 13 | 12 | 252 | 219 | N = int(eval(input()))
l = []
sumB = 0
for i in range(N):
tmp = list(map(int, input().split()))
l.append(tmp[0] + tmp[1])
sumB += tmp[1]
l.sort(reverse=True)
A = 0
for i in range(N):
if i % 2 == 0:
A += l[i]
print((A - sumB))
| N = int(eval(input()))
l = []
sumB = 0
for i in range(N):
a, b = list(map(int, input().split()))
l.append(a + b)
sumB += b
l.sort(reverse=True)
A = 0
for i in range(0, N, 2):
A += l[i]
print((A - sumB))
| false | 7.692308 | [
"- tmp = list(map(int, input().split()))",
"- l.append(tmp[0] + tmp[1])",
"- sumB += tmp[1]",
"+ a, b = list(map(int, input().split()))",
"+ l.append(a + b)",
"+ sumB += b",
"-for i in range(N):",
"- if i % 2 == 0:",
"- A += l[i]",
"+for i in range(0, N, 2):",
"+ A... | false | 0.08048 | 0.043249 | 1.86086 | [
"s303344496",
"s928555396"
] |
u028973125 | p03786 | python | s224356189 | s610489910 | 240 | 98 | 63,856 | 20,084 | Accepted | Accepted | 59.17 | import sys
N = int(sys.stdin.readline().strip())
A = list(map(int, sys.stdin.readline().strip().split()))
A.sort()
acum = 0
ans = 0
for i in range(N-1):
acum += A[i]
if acum * 2 >= A[i+1]:
ans += 1
else:
ans = 0
print((ans+1)) | import sys
input = sys.stdin.readline
N = int(eval(input()))
A = list(map(int, input().split()))
A.sort()
# print(A)
ans = 0
acum = 0
for i in range(N-1):
acum += A[i]
if acum * 2 < A[i+1]:
ans = 0
else:
ans += 1
print((ans + 1)) | 17 | 20 | 272 | 273 | import sys
N = int(sys.stdin.readline().strip())
A = list(map(int, sys.stdin.readline().strip().split()))
A.sort()
acum = 0
ans = 0
for i in range(N - 1):
acum += A[i]
if acum * 2 >= A[i + 1]:
ans += 1
else:
ans = 0
print((ans + 1))
| import sys
input = sys.stdin.readline
N = int(eval(input()))
A = list(map(int, input().split()))
A.sort()
# print(A)
ans = 0
acum = 0
for i in range(N - 1):
acum += A[i]
if acum * 2 < A[i + 1]:
ans = 0
else:
ans += 1
print((ans + 1))
| false | 15 | [
"-N = int(sys.stdin.readline().strip())",
"-A = list(map(int, sys.stdin.readline().strip().split()))",
"+input = sys.stdin.readline",
"+N = int(eval(input()))",
"+A = list(map(int, input().split()))",
"+# print(A)",
"+ans = 0",
"-ans = 0",
"- if acum * 2 >= A[i + 1]:",
"+ if acum * 2 < A[i +... | false | 0.044723 | 0.065217 | 0.685747 | [
"s224356189",
"s610489910"
] |
u191874006 | p03853 | python | s893035130 | s887684835 | 42 | 18 | 4,608 | 3,060 | Accepted | Accepted | 57.14 | #!/usr/bin/env python3
H,W = map(int,input().split())
C = [list(input()) if i%2 == 0 else [0 for j in range(W)] for i in range(2*H)]
#print(C)
for i in range(2*H):
if i % 2 == 1:
for j in range(W):
C[i][j] = C[i-1][j]
#print(C)
for i in range(2*H):
for j in range(W):
if ... | #!/usr/bin/env python3
h,w = list(map(int,input().split()))
c = [list(eval(input())) if i % 2 == 0 else [] for i in range(2*h)]
for i in range(h):
c[2*i+1] = c[2*i]
for i in range(2*h):
print((''.join(c[i])))
| 16 | 9 | 407 | 213 | #!/usr/bin/env python3
H, W = map(int, input().split())
C = [list(input()) if i % 2 == 0 else [0 for j in range(W)] for i in range(2 * H)]
# print(C)
for i in range(2 * H):
if i % 2 == 1:
for j in range(W):
C[i][j] = C[i - 1][j]
# print(C)
for i in range(2 * H):
for j in range(W):
if... | #!/usr/bin/env python3
h, w = list(map(int, input().split()))
c = [list(eval(input())) if i % 2 == 0 else [] for i in range(2 * h)]
for i in range(h):
c[2 * i + 1] = c[2 * i]
for i in range(2 * h):
print(("".join(c[i])))
| false | 43.75 | [
"-H, W = map(int, input().split())",
"-C = [list(input()) if i % 2 == 0 else [0 for j in range(W)] for i in range(2 * H)]",
"-# print(C)",
"-for i in range(2 * H):",
"- if i % 2 == 1:",
"- for j in range(W):",
"- C[i][j] = C[i - 1][j]",
"-# print(C)",
"-for i in range(2 * H):",
... | false | 0.062978 | 0.092695 | 0.67941 | [
"s893035130",
"s887684835"
] |
u402629484 | p02792 | python | s772694785 | s422055885 | 243 | 148 | 5,972 | 5,296 | Accepted | Accepted | 39.09 | import sys
sys.setrecursionlimit(1000000000)
import math
from fractions import gcd
from itertools import count, permutations
from functools import lru_cache
from collections import deque, defaultdict
from pprint import pprint
ii = lambda: int(eval(input()))
mis = lambda: list(map(int, input().split()))
lmis =... | import sys
sys.setrecursionlimit(1000000000)
import math
from fractions import gcd
from itertools import count, permutations
from functools import lru_cache
from collections import deque, defaultdict
from pprint import pprint
ii = lambda: int(eval(input()))
mis = lambda: list(map(int, input().split()))
lmis =... | 41 | 34 | 862 | 812 | import sys
sys.setrecursionlimit(1000000000)
import math
from fractions import gcd
from itertools import count, permutations
from functools import lru_cache
from collections import deque, defaultdict
from pprint import pprint
ii = lambda: int(eval(input()))
mis = lambda: list(map(int, input().split()))
lmis = lambda:... | import sys
sys.setrecursionlimit(1000000000)
import math
from fractions import gcd
from itertools import count, permutations
from functools import lru_cache
from collections import deque, defaultdict
from pprint import pprint
ii = lambda: int(eval(input()))
mis = lambda: list(map(int, input().split()))
lmis = lambda:... | false | 17.073171 | [
"- for i in range(1, N + 1):",
"+ for i in map(str, list(range(1, N + 1))):",
"- if a != 0 != b:",
"- d[(a, b)] += 1",
"- ans = 0",
"- for i in range(1, N + 1):",
"- i = str(i)",
"- a, b = i[0], i[-1]",
"- ans += d[(b, a)]",
"- print(ans)",
"... | false | 0.050127 | 0.044577 | 1.124494 | [
"s772694785",
"s422055885"
] |
u585482323 | p03660 | python | s142515199 | s791532464 | 922 | 402 | 71,980 | 63,132 | Accepted | Accepted | 56.4 | #!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import queue
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return l... | #!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import queue
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return l... | 117 | 117 | 1,809 | 1,791 | #!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import queue
def LI():
return list(map(int, sys.stdin.readline().split()))
def I():
return int(sys.stdin.readline())
def LS():
... | #!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import queue
def LI():
return list(map(int, sys.stdin.readline().split()))
def I():
return int(sys.stdin.readline())
def LS():
... | false | 0 | [
"-q = queue.Queue()",
"-q.put(0)",
"+q = deque()",
"+q.append(0)",
"-while not q.empty():",
"- x = q.get()",
"+while q:",
"+ x = q.pop()",
"- q.put(y)",
"+ q.append(y)",
"-q.put(n - 1)",
"+q.append(n - 1)",
"-while not q.empty():",
"- x = q.get()",
"+while ... | false | 0.044077 | 0.109449 | 0.40272 | [
"s142515199",
"s791532464"
] |
u645250356 | p03963 | python | s840812521 | s682665681 | 182 | 53 | 38,636 | 5,632 | Accepted | Accepted | 70.88 | from collections import Counter,defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())
de... | from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,fractions
from decimal import Decimal
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin... | 17 | 18 | 511 | 465 | from collections import Counter, defaultdict, deque
import sys, heapq, bisect, math, itertools, string, queue
sys.setrecursionlimit(10**8)
mod = 10**9 + 7
def inp():
return int(sys.stdin.readline())
def inpl():
return list(map(int, sys.stdin.readline().split()))
def inpl_str():
return list(sys.stdin.... | from collections import Counter, defaultdict, deque
from heapq import heappop, heappush, heapify
import sys, bisect, math, itertools, fractions
from decimal import Decimal
sys.setrecursionlimit(10**8)
mod = 10**9 + 7
INF = float("inf")
def inp():
return int(sys.stdin.readline())
def inpl():
return list(map... | false | 5.555556 | [
"-import sys, heapq, bisect, math, itertools, string, queue",
"+from heapq import heappop, heappush, heapify",
"+import sys, bisect, math, itertools, fractions",
"+from decimal import Decimal",
"+INF = float(\"inf\")",
"-def inpl_str():",
"- return list(sys.stdin.readline().split())",
"-",
"-",
... | false | 0.036743 | 0.036422 | 1.008806 | [
"s840812521",
"s682665681"
] |
u761320129 | p03286 | python | s355928855 | s329267575 | 19 | 17 | 3,060 | 3,060 | Accepted | Accepted | 10.53 | N = int(eval(input()))
if N == 0:
print((0))
exit()
ans = ''
while N != 0:
if N%2:
N -= 1
ans += '1'
else:
ans += '0'
N //= -2
print((ans[::-1])) | N = int(eval(input()))
if N == 0:
print((0))
exit()
ans = ''
while N:
if N%2:
N -= 1
ans += '1'
else:
ans += '0'
N //= -2
print((ans[::-1])) | 14 | 16 | 193 | 192 | N = int(eval(input()))
if N == 0:
print((0))
exit()
ans = ""
while N != 0:
if N % 2:
N -= 1
ans += "1"
else:
ans += "0"
N //= -2
print((ans[::-1]))
| N = int(eval(input()))
if N == 0:
print((0))
exit()
ans = ""
while N:
if N % 2:
N -= 1
ans += "1"
else:
ans += "0"
N //= -2
print((ans[::-1]))
| false | 12.5 | [
"-while N != 0:",
"+while N:"
] | false | 0.045518 | 0.046775 | 0.973125 | [
"s355928855",
"s329267575"
] |
u172147273 | p02683 | python | s826713246 | s569337407 | 88 | 81 | 68,764 | 68,892 | Accepted | Accepted | 7.95 | def ip():return list(map(int,input().split()))
n,m,x=map(int,input().split())
c=[]
a=[]
for i in range(n):
temp=ip()
c.append(temp[0])
a.append(temp[1:])
ans=12*10**5+1
for i in range(1,2**n):
f=bin(i)[2:]
sum=[0]*m
while len(f)<n:f='0'+f
s=0
for j in range(n):
... | def ip():return list(map(int,input().split()))
n,m,x=map(int,input().split())
c=[]
a=[]
for i in range(n):
temp=ip()
c.append(temp[0])
a.append(temp[1:])
ans=12*10**5+1
for i in range(1,2**n):
f=bin(i)[2:]
sum=[0]*m
while len(f)<n:f='0'+f
s=0
for j in range(n):
... | 32 | 29 | 575 | 514 | def ip():
return list(map(int, input().split()))
n, m, x = map(int, input().split())
c = []
a = []
for i in range(n):
temp = ip()
c.append(temp[0])
a.append(temp[1:])
ans = 12 * 10**5 + 1
for i in range(1, 2**n):
f = bin(i)[2:]
sum = [0] * m
while len(f) < n:
f = "0" + f
s = 0
... | def ip():
return list(map(int, input().split()))
n, m, x = map(int, input().split())
c = []
a = []
for i in range(n):
temp = ip()
c.append(temp[0])
a.append(temp[1:])
ans = 12 * 10**5 + 1
for i in range(1, 2**n):
f = bin(i)[2:]
sum = [0] * m
while len(f) < n:
f = "0" + f
s = 0
... | false | 9.375 | [
"- F = True",
"- for h in range(m):",
"- if sum[h] < x:",
"- F = False",
"- if F == True:",
"+ if min(sum) >= x:"
] | false | 0.047512 | 0.045373 | 1.047138 | [
"s826713246",
"s569337407"
] |
u996672406 | p03069 | python | s684501967 | s961470465 | 114 | 95 | 4,840 | 3,500 | Accepted | Accepted | 16.67 | n = int(eval(input()))
s = list(eval(input()))
rd = 0
for e in s:
if e == ".":
rd += 1
res = rd
for e in s:
if e == ".":
rd -= 1
else:
rd += 1
res = min(res, rd)
print(res)
| n = int(eval(input()))
minv = res = rd = 0
for e in eval(input()):
if e == ".":
res += 1
rd -= 1
minv = min(minv, rd)
else:
rd += 1
print((res + minv))
| 17 | 12 | 220 | 191 | n = int(eval(input()))
s = list(eval(input()))
rd = 0
for e in s:
if e == ".":
rd += 1
res = rd
for e in s:
if e == ".":
rd -= 1
else:
rd += 1
res = min(res, rd)
print(res)
| n = int(eval(input()))
minv = res = rd = 0
for e in eval(input()):
if e == ".":
res += 1
rd -= 1
minv = min(minv, rd)
else:
rd += 1
print((res + minv))
| false | 29.411765 | [
"-s = list(eval(input()))",
"-rd = 0",
"-for e in s:",
"+minv = res = rd = 0",
"+for e in eval(input()):",
"- rd += 1",
"-res = rd",
"-for e in s:",
"- if e == \".\":",
"+ res += 1",
"+ minv = min(minv, rd)",
"- res = min(res, rd)",
"-print(res)",
"+print((res + ... | false | 0.114469 | 0.049895 | 2.29419 | [
"s684501967",
"s961470465"
] |
u102461423 | p02992 | python | s901601367 | s358216243 | 493 | 338 | 22,636 | 13,904 | Accepted | Accepted | 31.44 | import numpy as np
N,K = list(map(int,input().split()))
MOD = 10 ** 9 + 7
M = int(N**.5)
# M+1以上で、商がぢょうとxになるやつ
upper_cnt = np.zeros(M+1, dtype=np.int64)
a = np.arange(M+1, dtype=np.int64)
upper_cnt[1:] = N // a[1:] - np.maximum(M, N // (a[1:]+1))
# 数列の末端ごとの個数
# upperについては、個数にわたって合計をとる
lower = np.zeros(M+1... | import numpy as np
N,K = list(map(int,input().split()))
MOD = 10 ** 9 + 7
M = int(N**.5)
# M+1以上で、商がぢょうとxになるやつ
upper_cnt = np.zeros(M+1, dtype=np.int64)
a = np.arange(M+1, dtype=np.int64)
upper_cnt[1:] = N // a[1:] - np.maximum(M, N // (a[1:]+1))
# 数列の末端ごとの個数
# upperについては、個数にわたって合計をとる
lower = np.zeros(M+1... | 34 | 36 | 908 | 963 | import numpy as np
N, K = list(map(int, input().split()))
MOD = 10**9 + 7
M = int(N**0.5)
# M+1以上で、商がぢょうとxになるやつ
upper_cnt = np.zeros(M + 1, dtype=np.int64)
a = np.arange(M + 1, dtype=np.int64)
upper_cnt[1:] = N // a[1:] - np.maximum(M, N // (a[1:] + 1))
# 数列の末端ごとの個数
# upperについては、個数にわたって合計をとる
lower = np.zeros(M + 1, dt... | import numpy as np
N, K = list(map(int, input().split()))
MOD = 10**9 + 7
M = int(N**0.5)
# M+1以上で、商がぢょうとxになるやつ
upper_cnt = np.zeros(M + 1, dtype=np.int64)
a = np.arange(M + 1, dtype=np.int64)
upper_cnt[1:] = N // a[1:] - np.maximum(M, N // (a[1:] + 1))
# 数列の末端ごとの個数
# upperについては、個数にわたって合計をとる
lower = np.zeros(M + 1, dt... | false | 5.555556 | [
"- cum_lower = prev_lower.cumsum() % MOD",
"- cum_upper = prev_upper.cumsum() % MOD",
"+ np.cumsum(prev_lower, out=prev_lower)",
"+ np.cumsum(prev_upper, out=prev_upper)",
"+ prev_lower %= MOD",
"+ prev_upper %= MOD",
"- lower += cum_lower[-1] + cum_upper[-1]",
"- lower[1:] -= ... | false | 0.426197 | 0.52874 | 0.806062 | [
"s901601367",
"s358216243"
] |
u602740328 | p03673 | python | s881162838 | s623714111 | 157 | 74 | 34,704 | 27,716 | Accepted | Accepted | 52.87 | n=int(eval(input()))
a=list(map(int,input().split()))
b1=[str(a[2*i]) for i in range(0,n//2)]
b2=[str(a[2*i+1]) for i in range(0,n//2)]
if n%2: b=[str(a[-1])]+list(reversed(b1))+b2
else: b=list(reversed(b2))+b1
print((" ".join(b))) | n=int(eval(input()))
a=input().split()
b1=[a[2*i] for i in range(0,n//2)]
b2=[a[2*i+1] for i in range(0,n//2)]
if n%2: b=[a[-1]]+list(reversed(b1))+b2
else: b=list(reversed(b2))+b1
print((" ".join(b))) | 7 | 7 | 229 | 199 | n = int(eval(input()))
a = list(map(int, input().split()))
b1 = [str(a[2 * i]) for i in range(0, n // 2)]
b2 = [str(a[2 * i + 1]) for i in range(0, n // 2)]
if n % 2:
b = [str(a[-1])] + list(reversed(b1)) + b2
else:
b = list(reversed(b2)) + b1
print((" ".join(b)))
| n = int(eval(input()))
a = input().split()
b1 = [a[2 * i] for i in range(0, n // 2)]
b2 = [a[2 * i + 1] for i in range(0, n // 2)]
if n % 2:
b = [a[-1]] + list(reversed(b1)) + b2
else:
b = list(reversed(b2)) + b1
print((" ".join(b)))
| false | 0 | [
"-a = list(map(int, input().split()))",
"-b1 = [str(a[2 * i]) for i in range(0, n // 2)]",
"-b2 = [str(a[2 * i + 1]) for i in range(0, n // 2)]",
"+a = input().split()",
"+b1 = [a[2 * i] for i in range(0, n // 2)]",
"+b2 = [a[2 * i + 1] for i in range(0, n // 2)]",
"- b = [str(a[-1])] + list(reversed... | false | 0.040503 | 0.043274 | 0.935963 | [
"s881162838",
"s623714111"
] |
u083960235 | p03274 | python | s561735751 | s907374021 | 124 | 97 | 16,364 | 15,012 | Accepted | Accepted | 21.77 | import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii... | import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii... | 45 | 36 | 1,116 | 1,059 | import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_upper... | import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_upper... | false | 20 | [
"-from fractions import gcd",
"+from heapq import heapify, heappop, heappush",
"-# dist = 0",
"-s = []",
"-l = []",
"-s = deque(s)",
"-l = deque(l)",
"-for x in X:",
"- if x < 0:",
"- s.appendleft(-1 * x)",
"- else:",
"- l.append(x)",
"-# s.sort()",
"-# print(s, l)",
... | false | 0.038065 | 0.085351 | 0.445984 | [
"s561735751",
"s907374021"
] |
u600402037 | p02923 | python | s143984598 | s891471352 | 209 | 184 | 23,388 | 23,384 | Accepted | Accepted | 11.96 | import numpy as np
N = int(eval(input()))
H = np.array(list(map(int, input().split())))
answer = 0
L1 = (H[:-1] >= H[1:])
#print(L1)
answer = 0
count = 0
for l in L1:
if l:
count += 1
else:
answer = max(answer, count)
count = 0
print((max(answer, count))) | import sys
import numpy as np
sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
N = ir()
H = np.array([-10] + lr() + [10**10])
x = H[1:] <= H[:-1]
temp = np.arange(len(x))
temp[x>0] = 0
np.maximum.accumulate(temp, out=temp)
left = temp
x_revers... | 21 | 25 | 305 | 531 | import numpy as np
N = int(eval(input()))
H = np.array(list(map(int, input().split())))
answer = 0
L1 = H[:-1] >= H[1:]
# print(L1)
answer = 0
count = 0
for l in L1:
if l:
count += 1
else:
answer = max(answer, count)
count = 0
print((max(answer, count)))
| import sys
import numpy as np
sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
N = ir()
H = np.array([-10] + lr() + [10**10])
x = H[1:] <= H[:-1]
temp = np.arange(len(x))
temp[x > 0] = 0
np.maximum.accumulate(temp, out=temp)
left = temp
x_reversed = x[::-1]
te... | false | 16 | [
"+import sys",
"-N = int(eval(input()))",
"-H = np.array(list(map(int, input().split())))",
"-answer = 0",
"-L1 = H[:-1] >= H[1:]",
"-# print(L1)",
"-answer = 0",
"-count = 0",
"-for l in L1:",
"- if l:",
"- count += 1",
"- else:",
"- answer = max(answer, count)",
"- ... | false | 0.226828 | 0.444459 | 0.510347 | [
"s143984598",
"s891471352"
] |
u644907318 | p03525 | python | s588407729 | s067509065 | 174 | 65 | 38,896 | 64,576 | Accepted | Accepted | 62.64 | N = int(eval(input()))
D = sorted(list(map(int,input().split())))
for i in range(0,N,2):
D[i] = 24-D[i]
D.insert(0,0)
dmin = 24
for i in range(N):
for j in range(i+1,N+1):
a = D[i]
b = D[j]
if a>b:
a,b = b,a
d = b-a
if d>12:
d = 24-d
... | N = int(eval(input()))
D = list(map(int,input().split()))
s = min(D)
if 12 in D:
for i in range(N):
if D[i]!=12:
s = min(s,12-D[i])
D.remove(12)
D = sorted(D)
E = []
for i in range(len(D)):
if i%2==0:
E.append(D[i])
else:
E.append(24-D[i])
for i in rang... | 17 | 24 | 354 | 489 | N = int(eval(input()))
D = sorted(list(map(int, input().split())))
for i in range(0, N, 2):
D[i] = 24 - D[i]
D.insert(0, 0)
dmin = 24
for i in range(N):
for j in range(i + 1, N + 1):
a = D[i]
b = D[j]
if a > b:
a, b = b, a
d = b - a
if d > 12:
d = ... | N = int(eval(input()))
D = list(map(int, input().split()))
s = min(D)
if 12 in D:
for i in range(N):
if D[i] != 12:
s = min(s, 12 - D[i])
D.remove(12)
D = sorted(D)
E = []
for i in range(len(D)):
if i % 2 == 0:
E.append(D[i])
else:
E.append(24 - D[i])
for i in range(l... | false | 29.166667 | [
"-D = sorted(list(map(int, input().split())))",
"-for i in range(0, N, 2):",
"- D[i] = 24 - D[i]",
"-D.insert(0, 0)",
"-dmin = 24",
"-for i in range(N):",
"- for j in range(i + 1, N + 1):",
"- a = D[i]",
"- b = D[j]",
"- if a > b:",
"- a, b = b, a",
"- ... | false | 0.037522 | 0.037718 | 0.994815 | [
"s588407729",
"s067509065"
] |
u704284486 | p03476 | python | s754971391 | s474101280 | 955 | 881 | 5,324 | 6,432 | Accepted | Accepted | 7.75 | def sieve(N):#エラトステネスの篩
prime = [0]*(N+1)
isprime = [True]*(N+1)
isprime[0]=isprime[1] = False
num = 0
for p in range(2,N+1):
if isprime[p]:
prime[num] = p
num += 1
for j in range(2*p,N+1,p):
isprime[j] = False
return prime
... | def sieve(N):#エラトステネスの篩
prime = [0]*(N+1)
isprime = [True]*(N+1)
isprime[0]=isprime[1] = False
num = 0
for p in range(2,N+1):
if isprime[p]:
prime[num] = p
num += 1
for j in range(2*p,N+1,p):
isprime[j] = False
return prime
... | 31 | 34 | 765 | 769 | def sieve(N): # エラトステネスの篩
prime = [0] * (N + 1)
isprime = [True] * (N + 1)
isprime[0] = isprime[1] = False
num = 0
for p in range(2, N + 1):
if isprime[p]:
prime[num] = p
num += 1
for j in range(2 * p, N + 1, p):
isprime[j] = False
ret... | def sieve(N): # エラトステネスの篩
prime = [0] * (N + 1)
isprime = [True] * (N + 1)
isprime[0] = isprime[1] = False
num = 0
for p in range(2, N + 1):
if isprime[p]:
prime[num] = p
num += 1
for j in range(2 * p, N + 1, p):
isprime[j] = False
ret... | false | 8.823529 | [
"-from bisect import bisect_left as bl",
"-from bisect import bisect_right as br",
"-",
"-lis = sorted(tuple(lis))",
"+c = [0] * (10**5 + 1)",
"+for i in range(10**5):",
"+ if i + 1 in lis:",
"+ c[i + 1] = c[i] + 1",
"+ else:",
"+ c[i + 1] = c[i]",
"+c = tuple(c)",
"- t ... | false | 0.127861 | 0.202055 | 0.632801 | [
"s754971391",
"s474101280"
] |
u716530146 | p02971 | python | s375367929 | s875828480 | 432 | 209 | 26,628 | 26,620 | Accepted | Accepted | 51.62 | n = int(eval(input()))
data = [int(eval(input())) for k in range(n)]
m1,m2 = sorted(data, reverse=1)[:2]
b = [m2 if x==m1 else m1 for x in data]
print(('\n'.join(map(str,b)))) | import sys
input = sys.stdin.readline
n = int(eval(input()))
data = [int(eval(input())) for k in range(n)]
m1,m2 = sorted(data, reverse=1)[:2]
b = [m2 if x==m1 else m1 for x in data]
print(('\n'.join(map(str,b)))) | 5 | 8 | 165 | 207 | n = int(eval(input()))
data = [int(eval(input())) for k in range(n)]
m1, m2 = sorted(data, reverse=1)[:2]
b = [m2 if x == m1 else m1 for x in data]
print(("\n".join(map(str, b))))
| import sys
input = sys.stdin.readline
n = int(eval(input()))
data = [int(eval(input())) for k in range(n)]
m1, m2 = sorted(data, reverse=1)[:2]
b = [m2 if x == m1 else m1 for x in data]
print(("\n".join(map(str, b))))
| false | 37.5 | [
"+import sys",
"+",
"+input = sys.stdin.readline"
] | false | 0.039621 | 0.106448 | 0.372212 | [
"s375367929",
"s875828480"
] |
u917558625 | p02862 | python | s418697524 | s001062550 | 1,380 | 1,231 | 122,048 | 44,024 | Accepted | Accepted | 10.8 | X,Y=list(map(int,input().split()))
def cmb(n, r, mod):
if ( r<0 or r>n ):
return 0
r = min(r, n-r)
return g1[n] * g2[r] * g2[n-r] % mod
mod = 10**9+7
N = 10**6
g1 = [1, 1]
g2 = [1, 1]
inverse = [0, 1]
for i in range( 2, N + 1 ):
g1.append( ( g1[-1] * i ) % mod )
inverse.append( ... | X,Y=list(map(int,input().split()))
def cmb(n, r):
if n - r < r: r = n - r
if r == 0: return 1
if r == 1: return n
numerator = [n - r + k + 1 for k in range(r)]
denominator = [k + 1 for k in range(r)]
for p in range(2,r+1):
pivot = denominator[p - 1]
if pivot > 1:
... | 26 | 31 | 558 | 769 | X, Y = list(map(int, input().split()))
def cmb(n, r, mod):
if r < 0 or r > n:
return 0
r = min(r, n - r)
return g1[n] * g2[r] * g2[n - r] % mod
mod = 10**9 + 7
N = 10**6
g1 = [1, 1]
g2 = [1, 1]
inverse = [0, 1]
for i in range(2, N + 1):
g1.append((g1[-1] * i) % mod)
inverse.append((-inve... | X, Y = list(map(int, input().split()))
def cmb(n, r):
if n - r < r:
r = n - r
if r == 0:
return 1
if r == 1:
return n
numerator = [n - r + k + 1 for k in range(r)]
denominator = [k + 1 for k in range(r)]
for p in range(2, r + 1):
pivot = denominator[p - 1]
... | false | 16.129032 | [
"-def cmb(n, r, mod):",
"- if r < 0 or r > n:",
"- return 0",
"- r = min(r, n - r)",
"- return g1[n] * g2[r] * g2[n - r] % mod",
"+def cmb(n, r):",
"+ if n - r < r:",
"+ r = n - r",
"+ if r == 0:",
"+ return 1",
"+ if r == 1:",
"+ return n",
"+ ... | false | 1.553039 | 0.21826 | 7.115559 | [
"s418697524",
"s001062550"
] |
u597374218 | p02953 | python | s619544909 | s310523508 | 82 | 72 | 15,020 | 14,396 | Accepted | Accepted | 12.2 | N=int(eval(input()))
H=list(map(int,input().split()))[::-1]
flag=True
base=H[0]
for i in range(N-1):
if H[i]+1==H[i+1]:
H[i+1]-=1
elif H[i]>=H[i+1]:
continue
else:
flag=False
print(("Yes" if flag else "No")) | N=int(eval(input()))
H=list(map(int,input().split()))
base=0
for h in H:
if base>h:
print("No")
break
base=max(base,h-1)
else:
print("Yes") | 12 | 10 | 246 | 170 | N = int(eval(input()))
H = list(map(int, input().split()))[::-1]
flag = True
base = H[0]
for i in range(N - 1):
if H[i] + 1 == H[i + 1]:
H[i + 1] -= 1
elif H[i] >= H[i + 1]:
continue
else:
flag = False
print(("Yes" if flag else "No"))
| N = int(eval(input()))
H = list(map(int, input().split()))
base = 0
for h in H:
if base > h:
print("No")
break
base = max(base, h - 1)
else:
print("Yes")
| false | 16.666667 | [
"-H = list(map(int, input().split()))[::-1]",
"-flag = True",
"-base = H[0]",
"-for i in range(N - 1):",
"- if H[i] + 1 == H[i + 1]:",
"- H[i + 1] -= 1",
"- elif H[i] >= H[i + 1]:",
"- continue",
"- else:",
"- flag = False",
"-print((\"Yes\" if flag else \"No\"))",
... | false | 0.03594 | 0.035764 | 1.004912 | [
"s619544909",
"s310523508"
] |
u804180276 | p02717 | python | s962079431 | s050456969 | 23 | 20 | 9,008 | 9,000 | Accepted | Accepted | 13.04 | # [箱A, 箱B, 箱C]
list = input().split()
# 箱Aと箱B入れ替え
temp = list[0]
list[0] = list[1]
list[1] = temp
# 箱Aと箱C入れ替え
temp = list[0]
list[0] = list[2]
list[2] = temp
print((' '.join(list))) | # [箱A, 箱B, 箱C]
list = input().split()
# 箱Aと箱B入れ替え
list[0], list[1] = list[1], list[0]
# 箱Aと箱C入れ替え
list[0], list[2] = list[2], list[0]
print((' '.join(list))) | 14 | 10 | 223 | 187 | # [箱A, 箱B, 箱C]
list = input().split()
# 箱Aと箱B入れ替え
temp = list[0]
list[0] = list[1]
list[1] = temp
# 箱Aと箱C入れ替え
temp = list[0]
list[0] = list[2]
list[2] = temp
print((" ".join(list)))
| # [箱A, 箱B, 箱C]
list = input().split()
# 箱Aと箱B入れ替え
list[0], list[1] = list[1], list[0]
# 箱Aと箱C入れ替え
list[0], list[2] = list[2], list[0]
print((" ".join(list)))
| false | 28.571429 | [
"-temp = list[0]",
"-list[0] = list[1]",
"-list[1] = temp",
"+list[0], list[1] = list[1], list[0]",
"-temp = list[0]",
"-list[0] = list[2]",
"-list[2] = temp",
"+list[0], list[2] = list[2], list[0]"
] | false | 0.035964 | 0.04694 | 0.766183 | [
"s962079431",
"s050456969"
] |
u796942881 | p02935 | python | s337268086 | s285693285 | 22 | 17 | 3,572 | 2,940 | Accepted | Accepted | 22.73 | from functools import reduce
def main():
eval(input())
v = sorted(map(int, input().split()))
print((reduce(lambda x, y: (x + y) * 0.5, v)))
main()
| def main():
eval(input())
v = sorted(map(int, input().split()))
ans = v[0]
for i in v[1:]:
ans = (ans + i) * 0.5
print(ans)
return
main()
| 10 | 11 | 164 | 176 | from functools import reduce
def main():
eval(input())
v = sorted(map(int, input().split()))
print((reduce(lambda x, y: (x + y) * 0.5, v)))
main()
| def main():
eval(input())
v = sorted(map(int, input().split()))
ans = v[0]
for i in v[1:]:
ans = (ans + i) * 0.5
print(ans)
return
main()
| false | 9.090909 | [
"-from functools import reduce",
"-",
"-",
"- print((reduce(lambda x, y: (x + y) * 0.5, v)))",
"+ ans = v[0]",
"+ for i in v[1:]:",
"+ ans = (ans + i) * 0.5",
"+ print(ans)",
"+ return"
] | false | 0.039662 | 0.038513 | 1.029825 | [
"s337268086",
"s285693285"
] |
u270681687 | p02863 | python | s820158978 | s041612923 | 1,321 | 650 | 394,756 | 124,504 | Accepted | Accepted | 50.79 | n, t = list(map(int, input().split()))
ab = [list(map(int, input().split())) for _ in range(n)]
ab.sort()
a = []
b = []
for ai, bi in ab:
a.append(ai)
b.append(bi)
dp = [[0 for j in range(t+1)] for i in range(n+1)]
prev = [[(0, 0) for j in range(t+1)] for i in range(n+1)]
for i in range(n):
... | n, t = list(map(int, input().split()))
ab = [list(map(int, input().split())) for _ in range(n)]
ab.sort()
a = []
b = []
for ai, bi in ab:
a.append(ai)
b.append(bi)
dp = [[0 for j in range(t+1)] for i in range(n+1)]
for i in range(n):
for j in range(t):
if j + a[i] <= t-1:
... | 51 | 31 | 990 | 576 | n, t = list(map(int, input().split()))
ab = [list(map(int, input().split())) for _ in range(n)]
ab.sort()
a = []
b = []
for ai, bi in ab:
a.append(ai)
b.append(bi)
dp = [[0 for j in range(t + 1)] for i in range(n + 1)]
prev = [[(0, 0) for j in range(t + 1)] for i in range(n + 1)]
for i in range(n):
for j in... | n, t = list(map(int, input().split()))
ab = [list(map(int, input().split())) for _ in range(n)]
ab.sort()
a = []
b = []
for ai, bi in ab:
a.append(ai)
b.append(bi)
dp = [[0 for j in range(t + 1)] for i in range(n + 1)]
for i in range(n):
for j in range(t):
if j + a[i] <= t - 1:
if dp[i +... | false | 39.215686 | [
"-prev = [[(0, 0) for j in range(t + 1)] for i in range(n + 1)]",
"- prev[i + 1][j + a[i]] = (i, j)",
"- prev[i + 1][j] = (i, j)",
"-happy = dp[n][t - 1]",
"-i = n",
"-j = t - 1",
"-used = set([])",
"-while i > 0 or j > 0:",
"- pi, pj = prev[i][j]",
"- if dp[pi][pj]... | false | 0.083226 | 0.045966 | 1.810577 | [
"s820158978",
"s041612923"
] |
u800058906 | p02899 | python | s002250307 | s373668453 | 140 | 86 | 37,984 | 20,896 | Accepted | Accepted | 38.57 | n=int(eval(input()))
a=list(map(int,input().split()))
num=[i for i in range(1,n+1)]
order=dict(list(zip(num,a)))
order2=sorted(list(order.items()),key=lambda x:x[1])
ans=[]
for i in range(n):
ans.append(order2[i][0])
print((' '.join([str(n) for n in ans]))) | n=int(eval(input()))
a=list(map(int,input().split()))
ans=['-']*n
for i in range(n):
ans[a[i]-1]=str(i+1)
print((' '.join(ans))) | 15 | 8 | 259 | 133 | n = int(eval(input()))
a = list(map(int, input().split()))
num = [i for i in range(1, n + 1)]
order = dict(list(zip(num, a)))
order2 = sorted(list(order.items()), key=lambda x: x[1])
ans = []
for i in range(n):
ans.append(order2[i][0])
print((" ".join([str(n) for n in ans])))
| n = int(eval(input()))
a = list(map(int, input().split()))
ans = ["-"] * n
for i in range(n):
ans[a[i] - 1] = str(i + 1)
print((" ".join(ans)))
| false | 46.666667 | [
"-num = [i for i in range(1, n + 1)]",
"-order = dict(list(zip(num, a)))",
"-order2 = sorted(list(order.items()), key=lambda x: x[1])",
"-ans = []",
"+ans = [\"-\"] * n",
"- ans.append(order2[i][0])",
"-print((\" \".join([str(n) for n in ans])))",
"+ ans[a[i] - 1] = str(i + 1)",
"+print((\" \"... | false | 0.055549 | 0.036436 | 1.524584 | [
"s002250307",
"s373668453"
] |
u814265211 | p02983 | python | s937683563 | s290136660 | 729 | 380 | 153,840 | 81,188 | Accepted | Accepted | 47.87 | L, R = [int(i) for i in input().split()]
if R - L < 2019:
print((min([(i * j) % 2019 for i in range(L, R) for j in range(L + 1, R + 1)])))
else:
print((min([(i * j) % 2019 for i in range(L, L + 2019) for j in range(L, L + 2019)])))
| L, R = list(map(int, input().split()))
R = min(R, L+2019)
print((min([i * j % 2019 for i in range(L, R+1) for j in range(i+1, R+1)])))
| 5 | 3 | 240 | 129 | L, R = [int(i) for i in input().split()]
if R - L < 2019:
print((min([(i * j) % 2019 for i in range(L, R) for j in range(L + 1, R + 1)])))
else:
print(
(min([(i * j) % 2019 for i in range(L, L + 2019) for j in range(L, L + 2019)]))
)
| L, R = list(map(int, input().split()))
R = min(R, L + 2019)
print((min([i * j % 2019 for i in range(L, R + 1) for j in range(i + 1, R + 1)])))
| false | 40 | [
"-L, R = [int(i) for i in input().split()]",
"-if R - L < 2019:",
"- print((min([(i * j) % 2019 for i in range(L, R) for j in range(L + 1, R + 1)])))",
"-else:",
"- print(",
"- (min([(i * j) % 2019 for i in range(L, L + 2019) for j in range(L, L + 2019)]))",
"- )",
"+L, R = list(map(in... | false | 0.089251 | 0.114527 | 0.779299 | [
"s937683563",
"s290136660"
] |
u077291787 | p03436 | python | s018051520 | s595430878 | 26 | 22 | 3,316 | 3,192 | Accepted | Accepted | 15.38 | # ABC088D - Grid Repainting
import sys
input = sys.stdin.readline
from collections import deque
def bfs() -> None:
q = [(0, 0)]
while q:
x, y = q.pop(0)
for dx, dy in dxy:
nx, ny = x + dx, y + dy # next x, y
if 0 <= nx < H and 0 <= ny < W and S[nx][ny] == "... | # ABC088D - Grid Repainting
import sys
input = sys.stdin.readline
def bfs() -> None:
q = [(0, 0)]
while q:
x, y = q.pop(0)
for dx, dy in dxy:
nx, ny = x + dx, y + dy # next x, y
if 0 <= nx < H and 0 <= ny < W and S[nx][ny] == "." and dist[nx][ny] == 0:
... | 32 | 30 | 876 | 843 | # ABC088D - Grid Repainting
import sys
input = sys.stdin.readline
from collections import deque
def bfs() -> None:
q = [(0, 0)]
while q:
x, y = q.pop(0)
for dx, dy in dxy:
nx, ny = x + dx, y + dy # next x, y
if 0 <= nx < H and 0 <= ny < W and S[nx][ny] == "." and dist... | # ABC088D - Grid Repainting
import sys
input = sys.stdin.readline
def bfs() -> None:
q = [(0, 0)]
while q:
x, y = q.pop(0)
for dx, dy in dxy:
nx, ny = x + dx, y + dy # next x, y
if 0 <= nx < H and 0 <= ny < W and S[nx][ny] == "." and dist[nx][ny] == 0:
... | false | 6.25 | [
"-from collections import deque"
] | false | 0.141063 | 0.068461 | 2.060491 | [
"s018051520",
"s595430878"
] |
u708255304 | p02713 | python | s560730190 | s631258914 | 810 | 180 | 83,640 | 68,468 | Accepted | Accepted | 77.78 | # コードテストする
from fractions import gcd
K = int(eval(input()))
ans = 0
gcd_list = {}
for i in range(1, K+1):
for j in range(1, K+1):
gcd_list[i, j] = gcd(i, j)
for i in range(1, K+1):
for j in range(1, K+1):
hoge = gcd_list[(i, j)]
for k in range(1, K+1):
ans += gc... | from math import gcd
K = int(eval(input()))
ans = 0
for i in range(1, K+1):
for j in range(1, K+1):
tmp = gcd(i, j)
for k in range(1, K+1):
ans += gcd(tmp, k)
print(ans)
| 15 | 9 | 344 | 204 | # コードテストする
from fractions import gcd
K = int(eval(input()))
ans = 0
gcd_list = {}
for i in range(1, K + 1):
for j in range(1, K + 1):
gcd_list[i, j] = gcd(i, j)
for i in range(1, K + 1):
for j in range(1, K + 1):
hoge = gcd_list[(i, j)]
for k in range(1, K + 1):
ans += gcd_l... | from math import gcd
K = int(eval(input()))
ans = 0
for i in range(1, K + 1):
for j in range(1, K + 1):
tmp = gcd(i, j)
for k in range(1, K + 1):
ans += gcd(tmp, k)
print(ans)
| false | 40 | [
"-# コードテストする",
"-from fractions import gcd",
"+from math import gcd",
"-gcd_list = {}",
"- gcd_list[i, j] = gcd(i, j)",
"-for i in range(1, K + 1):",
"- for j in range(1, K + 1):",
"- hoge = gcd_list[(i, j)]",
"+ tmp = gcd(i, j)",
"- ans += gcd_list[(hoge, k)]",
... | false | 0.103188 | 0.145539 | 0.709002 | [
"s560730190",
"s631258914"
] |
u609061751 | p02744 | python | s731491057 | s936294842 | 752 | 306 | 72,280 | 57,564 | Accepted | Accepted | 59.31 | import sys
input = sys.stdin.readline
n = int(eval(input()))
s = ["a"]
ord_a = ord("a")
ans = []
from copy import deepcopy
def dfs(s):
if len(s) == n:
ans.append("".join(s))
return
max_ord = 0
for i in s:
max_ord = max(max_ord, ord(i) - ord_a)
for j in range(ma... | import sys
input = sys.stdin.readline
n = int(eval(input()))
s = ["a"]
ord_a = ord("a")
ans = []
def dfs(s):
if len(s) == n:
ans.append("".join(s))
return
max_ord = 0
for i in s:
max_ord = max(max_ord, ord(i) - ord_a)
for j in range(max_ord + 2):
new_... | 32 | 32 | 522 | 490 | import sys
input = sys.stdin.readline
n = int(eval(input()))
s = ["a"]
ord_a = ord("a")
ans = []
from copy import deepcopy
def dfs(s):
if len(s) == n:
ans.append("".join(s))
return
max_ord = 0
for i in s:
max_ord = max(max_ord, ord(i) - ord_a)
for j in range(max_ord + 2):
... | import sys
input = sys.stdin.readline
n = int(eval(input()))
s = ["a"]
ord_a = ord("a")
ans = []
def dfs(s):
if len(s) == n:
ans.append("".join(s))
return
max_ord = 0
for i in s:
max_ord = max(max_ord, ord(i) - ord_a)
for j in range(max_ord + 2):
new_s = s[:]
n... | false | 0 | [
"-from copy import deepcopy",
"- new_s = deepcopy(s)",
"+ new_s = s[:]"
] | false | 0.042832 | 0.053803 | 0.796083 | [
"s731491057",
"s936294842"
] |
u638456847 | p03557 | python | s053325459 | s998077670 | 351 | 310 | 29,220 | 22,592 | Accepted | Accepted | 11.68 | from bisect import bisect_right
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
def main():
N = int(readline())
A = [int(i) for i in readline().split()]
B = [int(i) for i in readline().split()]
C = [int(i) for i in readline().split()]
A.so... | from bisect import bisect_right, bisect_left
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
def main():
N = int(readline())
A = [int(i) for i in readline().split()]
B = [int(i) for i in readline().split()]
C = [int(i) for i in readline().split()... | 38 | 25 | 740 | 521 | from bisect import bisect_right
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
def main():
N = int(readline())
A = [int(i) for i in readline().split()]
B = [int(i) for i in readline().split()]
C = [int(i) for i in readline().split()]
A.sort()
B.... | from bisect import bisect_right, bisect_left
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
def main():
N = int(readline())
A = [int(i) for i in readline().split()]
B = [int(i) for i in readline().split()]
C = [int(i) for i in readline().split()]
A.... | false | 34.210526 | [
"-from bisect import bisect_right",
"+from bisect import bisect_right, bisect_left",
"- a_ind = []",
"- b_ind = []",
"- for i in range(N):",
"- a_ind.append(bisect_right(B, A[i]))",
"- b_ind.append(N - bisect_right(C, B[i]))",
"- b_acc = [0]",
"- for b in b_ind:",
"- ... | false | 0.118813 | 0.043713 | 2.717999 | [
"s053325459",
"s998077670"
] |
u952708174 | p03695 | python | s255320619 | s176502516 | 24 | 21 | 3,316 | 3,316 | Accepted | Accepted | 12.5 | def c_ColorfulLeaderboard(N, A):
from collections import defaultdict
color = defaultdict(int)
other = 0 # レート3200以上の選手の数
for a in A:
if 1 <= a <= 399:
color['gray'] += 1
elif 400 <= a <= 799:
color['brown'] += 1
elif 800 <= a <= 1199:
... | def c_colorful_leaderboard(N, A):
from collections import defaultdict
rating_list = defaultdict(int)
rating_color = ['gray', 'brown', 'green',
'skyblue', 'blue', 'yellow', 'orange', 'red'] # AtCoderのレート色
other = 0 # レート3200以上の選手の数
for rating in A:
r = rating // 4... | 29 | 18 | 901 | 647 | def c_ColorfulLeaderboard(N, A):
from collections import defaultdict
color = defaultdict(int)
other = 0 # レート3200以上の選手の数
for a in A:
if 1 <= a <= 399:
color["gray"] += 1
elif 400 <= a <= 799:
color["brown"] += 1
elif 800 <= a <= 1199:
color["... | def c_colorful_leaderboard(N, A):
from collections import defaultdict
rating_list = defaultdict(int)
rating_color = [
"gray",
"brown",
"green",
"skyblue",
"blue",
"yellow",
"orange",
"red",
] # AtCoderのレート色
other = 0 # レート3200以上の選手の数... | false | 37.931034 | [
"-def c_ColorfulLeaderboard(N, A):",
"+def c_colorful_leaderboard(N, A):",
"- color = defaultdict(int)",
"+ rating_list = defaultdict(int)",
"+ rating_color = [",
"+ \"gray\",",
"+ \"brown\",",
"+ \"green\",",
"+ \"skyblue\",",
"+ \"blue\",",
"+ ... | false | 0.034751 | 0.034517 | 1.006794 | [
"s255320619",
"s176502516"
] |
u426534722 | p02279 | python | s207746177 | s411509829 | 790 | 700 | 47,640 | 35,608 | Accepted | Accepted | 11.39 | import sys
readline = sys.stdin.readline
class Tree:
def __init__(self):
self.id = 0
self.p = -1
self.depth = -1
self.type = "leaf"
self.len_c = 0
self.c = []
def __str__(self):
return f"node {self.id}: parent = {self.p}, depth = {self.depth}, {... | import sys
readline = sys.stdin.readline
class Tree:
__slots__ = ['id', 'p', 'depth', 'type', 'len_c', 'c']
def __init__(self):
self.id = 0
self.p = -1
self.depth = -1
self.type = "leaf"
self.len_c = 0
self.c = []
def __str__(self):
return ... | 41 | 42 | 942 | 1,002 | import sys
readline = sys.stdin.readline
class Tree:
def __init__(self):
self.id = 0
self.p = -1
self.depth = -1
self.type = "leaf"
self.len_c = 0
self.c = []
def __str__(self):
return f"node {self.id}: parent = {self.p}, depth = {self.depth}, {self.ty... | import sys
readline = sys.stdin.readline
class Tree:
__slots__ = ["id", "p", "depth", "type", "len_c", "c"]
def __init__(self):
self.id = 0
self.p = -1
self.depth = -1
self.type = "leaf"
self.len_c = 0
self.c = []
def __str__(self):
return f"node ... | false | 2.380952 | [
"+ __slots__ = [\"id\", \"p\", \"depth\", \"type\", \"len_c\", \"c\"]",
"+"
] | false | 0.046022 | 0.063582 | 0.723816 | [
"s207746177",
"s411509829"
] |
u057109575 | p02863 | python | s967096851 | s897049657 | 484 | 434 | 118,616 | 46,296 | Accepted | Accepted | 10.33 | N, T = list(map(int, input().split()))
X = [list(map(int, input().split())) for _ in range(N)]
dp = [[0] * (T + 1) for _ in range(N + 1)]
for i, (a, b) in enumerate(sorted(X)):
for j in range(T + 1):
if j == T:
dp[i + 1][j] = max(dp[i][j], dp[i][j - 1] + b)
elif j < a:
... | N, T = list(map(int, input().split()))
X = [list(map(int, input().split())) for _ in range(N)]
dp = [-1] * 6001
dp[0] = 0
for a, b in sorted(X):
for j in reversed(list(range(T))):
if dp[j] == -1:
continue
dp[j + a] = max(dp[j + a], dp[j] + b)
print((max(dp)))
| 14 | 13 | 450 | 305 | N, T = list(map(int, input().split()))
X = [list(map(int, input().split())) for _ in range(N)]
dp = [[0] * (T + 1) for _ in range(N + 1)]
for i, (a, b) in enumerate(sorted(X)):
for j in range(T + 1):
if j == T:
dp[i + 1][j] = max(dp[i][j], dp[i][j - 1] + b)
elif j < a:
dp[i +... | N, T = list(map(int, input().split()))
X = [list(map(int, input().split())) for _ in range(N)]
dp = [-1] * 6001
dp[0] = 0
for a, b in sorted(X):
for j in reversed(list(range(T))):
if dp[j] == -1:
continue
dp[j + a] = max(dp[j + a], dp[j] + b)
print((max(dp)))
| false | 7.142857 | [
"-dp = [[0] * (T + 1) for _ in range(N + 1)]",
"-for i, (a, b) in enumerate(sorted(X)):",
"- for j in range(T + 1):",
"- if j == T:",
"- dp[i + 1][j] = max(dp[i][j], dp[i][j - 1] + b)",
"- elif j < a:",
"- dp[i + 1][j] = dp[i][j]",
"- else:",
"- ... | false | 0.039689 | 0.039793 | 0.997385 | [
"s967096851",
"s897049657"
] |
u950708010 | p03240 | python | s158793988 | s481479179 | 994 | 424 | 3,064 | 3,064 | Accepted | Accepted | 57.34 | import sys
input = sys.stdin.readline
def solve():
n = int(eval(input()))
query = []
candi = []
for i in range(n):
x,y,h = (int(i) for i in input().split())
query.append((x,y,h))
if n == 1:
print((*[x,y,h]))
exit()
for cx in range(0,101):
for cy in range(0,101):
judge... | import sys
input = sys.stdin.readline
def solve():
n = int(eval(input()))
query = []
candi = []
for i in range(n):
x,y,h = (int(i) for i in input().split())
query.append((x,y,h))
if n == 1:
print((*[x,y,h]))
exit()
query = sorted(query,reverse = True,key=lambda x: x[2])
for cx... | 44 | 34 | 1,001 | 758 | import sys
input = sys.stdin.readline
def solve():
n = int(eval(input()))
query = []
candi = []
for i in range(n):
x, y, h = (int(i) for i in input().split())
query.append((x, y, h))
if n == 1:
print((*[x, y, h]))
exit()
for cx in range(0, 101):
for cy ... | import sys
input = sys.stdin.readline
def solve():
n = int(eval(input()))
query = []
candi = []
for i in range(n):
x, y, h = (int(i) for i in input().split())
query.append((x, y, h))
if n == 1:
print((*[x, y, h]))
exit()
query = sorted(query, reverse=True, key=... | false | 22.727273 | [
"+ query = sorted(query, reverse=True, key=lambda x: x[2])",
"- for j in range(n):",
"- x, y, h = query[j]",
"- if not h == 0:",
"- karih = h + abs(cx - x) + abs(cy - y)",
"- karih2 = 0",
"- for i in range(n):",... | false | 0.088424 | 0.054908 | 1.610414 | [
"s158793988",
"s481479179"
] |
u086566114 | p02412 | python | s071960398 | s207290532 | 180 | 100 | 6,428 | 6,420 | Accepted | Accepted | 44.44 | def get_num(n, x):
ans = 0
for n3 in range(min(n, x), (x + 2) / 3, -1):
for n2 in range(n3 - 1, (x - n3 + 1) / 2 - 1, -1):
for n1 in range(n2 - 1, 0, -1):
s = n1 + n2 + n3
if s < x:
break
elif s == x:
... | def get_num(n, x):
ans = 0
for n3 in range(min(n, x), (x + 2) / 3, -1):
for n2 in range(n3 - 1, (x - n3 + 1) / 2 - 1, -1):
for n1 in range(n2 - 1, 0, -1):
if n1 + n2 + n3 == x:
ans += 1
break
return ans
while True:
... | 22 | 19 | 562 | 483 | def get_num(n, x):
ans = 0
for n3 in range(min(n, x), (x + 2) / 3, -1):
for n2 in range(n3 - 1, (x - n3 + 1) / 2 - 1, -1):
for n1 in range(n2 - 1, 0, -1):
s = n1 + n2 + n3
if s < x:
break
elif s == x:
ans... | def get_num(n, x):
ans = 0
for n3 in range(min(n, x), (x + 2) / 3, -1):
for n2 in range(n3 - 1, (x - n3 + 1) / 2 - 1, -1):
for n1 in range(n2 - 1, 0, -1):
if n1 + n2 + n3 == x:
ans += 1
break
return ans
while True:
[n, x] = [i... | false | 13.636364 | [
"- s = n1 + n2 + n3",
"- if s < x:",
"- break",
"- elif s == x:",
"+ if n1 + n2 + n3 == x:"
] | false | 0.036684 | 0.035382 | 1.036795 | [
"s071960398",
"s207290532"
] |
u576432509 | p02959 | python | s530482459 | s572771334 | 198 | 169 | 19,372 | 18,476 | Accepted | Accepted | 14.65 | n=int(eval(input()))
ai=[]
for i in map(int,input().split()):
ai.append(i)
bi=[]
for i in map(int,input().split()):
bi.append(i)
asum=0
for i in range(n+1):
asum=asum+ai[i]
i=0
if ai[i]<=bi[i]:
bi[i]=bi[i]-ai[i]
ai[i]=0
else :
ai[i]=ai[i]-bi[i]
bi[i]=0
for i in range... | n=int(eval(input()))
a=list(map(int,input().split()))
b=list(map(int,input().split()))
fii=min(a[0],b[0])
fij=min(a[1],b[0]-fii)
icnt=fii+fij
for i in range(1,n):
fii=min(a[i]-fij,b[i])
fij=min(a[i+1],b[i]-fii)
icnt+=fij+fii
print(icnt)
| 45 | 14 | 778 | 259 | n = int(eval(input()))
ai = []
for i in map(int, input().split()):
ai.append(i)
bi = []
for i in map(int, input().split()):
bi.append(i)
asum = 0
for i in range(n + 1):
asum = asum + ai[i]
i = 0
if ai[i] <= bi[i]:
bi[i] = bi[i] - ai[i]
ai[i] = 0
else:
ai[i] = ai[i] - bi[i]
bi[i] = 0
for i in... | n = int(eval(input()))
a = list(map(int, input().split()))
b = list(map(int, input().split()))
fii = min(a[0], b[0])
fij = min(a[1], b[0] - fii)
icnt = fii + fij
for i in range(1, n):
fii = min(a[i] - fij, b[i])
fij = min(a[i + 1], b[i] - fii)
icnt += fij + fii
print(icnt)
| false | 68.888889 | [
"-ai = []",
"-for i in map(int, input().split()):",
"- ai.append(i)",
"-bi = []",
"-for i in map(int, input().split()):",
"- bi.append(i)",
"-asum = 0",
"-for i in range(n + 1):",
"- asum = asum + ai[i]",
"-i = 0",
"-if ai[i] <= bi[i]:",
"- bi[i] = bi[i] - ai[i]",
"- ai[i] = 0... | false | 0.041195 | 0.063451 | 0.649239 | [
"s530482459",
"s572771334"
] |
u078042885 | p01867 | python | s219053407 | s685789795 | 30 | 20 | 7,564 | 7,560 | Accepted | Accepted | 33.33 | eval(input())
s=input().split('+')
t=[s.count(x) for x in set(s)]
a=sum(min(3*t.count(x),t.count(x)+4) for x in set(t) if x!=1)+len(t)-1+t.count(1)
print(a) | eval(input())
s=input().split('+')
t=[s.count(x) for x in set(s)]
print((sum(min(3*t.count(x),t.count(x)+4) for x in set(t) if x!=1)+len(t)-1+t.count(1))) | 5 | 4 | 154 | 149 | eval(input())
s = input().split("+")
t = [s.count(x) for x in set(s)]
a = (
sum(min(3 * t.count(x), t.count(x) + 4) for x in set(t) if x != 1)
+ len(t)
- 1
+ t.count(1)
)
print(a)
| eval(input())
s = input().split("+")
t = [s.count(x) for x in set(s)]
print(
(
sum(min(3 * t.count(x), t.count(x) + 4) for x in set(t) if x != 1)
+ len(t)
- 1
+ t.count(1)
)
)
| false | 20 | [
"-a = (",
"- sum(min(3 * t.count(x), t.count(x) + 4) for x in set(t) if x != 1)",
"- + len(t)",
"- - 1",
"- + t.count(1)",
"+print(",
"+ (",
"+ sum(min(3 * t.count(x), t.count(x) + 4) for x in set(t) if x != 1)",
"+ + len(t)",
"+ - 1",
"+ + t.count(1)",... | false | 0.033813 | 0.035422 | 0.954586 | [
"s219053407",
"s685789795"
] |
u038021590 | p03030 | python | s221001184 | s231627634 | 170 | 17 | 38,512 | 3,060 | Accepted | Accepted | 90 | N = int(eval(input()))
Book = [0] * N
for i in range(N):
s,q = input().split()
p = int(q)
Book[i] = (s, 100-p, i)
Book.sort()
for i in range(N):
print((Book[i][2]+1))
| N = int(eval(input()))
L = []
for _ in range(N):
s, p = input().split()
p = int(p)
L.append((s, 100 - p, _))
L.sort()
for _ in range(N):
print((L[_][2]+1))
| 13 | 11 | 191 | 176 | N = int(eval(input()))
Book = [0] * N
for i in range(N):
s, q = input().split()
p = int(q)
Book[i] = (s, 100 - p, i)
Book.sort()
for i in range(N):
print((Book[i][2] + 1))
| N = int(eval(input()))
L = []
for _ in range(N):
s, p = input().split()
p = int(p)
L.append((s, 100 - p, _))
L.sort()
for _ in range(N):
print((L[_][2] + 1))
| false | 15.384615 | [
"-Book = [0] * N",
"-for i in range(N):",
"- s, q = input().split()",
"- p = int(q)",
"- Book[i] = (s, 100 - p, i)",
"-Book.sort()",
"-for i in range(N):",
"- print((Book[i][2] + 1))",
"+L = []",
"+for _ in range(N):",
"+ s, p = input().split()",
"+ p = int(p)",
"+ L.app... | false | 0.121602 | 0.042111 | 2.887678 | [
"s221001184",
"s231627634"
] |
u230621983 | p02923 | python | s663980892 | s758645370 | 91 | 81 | 14,252 | 20,204 | Accepted | Accepted | 10.99 | n = int(eval(input()))
hs = list(map(int, input().split()))
temp = 0
cnt = 0
for i in range(n-1):
if hs[i] >= hs[i+1]:
temp += 1
cnt = max(cnt, temp)
else:
temp = 0
print(cnt) | n, *h = list(map(int, open(0).read().split()))
left = h[0]
ans = 0
cnt = 0
for i in range(1,n):
if left >= h[i]:
cnt += 1
else:
ans = max(ans, cnt)
cnt = 0
left = h[i]
print((max(ans, cnt))) | 13 | 12 | 199 | 229 | n = int(eval(input()))
hs = list(map(int, input().split()))
temp = 0
cnt = 0
for i in range(n - 1):
if hs[i] >= hs[i + 1]:
temp += 1
cnt = max(cnt, temp)
else:
temp = 0
print(cnt)
| n, *h = list(map(int, open(0).read().split()))
left = h[0]
ans = 0
cnt = 0
for i in range(1, n):
if left >= h[i]:
cnt += 1
else:
ans = max(ans, cnt)
cnt = 0
left = h[i]
print((max(ans, cnt)))
| false | 7.692308 | [
"-n = int(eval(input()))",
"-hs = list(map(int, input().split()))",
"-temp = 0",
"+n, *h = list(map(int, open(0).read().split()))",
"+left = h[0]",
"+ans = 0",
"-for i in range(n - 1):",
"- if hs[i] >= hs[i + 1]:",
"- temp += 1",
"- cnt = max(cnt, temp)",
"+for i in range(1, n):... | false | 0.038853 | 0.040845 | 0.95122 | [
"s663980892",
"s758645370"
] |
u729133443 | p03600 | python | s215707089 | s379387566 | 1,119 | 973 | 18,624 | 18,628 | Accepted | Accepted | 13.05 | import scipy.sparse as s,numpy as n
f=n.loadtxt(open(0),skiprows=1)
g=s.csgraph.dijkstra(f)
h=n.where(g,g,1)
print((int(sum(t[j]*(t[j]<t+h[j]).all()for i,t in enumerate(h)for j in range(i)))*(f==g).all()or-1)) | import scipy.sparse as s,numpy as n
f=n.loadtxt(open(0),skiprows=1)
g=s.csgraph.dijkstra(f)
h=n.where(g,g,1)
print((int(sum(t[j]*all(t[j]<t+h[j])for i,t in enumerate(h)for j in range(i)))*(f==g).all()or-1)) | 5 | 5 | 211 | 208 | import scipy.sparse as s, numpy as n
f = n.loadtxt(open(0), skiprows=1)
g = s.csgraph.dijkstra(f)
h = n.where(g, g, 1)
print(
(
int(
sum(
t[j] * (t[j] < t + h[j]).all()
for i, t in enumerate(h)
for j in range(i)
)
)
* (... | import scipy.sparse as s, numpy as n
f = n.loadtxt(open(0), skiprows=1)
g = s.csgraph.dijkstra(f)
h = n.where(g, g, 1)
print(
(
int(sum(t[j] * all(t[j] < t + h[j]) for i, t in enumerate(h) for j in range(i)))
* (f == g).all()
or -1
)
)
| false | 0 | [
"- int(",
"- sum(",
"- t[j] * (t[j] < t + h[j]).all()",
"- for i, t in enumerate(h)",
"- for j in range(i)",
"- )",
"- )",
"+ int(sum(t[j] * all(t[j] < t + h[j]) for i, t in enumerate(h) for j in range(i)))"
] | false | 0.337 | 0.341311 | 0.987368 | [
"s215707089",
"s379387566"
] |
u980205854 | p03147 | python | s197300800 | s353431306 | 370 | 71 | 80,308 | 66,628 | Accepted | Accepted | 80.81 | N = int(eval(input()))
h = list(map(int,input().split()))
a = [0]*N
ans = 0
for i in range(N):
while a[i]<h[i]:
ans += 1
for j in range(i,N):
if a[j]==h[j]:
break
a[j] += 1
print(ans) | import sys
from sys import exit
from collections import deque
from bisect import bisect_left, bisect_right, insort_left, insort_right #func(リスト,値)
from heapq import heapify, heappop, heappush
from math import *
sys.setrecursionlimit(10**6)
INF = 10**20
eps = 1.0e-20
MOD = 10**9+7
def lcm(x,y):
return... | 12 | 40 | 218 | 942 | N = int(eval(input()))
h = list(map(int, input().split()))
a = [0] * N
ans = 0
for i in range(N):
while a[i] < h[i]:
ans += 1
for j in range(i, N):
if a[j] == h[j]:
break
a[j] += 1
print(ans)
| import sys
from sys import exit
from collections import deque
from bisect import bisect_left, bisect_right, insort_left, insort_right # func(リスト,値)
from heapq import heapify, heappop, heappush
from math import *
sys.setrecursionlimit(10**6)
INF = 10**20
eps = 1.0e-20
MOD = 10**9 + 7
def lcm(x, y):
return x * y ... | false | 70 | [
"-N = int(eval(input()))",
"-h = list(map(int, input().split()))",
"-a = [0] * N",
"+import sys",
"+from sys import exit",
"+from collections import deque",
"+from bisect import bisect_left, bisect_right, insort_left, insort_right # func(リスト,値)",
"+from heapq import heapify, heappop, heappush",
"+f... | false | 0.153867 | 0.068958 | 2.231324 | [
"s197300800",
"s353431306"
] |
u939026953 | p04031 | python | s537423279 | s400305531 | 26 | 24 | 3,060 | 3,060 | Accepted | Accepted | 7.69 | ans = 10 ** 9
n = int(eval(input()))
A = list(map(int,input().split()))
for i in range(-100,101):
X = 0
for j in range(n):
X += (A[j] - i) ** 2
ans = min(ans,X)
print(ans) | ans = 10 ** 9
n = int(eval(input()))
A = list(map(int,input().split()))
for i in range(-100,101):
X = 0
for j in A:
X += (j - i) ** 2
ans = min(ans,X)
print(ans) | 9 | 9 | 183 | 173 | ans = 10**9
n = int(eval(input()))
A = list(map(int, input().split()))
for i in range(-100, 101):
X = 0
for j in range(n):
X += (A[j] - i) ** 2
ans = min(ans, X)
print(ans)
| ans = 10**9
n = int(eval(input()))
A = list(map(int, input().split()))
for i in range(-100, 101):
X = 0
for j in A:
X += (j - i) ** 2
ans = min(ans, X)
print(ans)
| false | 0 | [
"- for j in range(n):",
"- X += (A[j] - i) ** 2",
"+ for j in A:",
"+ X += (j - i) ** 2"
] | false | 0.113717 | 0.008292 | 13.714715 | [
"s537423279",
"s400305531"
] |
u128859393 | p03449 | python | s323043316 | s052804598 | 150 | 17 | 12,484 | 3,060 | Accepted | Accepted | 88.67 | import numpy as np
N = int(eval(input()))
cnt1 = np.cumsum(list(map(int, input().split())))
cnt2 = list(map(int, input().split()))
cnt2 = cnt2[::-1]
cnt2 = np.cumsum(cnt2)
cnt2 = cnt2[::-1]
max_candies = 0
for i in range(N):
if max_candies <= cnt1[i] + cnt2[i]:
max_candies = cnt1[i] + cnt2... | N = int(eval(input()))
cnt1 = list(map(int, input().split()))
cnt2 = list(map(int, input().split()))
max_candies = 0
for i in range(N):
temp = sum(cnt1[:i + 1]) + sum(cnt2[i:])
max_candies = max(temp, max_candies)
print(max_candies) | 17 | 11 | 340 | 250 | import numpy as np
N = int(eval(input()))
cnt1 = np.cumsum(list(map(int, input().split())))
cnt2 = list(map(int, input().split()))
cnt2 = cnt2[::-1]
cnt2 = np.cumsum(cnt2)
cnt2 = cnt2[::-1]
max_candies = 0
for i in range(N):
if max_candies <= cnt1[i] + cnt2[i]:
max_candies = cnt1[i] + cnt2[i]
print(max_can... | N = int(eval(input()))
cnt1 = list(map(int, input().split()))
cnt2 = list(map(int, input().split()))
max_candies = 0
for i in range(N):
temp = sum(cnt1[: i + 1]) + sum(cnt2[i:])
max_candies = max(temp, max_candies)
print(max_candies)
| false | 35.294118 | [
"-import numpy as np",
"-",
"-cnt1 = np.cumsum(list(map(int, input().split())))",
"+cnt1 = list(map(int, input().split()))",
"-cnt2 = cnt2[::-1]",
"-cnt2 = np.cumsum(cnt2)",
"-cnt2 = cnt2[::-1]",
"- if max_candies <= cnt1[i] + cnt2[i]:",
"- max_candies = cnt1[i] + cnt2[i]",
"+ temp = ... | false | 0.220772 | 0.038149 | 5.787068 | [
"s323043316",
"s052804598"
] |
u502389123 | p03565 | python | s507106120 | s740008305 | 19 | 17 | 3,064 | 3,064 | Accepted | Accepted | 10.53 | S = eval(input())
T = eval(input())
index = []
ss = []
flag = False
for i in range(len(S)-len(T)+1):
for j in range(len(T)):
if S[i+j] != T[j] and S[i+j] != '?':
break
if j == len(T) - 1:
flag = True
index.append(i)
if flag:
for v in index:
... | S = eval(input())
T = eval(input())
flag = False
for i in range(len(S)-len(T)+1):
for j in range(len(T)):
if S[i+j] != T[j] and S[i+j] != '?':
break
if j == len(T) - 1:
flag = True
index = i
if flag:
s = ''
k = 0
for i in range(len(S))... | 35 | 28 | 687 | 549 | S = eval(input())
T = eval(input())
index = []
ss = []
flag = False
for i in range(len(S) - len(T) + 1):
for j in range(len(T)):
if S[i + j] != T[j] and S[i + j] != "?":
break
if j == len(T) - 1:
flag = True
index.append(i)
if flag:
for v in index:
s =... | S = eval(input())
T = eval(input())
flag = False
for i in range(len(S) - len(T) + 1):
for j in range(len(T)):
if S[i + j] != T[j] and S[i + j] != "?":
break
if j == len(T) - 1:
flag = True
index = i
if flag:
s = ""
k = 0
for i in range(len(S)):
... | false | 20 | [
"-index = []",
"-ss = []",
"- index.append(i)",
"+ index = i",
"- for v in index:",
"- s = \"\"",
"- k = 0",
"- for i in range(len(S)):",
"- if v <= i <= v + len(T) - 1:",
"- s += T[k]",
"- k += 1",
"- ... | false | 0.051076 | 0.045292 | 1.12772 | [
"s507106120",
"s740008305"
] |
u784022244 | p03262 | python | s604190905 | s478733475 | 286 | 117 | 23,120 | 16,280 | Accepted | Accepted | 59.09 | import numpy as np
N,X=list(map(int, input().split()))
A=np.array(list(map(int, input().split())))
B=A-X
if N==1:
print((abs(B[0])))
exit()
from fractions import gcd
GCD=gcd(abs(B[0]),abs(B[1]))
#print(B)
if N>2:
for i in range(2,N):
GCD=gcd(GCD, abs(B[i]))
print(GCD)
| from fractions import gcd
N,X=list(map(int, input().split()))
x=list(map(int, input().split()))
L=[0]*N
for i in range(N):
L[i]=abs(x[i]-X)
g=L[0]
for i in range(1,N):
g=gcd(g,L[i])
print(g) | 19 | 12 | 300 | 205 | import numpy as np
N, X = list(map(int, input().split()))
A = np.array(list(map(int, input().split())))
B = A - X
if N == 1:
print((abs(B[0])))
exit()
from fractions import gcd
GCD = gcd(abs(B[0]), abs(B[1]))
# print(B)
if N > 2:
for i in range(2, N):
GCD = gcd(GCD, abs(B[i]))
print(GCD)
| from fractions import gcd
N, X = list(map(int, input().split()))
x = list(map(int, input().split()))
L = [0] * N
for i in range(N):
L[i] = abs(x[i] - X)
g = L[0]
for i in range(1, N):
g = gcd(g, L[i])
print(g)
| false | 36.842105 | [
"-import numpy as np",
"+from fractions import gcd",
"-A = np.array(list(map(int, input().split())))",
"-B = A - X",
"-if N == 1:",
"- print((abs(B[0])))",
"- exit()",
"-from fractions import gcd",
"-",
"-GCD = gcd(abs(B[0]), abs(B[1]))",
"-# print(B)",
"-if N > 2:",
"- for i in ran... | false | 0.338876 | 0.048921 | 6.927028 | [
"s604190905",
"s478733475"
] |
u347640436 | p03201 | python | s902514282 | s009710859 | 446 | 403 | 44,560 | 44,560 | Accepted | Accepted | 9.64 | from bisect import bisect_right
n = int(eval(input()))
d = {}
for a in map(int, input().split()):
if a in d:
d[a] += 1
else:
d[a] = 1
alist = list(sorted(list(d.keys()), reverse = True))
amax = alist[0]
t = 1
power_of_two = []
while t < 2 * amax:
t *= 2
power_of_two.append(t)
result = 0
... | from bisect import bisect_right
n = int(eval(input()))
d = {}
for a in map(int, input().split()):
if a in d:
d[a] += 1
else:
d[a] = 1
alist = list(sorted(list(d.keys()), reverse = True))
amax = alist[0]
t = 1
power_of_two = []
while t < 2 * amax:
t *= 2
power_of_two.append(t)
result = 0
... | 35 | 35 | 697 | 669 | from bisect import bisect_right
n = int(eval(input()))
d = {}
for a in map(int, input().split()):
if a in d:
d[a] += 1
else:
d[a] = 1
alist = list(sorted(list(d.keys()), reverse=True))
amax = alist[0]
t = 1
power_of_two = []
while t < 2 * amax:
t *= 2
power_of_two.append(t)
result = 0
f... | from bisect import bisect_right
n = int(eval(input()))
d = {}
for a in map(int, input().split()):
if a in d:
d[a] += 1
else:
d[a] = 1
alist = list(sorted(list(d.keys()), reverse=True))
amax = alist[0]
t = 1
power_of_two = []
while t < 2 * amax:
t *= 2
power_of_two.append(t)
result = 0
f... | false | 0 | [
"- if a not in d or d[a] == 0:",
"+ if d[a] == 0:",
"- if a not in d or d[a] == 0:",
"+ if d[a] == 0:"
] | false | 0.041471 | 0.038013 | 1.090959 | [
"s902514282",
"s009710859"
] |
u334712262 | p03366 | python | s184229194 | s237526534 | 1,975 | 481 | 32,612 | 34,064 | Accepted | Accepted | 75.65 | from collections import Counter, defaultdict
import math
from decimal import Decimal, ROUND_HALF_UP, ROUND_CEILING
from functools import lru_cache, reduce
from itertools import combinations_with_replacement, product, combinations
def read_int():
return int(input())
def read_int_n():
return list(... | from collections import Counter, defaultdict
import math
import random
from decimal import Decimal, ROUND_HALF_UP, ROUND_CEILING
from functools import lru_cache, reduce
from itertools import combinations_with_replacement, product, combinations
def read_int():
return int(input())
def read_int_n():
... | 85 | 95 | 1,519 | 1,753 | from collections import Counter, defaultdict
import math
from decimal import Decimal, ROUND_HALF_UP, ROUND_CEILING
from functools import lru_cache, reduce
from itertools import combinations_with_replacement, product, combinations
def read_int():
return int(input())
def read_int_n():
return list(map(int, inp... | from collections import Counter, defaultdict
import math
import random
from decimal import Decimal, ROUND_HALF_UP, ROUND_CEILING
from functools import lru_cache, reduce
from itertools import combinations_with_replacement, product, combinations
def read_int():
return int(input())
def read_int_n():
return lis... | false | 10.526316 | [
"+import random",
"- while len(X_) != 1:",
"- if X_[0][0] >= X_[-1][0]:",
"- di = -1",
"- li = 0",
"+ i = 0",
"+ j = len(X_) - 1",
"+ # while len(X_) != 1:",
"+ while i < j:",
"+ if X_[i][0] >= X_[j][0]:",
"+ X_[i][0] += X_[j][0]",
... | false | 0.084829 | 0.038113 | 2.225701 | [
"s184229194",
"s237526534"
] |
u296518383 | p02983 | python | s099471091 | s414224800 | 1,160 | 579 | 147,760 | 75,332 | Accepted | Accepted | 50.09 | L,R=list(map(int,input().split()))
if R-L>=2018:
print((0))
else:
M=[]
for i in range(L,R+1):
M.append(i%2019)
#print(M)
A=[]
for i in M:
for j in M:
if i!=j:
A.append(i*j%2019)
#print(A)
print((min(A)))
| L, R = list(map(int, input().split()))
if R - L > 2020:
print((0))
else:
answer = []
for i in range(L, R + 1):
for j in range(i + 1, R + 1):
answer.append((i * j) % 2019)
print((min(answer))) | 17 | 11 | 251 | 213 | L, R = list(map(int, input().split()))
if R - L >= 2018:
print((0))
else:
M = []
for i in range(L, R + 1):
M.append(i % 2019)
# print(M)
A = []
for i in M:
for j in M:
if i != j:
A.append(i * j % 2019)
# print(A)
print((min(A)))
| L, R = list(map(int, input().split()))
if R - L > 2020:
print((0))
else:
answer = []
for i in range(L, R + 1):
for j in range(i + 1, R + 1):
answer.append((i * j) % 2019)
print((min(answer)))
| false | 35.294118 | [
"-if R - L >= 2018:",
"+if R - L > 2020:",
"- M = []",
"+ answer = []",
"- M.append(i % 2019)",
"- # print(M)",
"- A = []",
"- for i in M:",
"- for j in M:",
"- if i != j:",
"- A.append(i * j % 2019)",
"- # print(A)",
"- print((min... | false | 0.050573 | 0.055555 | 0.91032 | [
"s099471091",
"s414224800"
] |
u775421443 | p02953 | python | s525539760 | s081862695 | 62 | 54 | 14,684 | 11,308 | Accepted | Accepted | 12.9 | import sys
sys.setrecursionlimit(20000000)
input = sys.stdin.readline
def main():
n = int(eval(input()))
nums = list(map(int, input().split()))
for x in reversed(list(range(1, len(nums)))):
if nums[x-1] > nums[x]:
nums[x-1] -= 1
if nums[x-1] > nums[x]:
... | import sys
input = sys.stdin.readline
n = int(eval(input()))
nums = list(map(int, input().split()))
maxnum = 0
for x in nums:
if maxnum < x:
maxnum = x
if maxnum - x > 1:
print('No')
sys.exit()
print('Yes')
| 21 | 15 | 408 | 245 | import sys
sys.setrecursionlimit(20000000)
input = sys.stdin.readline
def main():
n = int(eval(input()))
nums = list(map(int, input().split()))
for x in reversed(list(range(1, len(nums)))):
if nums[x - 1] > nums[x]:
nums[x - 1] -= 1
if nums[x - 1] > nums[x]:
print(... | import sys
input = sys.stdin.readline
n = int(eval(input()))
nums = list(map(int, input().split()))
maxnum = 0
for x in nums:
if maxnum < x:
maxnum = x
if maxnum - x > 1:
print("No")
sys.exit()
print("Yes")
| false | 28.571429 | [
"-sys.setrecursionlimit(20000000)",
"-",
"-",
"-def main():",
"- n = int(eval(input()))",
"- nums = list(map(int, input().split()))",
"- for x in reversed(list(range(1, len(nums)))):",
"- if nums[x - 1] > nums[x]:",
"- nums[x - 1] -= 1",
"- if nums[x - 1] > nums[x... | false | 0.045264 | 0.092114 | 0.491391 | [
"s525539760",
"s081862695"
] |
u375616706 | p02804 | python | s345630930 | s809687615 | 210 | 177 | 14,936 | 17,016 | Accepted | Accepted | 15.71 | # -*- coding: utf-8 -*-
class FactMod():
'''
modの値が素数の時のfactと組み合わせを求める
フェルマーの小定理を用いているため、modが素数以外の時は使えない
'''
def __init__(self, n, mod):
'''
コンストラクタ
f:nまでの i!の値を 配列に入れる
inv: (i!)^-1 の値を配列に入れる
'''
self.mod = mod
self.f = [1]*(n+1)... | # -*- coding: utf-8 -*-
class FactMod():
'''
modの値が素数の時のfactと組み合わせを求める
フェルマーの小定理を用いているため、modが素数以外の時は使えない
'''
def __init__(self, n, mod):
'''
コンストラクタ
f:nまでの i!の値を 配列に入れる
inv: (i!)^-1 の値を配列に入れる
'''
self.mod = mod
self.f = [1]*(n+1)... | 59 | 54 | 1,276 | 1,231 | # -*- coding: utf-8 -*-
class FactMod:
"""
modの値が素数の時のfactと組み合わせを求める
フェルマーの小定理を用いているため、modが素数以外の時は使えない
"""
def __init__(self, n, mod):
"""
コンストラクタ
f:nまでの i!の値を 配列に入れる
inv: (i!)^-1 の値を配列に入れる
"""
self.mod = mod
self.f = [1] * (n + 1)
for... | # -*- coding: utf-8 -*-
class FactMod:
"""
modの値が素数の時のfactと組み合わせを求める
フェルマーの小定理を用いているため、modが素数以外の時は使えない
"""
def __init__(self, n, mod):
"""
コンストラクタ
f:nまでの i!の値を 配列に入れる
inv: (i!)^-1 の値を配列に入れる
"""
self.mod = mod
self.f = [1] * (n + 1)
for... | false | 8.474576 | [
"-sub = 0",
"-add = 0",
"-for i in reversed(list(range(K - 1, N))):",
"- add += L[i] * F.comb(i, K - 1)",
"- sub += L[N - i - 1] * F.comb(i, K - 1)",
"-print(((-sub + add + MOD) % MOD))",
"+print(",
"+ (",
"+ sum(",
"+ [",
"+ (L[i] - L[N - i - 1] + MOD) ... | false | 0.143103 | 0.046023 | 3.109402 | [
"s345630930",
"s809687615"
] |
u724687935 | p03378 | python | s433819756 | s819246161 | 166 | 26 | 38,256 | 9,092 | Accepted | Accepted | 84.34 | N, M, X = list(map(int, input().split()))
A = list(map(int, input().split()))
A.sort()
L = 0
R = 0
for a in A:
if a < X:
L += 1
else:
R += 1
print((min(L, R)))
| N, M, X = list(map(int, input().split()))
A = list(map(int, input().split()))
left = 0
right = 0
for i in A:
if i < X:
left += 1
else:
right += 1
print((min(left, right)))
| 13 | 11 | 190 | 199 | N, M, X = list(map(int, input().split()))
A = list(map(int, input().split()))
A.sort()
L = 0
R = 0
for a in A:
if a < X:
L += 1
else:
R += 1
print((min(L, R)))
| N, M, X = list(map(int, input().split()))
A = list(map(int, input().split()))
left = 0
right = 0
for i in A:
if i < X:
left += 1
else:
right += 1
print((min(left, right)))
| false | 15.384615 | [
"-A.sort()",
"-L = 0",
"-R = 0",
"-for a in A:",
"- if a < X:",
"- L += 1",
"+left = 0",
"+right = 0",
"+for i in A:",
"+ if i < X:",
"+ left += 1",
"- R += 1",
"-print((min(L, R)))",
"+ right += 1",
"+print((min(left, right)))"
] | false | 0.038083 | 0.045068 | 0.845 | [
"s433819756",
"s819246161"
] |
u287500079 | p03449 | python | s996414643 | s220269475 | 300 | 268 | 61,292 | 60,012 | Accepted | Accepted | 10.67 | import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import asci... | import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import asci... | 31 | 32 | 1,021 | 1,055 | import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowe... | import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowe... | false | 3.125 | [
"+dx = [0, 0, 1, -1, 1, -1, -1, 1]",
"+dy = [1, -1, 0, 0, 1, -1, 1, -1]",
"-for i in range(n): # 下に移動するとき",
"+for i in range(n):",
"- tmp += a[1][i]",
"- for j in range(i + 1, n):",
"+ for j in range(i, n):"
] | false | 0.077329 | 0.040729 | 1.898639 | [
"s996414643",
"s220269475"
] |
u808427016 | p03286 | python | s957921133 | s297537968 | 168 | 17 | 38,256 | 2,940 | Accepted | Accepted | 89.88 | N = int(eval(input()))
def solve(N):
if N == 0:
return "0"
result = ""
n = N
i = 0
while n:
k = (-2)**i
if n & (1 << i):
n -= k
result = "1" + result
else:
result = "0" + result
i += 1
return result
p... | N = int(eval(input()))
def solve(N):
result = ""
k = 1
while 1:
c = N % 2
result = "01"[c] + result
N = (N - k * c) // 2
k = -k
if N == 0:
break
return result
print((solve(N)))
| 19 | 15 | 329 | 253 | N = int(eval(input()))
def solve(N):
if N == 0:
return "0"
result = ""
n = N
i = 0
while n:
k = (-2) ** i
if n & (1 << i):
n -= k
result = "1" + result
else:
result = "0" + result
i += 1
return result
print((solve(N)... | N = int(eval(input()))
def solve(N):
result = ""
k = 1
while 1:
c = N % 2
result = "01"[c] + result
N = (N - k * c) // 2
k = -k
if N == 0:
break
return result
print((solve(N)))
| false | 21.052632 | [
"- if N == 0:",
"- return \"0\"",
"- n = N",
"- i = 0",
"- while n:",
"- k = (-2) ** i",
"- if n & (1 << i):",
"- n -= k",
"- result = \"1\" + result",
"- else:",
"- result = \"0\" + result",
"- i += 1",
"+ k ... | false | 0.038612 | 0.03802 | 1.015582 | [
"s957921133",
"s297537968"
] |
u513081876 | p03400 | python | s244328581 | s566223418 | 19 | 17 | 3,060 | 2,940 | Accepted | Accepted | 10.53 | n = int(eval(input()))
d, x = list(map(int, input().split()))
a = [int(eval(input())) for i in range(n)]
ans = n+x
for num in a:
ans += (d-1)//num
print(ans) | N = int(eval(input()))
D, X = list(map(int, input().split()))
cacao = 0
for i in range(N):
A = int(eval(input()))
cacao += ((D-1)//A)+1
print((cacao+X)) | 7 | 7 | 155 | 147 | n = int(eval(input()))
d, x = list(map(int, input().split()))
a = [int(eval(input())) for i in range(n)]
ans = n + x
for num in a:
ans += (d - 1) // num
print(ans)
| N = int(eval(input()))
D, X = list(map(int, input().split()))
cacao = 0
for i in range(N):
A = int(eval(input()))
cacao += ((D - 1) // A) + 1
print((cacao + X))
| false | 0 | [
"-n = int(eval(input()))",
"-d, x = list(map(int, input().split()))",
"-a = [int(eval(input())) for i in range(n)]",
"-ans = n + x",
"-for num in a:",
"- ans += (d - 1) // num",
"-print(ans)",
"+N = int(eval(input()))",
"+D, X = list(map(int, input().split()))",
"+cacao = 0",
"+for i in range... | false | 0.038448 | 0.038309 | 1.003619 | [
"s244328581",
"s566223418"
] |
u729133443 | p02702 | python | s033479839 | s417269108 | 1,630 | 1,416 | 76,372 | 112,212 | Accepted | Accepted | 13.13 | a,*d=[0]*2020
for i in map(int,eval(input())):
p=[0]*2019
for j in range(2019):p[(j*10+i)%2019]+=d[j]
d=p
d[i]+=1
a+=d[0]
print(a) | from numba import njit
from numpy import int32,zeros,arange
@njit('i4(i4[:])')
def solve(s):
a=0
d=zeros(2019,int32)
for i in s:
p=zeros(2019,int32)
for j in range(2019):p[(j*10+i)%2019]+=d[j]
d=p
d[i]+=1
a+=d[0]
return a
print((solve(int32([*eval(inp... | 8 | 14 | 141 | 322 | a, *d = [0] * 2020
for i in map(int, eval(input())):
p = [0] * 2019
for j in range(2019):
p[(j * 10 + i) % 2019] += d[j]
d = p
d[i] += 1
a += d[0]
print(a)
| from numba import njit
from numpy import int32, zeros, arange
@njit("i4(i4[:])")
def solve(s):
a = 0
d = zeros(2019, int32)
for i in s:
p = zeros(2019, int32)
for j in range(2019):
p[(j * 10 + i) % 2019] += d[j]
d = p
d[i] += 1
a += d[0]
return a
p... | false | 42.857143 | [
"-a, *d = [0] * 2020",
"-for i in map(int, eval(input())):",
"- p = [0] * 2019",
"- for j in range(2019):",
"- p[(j * 10 + i) % 2019] += d[j]",
"- d = p",
"- d[i] += 1",
"- a += d[0]",
"-print(a)",
"+from numba import njit",
"+from numpy import int32, zeros, arange",
"+",... | false | 0.035418 | 0.037138 | 0.95368 | [
"s033479839",
"s417269108"
] |
u811967730 | p03804 | python | s783232084 | s521855374 | 164 | 23 | 3,060 | 3,064 | Accepted | Accepted | 85.98 | N, M = list(map(int, input().split()))
A = [eval(input()) for _ in range(N)]
B = [eval(input()) for _ in range(M)]
ans = "No"
for i in range(N - M + 1):
for j in range(N - M + 1):
c = 0
for x in range(M):
for y in range(M):
if A[x + i][y + j] == B[x][y]:
... | N, M = list(map(int, input().split()))
A = [eval(input()) for _ in range(N)]
B = [eval(input()) for _ in range(M)]
ans = "No"
for i in range(N - M + 1):
for j in range(N - M + 1):
c = 0
for x in range(M):
if A[x + i][j:j + M] == B[x]:
c += 1
if c == ... | 18 | 20 | 409 | 403 | N, M = list(map(int, input().split()))
A = [eval(input()) for _ in range(N)]
B = [eval(input()) for _ in range(M)]
ans = "No"
for i in range(N - M + 1):
for j in range(N - M + 1):
c = 0
for x in range(M):
for y in range(M):
if A[x + i][y + j] == B[x][y]:
... | N, M = list(map(int, input().split()))
A = [eval(input()) for _ in range(N)]
B = [eval(input()) for _ in range(M)]
ans = "No"
for i in range(N - M + 1):
for j in range(N - M + 1):
c = 0
for x in range(M):
if A[x + i][j : j + M] == B[x]:
c += 1
if c == M:
... | false | 10 | [
"- for y in range(M):",
"- if A[x + i][y + j] == B[x][y]:",
"- c += 1",
"- if c == M**2:",
"+ if A[x + i][j : j + M] == B[x]:",
"+ c += 1",
"+ if c == M:",
"+ else:",
"+ continue",
"+ break"
] | false | 0.035839 | 0.104531 | 0.342858 | [
"s783232084",
"s521855374"
] |
u405256066 | p03150 | python | s550733973 | s177393751 | 23 | 19 | 3,188 | 3,060 | Accepted | Accepted | 17.39 | import re
from sys import stdin
N=(stdin.readline().rstrip())
for i in range(7):
mae="keyence"[0:i+1]
ato="keyence"[i+1:8]
if re.search(".*keyencekeyence",N):
if (re.sub('.*keyencekeyence', '', N)=="")==True:
print("YES")
break
if re.search("keyencekeyence.*",N)... | from sys import stdin
S = (stdin.readline().rstrip())
flag = False
for i in range(0,len(S)+1):
for j in range(0,len(S)+1):
if j >= i:
if S[:i]+S[j:] == "keyence":
flag = True
if flag:
print("YES")
else:
print("NO") | 26 | 12 | 767 | 273 | import re
from sys import stdin
N = stdin.readline().rstrip()
for i in range(7):
mae = "keyence"[0 : i + 1]
ato = "keyence"[i + 1 : 8]
if re.search(".*keyencekeyence", N):
if (re.sub(".*keyencekeyence", "", N) == "") == True:
print("YES")
break
if re.search("keyencekeyen... | from sys import stdin
S = stdin.readline().rstrip()
flag = False
for i in range(0, len(S) + 1):
for j in range(0, len(S) + 1):
if j >= i:
if S[:i] + S[j:] == "keyence":
flag = True
if flag:
print("YES")
else:
print("NO")
| false | 53.846154 | [
"-import re",
"-N = stdin.readline().rstrip()",
"-for i in range(7):",
"- mae = \"keyence\"[0 : i + 1]",
"- ato = \"keyence\"[i + 1 : 8]",
"- if re.search(\".*keyencekeyence\", N):",
"- if (re.sub(\".*keyencekeyence\", \"\", N) == \"\") == True:",
"- print(\"YES\")",
"- ... | false | 0.050266 | 0.075315 | 0.667402 | [
"s550733973",
"s177393751"
] |
u844005364 | p03457 | python | s413954830 | s730580297 | 542 | 321 | 37,216 | 3,060 | Accepted | Accepted | 40.77 | def difference(two_lists):
return [abs(two_lists[1][i] - two_lists[0][i]) for i in range(3)]
n = int(eval(input()))
txy = [[0, 0, 0]] + [list(map(int, input().split())) for _ in range(n)]
dtxy = list(map(difference, list(zip(txy, txy[1:]))))
for i in range(n):
dt, dx, dy = dtxy[i]
if dx + dy... | n = int(eval(input()))
for _ in range(n):
t, x, y = list(map(int, input().split()))
if x + y > t or (t - x - y) % 2:
print("No")
exit()
print("Yes") | 15 | 8 | 387 | 169 | def difference(two_lists):
return [abs(two_lists[1][i] - two_lists[0][i]) for i in range(3)]
n = int(eval(input()))
txy = [[0, 0, 0]] + [list(map(int, input().split())) for _ in range(n)]
dtxy = list(map(difference, list(zip(txy, txy[1:]))))
for i in range(n):
dt, dx, dy = dtxy[i]
if dx + dy > dt or (dt -... | n = int(eval(input()))
for _ in range(n):
t, x, y = list(map(int, input().split()))
if x + y > t or (t - x - y) % 2:
print("No")
exit()
print("Yes")
| false | 46.666667 | [
"-def difference(two_lists):",
"- return [abs(two_lists[1][i] - two_lists[0][i]) for i in range(3)]",
"-",
"-",
"-txy = [[0, 0, 0]] + [list(map(int, input().split())) for _ in range(n)]",
"-dtxy = list(map(difference, list(zip(txy, txy[1:]))))",
"-for i in range(n):",
"- dt, dx, dy = dtxy[i]",
... | false | 0.037058 | 0.069321 | 0.534593 | [
"s413954830",
"s730580297"
] |
u844266921 | p03286 | python | s936741277 | s315199269 | 19 | 17 | 3,188 | 3,064 | Accepted | Accepted | 10.53 | n=int(eval(input()))
def isdig(n):
if n>=0:
digit=0
while n>2**digit:
n-=2**digit
digit+=2
else:
digit=1
while n<-2**digit:
n+=2**digit
digit+=2
return digit
x=["0"]*(isdig(n)+1)
while n!=0:
digit=isdig(n)
if digit%2==0:
n-=2**digit
else:
n+... | n=eval(input())
s=[]
n=int(n)
i=0
while n!=0:
if n%2**(i+1)==0:
s.append("0")
else:
s.append("1")
n-=(-2)**i
i+=1
s.reverse()
if s==[]:
s=["0"]
print(("".join(s))) | 23 | 15 | 371 | 189 | n = int(eval(input()))
def isdig(n):
if n >= 0:
digit = 0
while n > 2**digit:
n -= 2**digit
digit += 2
else:
digit = 1
while n < -(2**digit):
n += 2**digit
digit += 2
return digit
x = ["0"] * (isdig(n) + 1)
while n != 0:
... | n = eval(input())
s = []
n = int(n)
i = 0
while n != 0:
if n % 2 ** (i + 1) == 0:
s.append("0")
else:
s.append("1")
n -= (-2) ** i
i += 1
s.reverse()
if s == []:
s = ["0"]
print(("".join(s)))
| false | 34.782609 | [
"-n = int(eval(input()))",
"-",
"-",
"-def isdig(n):",
"- if n >= 0:",
"- digit = 0",
"- while n > 2**digit:",
"- n -= 2**digit",
"- digit += 2",
"+n = eval(input())",
"+s = []",
"+n = int(n)",
"+i = 0",
"+while n != 0:",
"+ if n % 2 ** (i + 1) =... | false | 0.127117 | 0.056393 | 2.254136 | [
"s936741277",
"s315199269"
] |
u585482323 | p03298 | python | s035892734 | s386702475 | 657 | 492 | 113,884 | 127,152 | Accepted | Accepted | 25.11 | #!usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline()... | #!usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline()... | 92 | 78 | 1,690 | 1,420 | #!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI():
return [int(x) for x in sys.stdin.readline().split()]
def I():
return int(sys.stdin.readline())
def LS():
return [list(x) for x in sys.stdin... | #!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI():
return [int(x) for x in sys.stdin.readline().split()]
def I():
return int(sys.stdin.readline())
def LS():
return [list(x) for x in sys.stdin... | false | 15.217391 | [
"- for i in range(n >> 1):",
"- s[i], s[n - i - 1] = s[n - i - 1], s[i]",
"- for i in range(m):",
"- r = 0",
"- b = 0",
"- for j in range(n):",
"- if i & p[j]:",
"- r *= k",
"- r += s[j]",
"- else:",
"- ... | false | 0.424699 | 0.212403 | 1.9995 | [
"s035892734",
"s386702475"
] |
u083960235 | p03087 | python | s559041967 | s805301476 | 422 | 387 | 10,324 | 32,728 | Accepted | Accepted | 8.29 | N,Q=list(map(int,input().split()))
s=eval(input())
#a=[]
l=[0]*(N)
for i in range(N-1):
if s[i:i+2]=='AC':
l[i+1]=l[i]+1
else:
l[i+1]=l[i]
#print(l)
ans=[]
for i in range(Q):
first,last=list(map(int,input().split()))
ans.append(l[last-1]-l[first-1])
for i in ans:
p... | import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii... | 18 | 37 | 310 | 1,065 | N, Q = list(map(int, input().split()))
s = eval(input())
# a=[]
l = [0] * (N)
for i in range(N - 1):
if s[i : i + 2] == "AC":
l[i + 1] = l[i] + 1
else:
l[i + 1] = l[i]
# print(l)
ans = []
for i in range(Q):
first, last = list(map(int, input().split()))
ans.append(l[last - 1] - l[first - ... | import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_upper... | false | 51.351351 | [
"-N, Q = list(map(int, input().split()))",
"-s = eval(input())",
"-# a=[]",
"-l = [0] * (N)",
"+import sys, re, os",
"+from collections import deque, defaultdict, Counter",
"+from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians",
"+from itertools import permutations, combinations, prod... | false | 0.165756 | 0.107024 | 1.548779 | [
"s559041967",
"s805301476"
] |
u781262926 | p03212 | python | s121174885 | s189344232 | 444 | 86 | 7,016 | 4,072 | Accepted | Accepted | 80.63 | from itertools import product
n = int(eval(input()))
A = set()
for x in product('753_', repeat=9):
s = ''.join(x).replace('_', '')
if all(d in s for d in '753') and int(s) <= n:
A.add(s)
print((len(A))) | n = int(eval(input()))
B = []
def dfs(A):
x = int(''.join(A))
if x <= n:
if '7' in A and '5' in A and '3' in A:
B.append(x)
dfs(A + ['7'])
dfs(A + ['5'])
dfs(A + ['3'])
dfs(['0'])
print((len(B))) | 8 | 13 | 217 | 226 | from itertools import product
n = int(eval(input()))
A = set()
for x in product("753_", repeat=9):
s = "".join(x).replace("_", "")
if all(d in s for d in "753") and int(s) <= n:
A.add(s)
print((len(A)))
| n = int(eval(input()))
B = []
def dfs(A):
x = int("".join(A))
if x <= n:
if "7" in A and "5" in A and "3" in A:
B.append(x)
dfs(A + ["7"])
dfs(A + ["5"])
dfs(A + ["3"])
dfs(["0"])
print((len(B)))
| false | 38.461538 | [
"-from itertools import product",
"+n = int(eval(input()))",
"+B = []",
"-n = int(eval(input()))",
"-A = set()",
"-for x in product(\"753_\", repeat=9):",
"- s = \"\".join(x).replace(\"_\", \"\")",
"- if all(d in s for d in \"753\") and int(s) <= n:",
"- A.add(s)",
"-print((len(A)))",... | false | 0.9688 | 0.048561 | 19.950266 | [
"s121174885",
"s189344232"
] |
u852690916 | p02991 | python | s484238257 | s234965236 | 343 | 252 | 103,396 | 109,448 | Accepted | Accepted | 26.53 | # でつoO(YOU PLAY WITH THE CARDS YOU'RE DEALT..)
from heapq import heappush, heappop
import sys
def main(N, M, G, S, T):
INF = 10**10
dp = [[INF for _ in range(N)] for __ in range(3)]
dp[0][S] = 0
q = [(0, S)]
while q:
d, v = heappop(q)
for to in G[v]:
if d + 1 >... | # でつoO(YOU PLAY WITH THE CARDS YOU'RE DEALT..)
from collections import deque
import sys
def main(N, M, G, S, T):
INF = 10**10
q = deque([S])
dist = [INF] * (3 * N)
dist[S] = 0
while q:
v = q.popleft()
for to in G[v]:
if dist[to] < INF: continue
dis... | 26 | 28 | 814 | 823 | # でつoO(YOU PLAY WITH THE CARDS YOU'RE DEALT..)
from heapq import heappush, heappop
import sys
def main(N, M, G, S, T):
INF = 10**10
dp = [[INF for _ in range(N)] for __ in range(3)]
dp[0][S] = 0
q = [(0, S)]
while q:
d, v = heappop(q)
for to in G[v]:
if d + 1 >= dp[(d +... | # でつoO(YOU PLAY WITH THE CARDS YOU'RE DEALT..)
from collections import deque
import sys
def main(N, M, G, S, T):
INF = 10**10
q = deque([S])
dist = [INF] * (3 * N)
dist[S] = 0
while q:
v = q.popleft()
for to in G[v]:
if dist[to] < INF:
continue
... | false | 7.142857 | [
"-from heapq import heappush, heappop",
"+from collections import deque",
"- dp = [[INF for _ in range(N)] for __ in range(3)]",
"- dp[0][S] = 0",
"- q = [(0, S)]",
"+ q = deque([S])",
"+ dist = [INF] * (3 * N)",
"+ dist[S] = 0",
"- d, v = heappop(q)",
"+ v = q.popl... | false | 0.038138 | 0.079588 | 0.479189 | [
"s484238257",
"s234965236"
] |
u250362126 | p02552 | python | s240159295 | s689245233 | 29 | 25 | 9,096 | 9,096 | Accepted | Accepted | 13.79 | a = int(eval(input()))
print((1 if a == 0 else 0)) | def _print():
a = int(eval(input()))
print((1 if a == 0 else 0))
if __name__ == '__main__':
_print()
| 2 | 6 | 43 | 105 | a = int(eval(input()))
print((1 if a == 0 else 0))
| def _print():
a = int(eval(input()))
print((1 if a == 0 else 0))
if __name__ == "__main__":
_print()
| false | 66.666667 | [
"-a = int(eval(input()))",
"-print((1 if a == 0 else 0))",
"+def _print():",
"+ a = int(eval(input()))",
"+ print((1 if a == 0 else 0))",
"+",
"+",
"+if __name__ == \"__main__\":",
"+ _print()"
] | false | 0.045902 | 0.082628 | 0.555524 | [
"s240159295",
"s689245233"
] |
u646456209 | p03246 | python | s372062692 | s701988823 | 188 | 139 | 13,636 | 12,472 | Accepted | Accepted | 26.06 | maxn=10**5+10
n=int(eval(input()))
a=[None]*(n+10)
b=[0]*maxn
c=[0]*maxn
a[1:n+1]=input().split()
for i in range(1,n+1):
a[i]=int(a[i])
if i%2==0:
b[a[i]]+=1
else:
c[a[i]]+=1
max1=max2=maxp=0
for i in range(1,maxn):
if b[i]>=max1:
max2=max1
maxp=i
... | maxn=10**5+10
n=int(eval(input()))
b=[0]*maxn
c=[0]*maxn
a=input().split()
for i in range(0,n):
a[i]=int(a[i])
if i%2==0:
b[a[i]]+=1
else:
c[a[i]]+=1
max1=max(b)
maxp=b.index(max1)
del b[maxp]
max2=max(b)
ans=0
for i in range(0,maxn):
ans=max(ans,c[i]+(max2 if i==m... | 33 | 23 | 540 | 346 | maxn = 10**5 + 10
n = int(eval(input()))
a = [None] * (n + 10)
b = [0] * maxn
c = [0] * maxn
a[1 : n + 1] = input().split()
for i in range(1, n + 1):
a[i] = int(a[i])
if i % 2 == 0:
b[a[i]] += 1
else:
c[a[i]] += 1
max1 = max2 = maxp = 0
for i in range(1, maxn):
if b[i] >= max1:
m... | maxn = 10**5 + 10
n = int(eval(input()))
b = [0] * maxn
c = [0] * maxn
a = input().split()
for i in range(0, n):
a[i] = int(a[i])
if i % 2 == 0:
b[a[i]] += 1
else:
c[a[i]] += 1
max1 = max(b)
maxp = b.index(max1)
del b[maxp]
max2 = max(b)
ans = 0
for i in range(0, maxn):
ans = max(ans, c[... | false | 30.30303 | [
"-a = [None] * (n + 10)",
"-a[1 : n + 1] = input().split()",
"-for i in range(1, n + 1):",
"+a = input().split()",
"+for i in range(0, n):",
"-max1 = max2 = maxp = 0",
"-for i in range(1, maxn):",
"- if b[i] >= max1:",
"- max2 = max1",
"- maxp = i",
"- max1 = b[i]",
"- ... | false | 0.128767 | 0.090778 | 1.418482 | [
"s372062692",
"s701988823"
] |
u125337618 | p02861 | python | s997438160 | s364394662 | 501 | 18 | 3,064 | 3,064 | Accepted | Accepted | 96.41 | from itertools import permutations
from math import factorial
N = int(eval(input()))
coord = []
for _ in range(N):
x,y = list(map(int, input().split()))
coord.append((x,y))
def dist(a, b):
x1, y1 = a
x2, y2 = b
return pow((x1-x2) ** 2 + (y1-y2) ** 2, 1/2)
res = 0
div = factorial(N)
idx... | from itertools import permutations
from math import factorial
N = int(eval(input()))
coord = []
for _ in range(N):
x,y = list(map(int, input().split()))
coord.append((x,y))
def dist(a, b):
x1, y1 = a
x2, y2 = b
return pow((x1-x2) ** 2 + (y1-y2) ** 2, 1/2)
res = 0
for i in range(N):
... | 22 | 20 | 465 | 393 | from itertools import permutations
from math import factorial
N = int(eval(input()))
coord = []
for _ in range(N):
x, y = list(map(int, input().split()))
coord.append((x, y))
def dist(a, b):
x1, y1 = a
x2, y2 = b
return pow((x1 - x2) ** 2 + (y1 - y2) ** 2, 1 / 2)
res = 0
div = factorial(N)
idx ... | from itertools import permutations
from math import factorial
N = int(eval(input()))
coord = []
for _ in range(N):
x, y = list(map(int, input().split()))
coord.append((x, y))
def dist(a, b):
x1, y1 = a
x2, y2 = b
return pow((x1 - x2) ** 2 + (y1 - y2) ** 2, 1 / 2)
res = 0
for i in range(N):
... | false | 9.090909 | [
"-div = factorial(N)",
"-idx = [i for i in range(N)]",
"-for line in permutations(idx, N):",
"- for i in range(N - 1):",
"- res += dist(coord[line[i]], coord[line[i + 1]]) / div",
"+for i in range(N):",
"+ for j in range(i + 1, N):",
"+ res += dist(coord[i], coord[j]) * 2 / N"
] | false | 0.07597 | 0.038946 | 1.950637 | [
"s997438160",
"s364394662"
] |
u344655022 | p02554 | python | s046674141 | s518904168 | 90 | 66 | 67,428 | 61,852 | Accepted | Accepted | 26.67 | import sys
input = sys.stdin.readline
INF = 10**18
sys.setrecursionlimit(10**6)
import itertools as it
import collections as cl
from collections import deque
import math
from functools import reduce
from collections import defaultdict
D = 10 ** 9 + 7
def li():
return [int(x) for x in input().split()]
... | D = 10 ** 9 + 7
def li():
return [int(x) for x in input().split()]
N = int(eval(input()))
total = pow(10, N, D)
A = total - pow(9, N, D)
B = total - pow(9, N, D)
C = total - pow(8, N, D)
ans = (A + B - C) % D
print(ans) | 34 | 14 | 660 | 234 | import sys
input = sys.stdin.readline
INF = 10**18
sys.setrecursionlimit(10**6)
import itertools as it
import collections as cl
from collections import deque
import math
from functools import reduce
from collections import defaultdict
D = 10**9 + 7
def li():
return [int(x) for x in input().split()]
def modpow... | D = 10**9 + 7
def li():
return [int(x) for x in input().split()]
N = int(eval(input()))
total = pow(10, N, D)
A = total - pow(9, N, D)
B = total - pow(9, N, D)
C = total - pow(8, N, D)
ans = (A + B - C) % D
print(ans)
| false | 58.823529 | [
"-import sys",
"-",
"-input = sys.stdin.readline",
"-INF = 10**18",
"-sys.setrecursionlimit(10**6)",
"-import itertools as it",
"-import collections as cl",
"-from collections import deque",
"-import math",
"-from functools import reduce",
"-from collections import defaultdict",
"-",
"-def m... | false | 0.042795 | 0.041736 | 1.025368 | [
"s046674141",
"s518904168"
] |
u908651435 | p02386 | python | s143362271 | s072154603 | 290 | 250 | 5,612 | 5,612 | Accepted | Accepted | 13.79 | class Dice:
def __init__(self,t,f,r,l,b,u):
self.a=[[t,f,r,l,b,u]]
self.direction={'S':(4,0,2,3,5,1),'N':(1,5,2,3,0,4),'E':(3,1,0,5,4,2),'W':(2,1,5,0,4,3),'Y':(0,3,1,4,2,5)}
def roll(self,d,n):
self.a[n]=[self.a[n][i] for i in self.direction[d]]
n=int(eval(input()))
for i in range... | class Dice:
def __init__(self,t,f,r,l,b,u):
self.a=[[t,f,r,l,b,u]]
self.direction={'S':(4,0,2,3,5,1),'N':(1,5,2,3,0,4),'E':(3,1,0,5,4,2),'W':(2,1,5,0,4,3),'U':(5,4,2,3,1,0)}
def dice_tuple(self):
self.b=tuple(self.a)
def roll(self,d,n):
self.a[n]=[self.a[n][i] for i in... | 29 | 35 | 872 | 1,121 | class Dice:
def __init__(self, t, f, r, l, b, u):
self.a = [[t, f, r, l, b, u]]
self.direction = {
"S": (4, 0, 2, 3, 5, 1),
"N": (1, 5, 2, 3, 0, 4),
"E": (3, 1, 0, 5, 4, 2),
"W": (2, 1, 5, 0, 4, 3),
"Y": (0, 3, 1, 4, 2, 5),
}
d... | class Dice:
def __init__(self, t, f, r, l, b, u):
self.a = [[t, f, r, l, b, u]]
self.direction = {
"S": (4, 0, 2, 3, 5, 1),
"N": (1, 5, 2, 3, 0, 4),
"E": (3, 1, 0, 5, 4, 2),
"W": (2, 1, 5, 0, 4, 3),
"U": (5, 4, 2, 3, 1, 0),
}
d... | false | 17.142857 | [
"- \"Y\": (0, 3, 1, 4, 2, 5),",
"+ \"U\": (5, 4, 2, 3, 1, 0),",
"+",
"+ def dice_tuple(self):",
"+ self.b = tuple(self.a)",
"+",
"+ def roll2(self, d, n):",
"+ self.a[n] = [self.b[n][i] for i in self.direction[d]]",
"+",
"+ def roll_w(self, n):",
"+ ... | false | 0.039589 | 0.038502 | 1.028239 | [
"s143362271",
"s072154603"
] |
u729133443 | p02782 | python | s367505199 | s586556798 | 340 | 219 | 82,220 | 55,660 | Accepted | Accepted | 35.59 | def main():
import sys
M=10**9+7
r1,c1,r2,c2=list(map(int,sys.stdin.buffer.readline().split()))
n=r2+c2+2
val=1
fac=[val]
append=fac.append
for i in range(1,n+1):
val=val*i%M
append(val)
pr1=pow(fac[r1],M-2,M)
pc1=pow(fac[c1],M-2,M)
pr2=pow(fac[r2+1],M-2,M)
pc2=pow(fac[c2+1... | M=10**9+7
r1,c1,r2,c2=list(map(int,input().split()))
n=r2+c2+2
fac=[0]*(n+1)
fac[0]=val=1
for i in range(1,n+1):fac[i]=val=val*i%M
pr1=pow(fac[r1],M-2,M)
pc1=pow(fac[c1],M-2,M)
pr2=pow(fac[r2+1],M-2,M)
pc2=pow(fac[c2+1],M-2,M)
a=fac[r2+c2+2]*pr2*pc2
a-=fac[r2+c1+1]*pr2*pc1
a-=fac[r1+c2+1]*pr1*pc2
a+=fac[r1... | 17 | 15 | 426 | 338 | def main():
import sys
M = 10**9 + 7
r1, c1, r2, c2 = list(map(int, sys.stdin.buffer.readline().split()))
n = r2 + c2 + 2
val = 1
fac = [val]
append = fac.append
for i in range(1, n + 1):
val = val * i % M
append(val)
pr1 = pow(fac[r1], M - 2, M)
pc1 = pow(fac[c1... | M = 10**9 + 7
r1, c1, r2, c2 = list(map(int, input().split()))
n = r2 + c2 + 2
fac = [0] * (n + 1)
fac[0] = val = 1
for i in range(1, n + 1):
fac[i] = val = val * i % M
pr1 = pow(fac[r1], M - 2, M)
pc1 = pow(fac[c1], M - 2, M)
pr2 = pow(fac[r2 + 1], M - 2, M)
pc2 = pow(fac[c2 + 1], M - 2, M)
a = fac[r2 + c2 + 2] * ... | false | 11.764706 | [
"-def main():",
"- import sys",
"-",
"- M = 10**9 + 7",
"- r1, c1, r2, c2 = list(map(int, sys.stdin.buffer.readline().split()))",
"- n = r2 + c2 + 2",
"- val = 1",
"- fac = [val]",
"- append = fac.append",
"- for i in range(1, n + 1):",
"- val = val * i % M",
"- ... | false | 0.044066 | 0.04315 | 1.021231 | [
"s367505199",
"s586556798"
] |
u708255304 | p02695 | python | s461757134 | s823520853 | 738 | 345 | 9,348 | 9,100 | Accepted | Accepted | 53.25 | import sys
from copy import deepcopy
sys.setrecursionlimit(10**7)
def dfs(now):
global ans
if len(now) == N:
tmp_ans = 0
for a, b, c, d in query:
a -= 1
b -= 1
if now[b] - now[a] == c:
tmp_ans += d
ans = max(tmp_ans, ans... | # 全探索で行う
N, M, Q = list(map(int, input().split()))
query = [list(map(int, input().split())) for _ in range(Q)]
A = [1]
def dfs(now):
if len(now) == N:
global ans
tmp_ans = 0
for a, b, c, d in query:
a -= 1
b -= 1
if now[b] - now[a] == c:
... | 29 | 25 | 618 | 534 | import sys
from copy import deepcopy
sys.setrecursionlimit(10**7)
def dfs(now):
global ans
if len(now) == N:
tmp_ans = 0
for a, b, c, d in query:
a -= 1
b -= 1
if now[b] - now[a] == c:
tmp_ans += d
ans = max(tmp_ans, ans)
else:
... | # 全探索で行う
N, M, Q = list(map(int, input().split()))
query = [list(map(int, input().split())) for _ in range(Q)]
A = [1]
def dfs(now):
if len(now) == N:
global ans
tmp_ans = 0
for a, b, c, d in query:
a -= 1
b -= 1
if now[b] - now[a] == c:
... | false | 13.793103 | [
"-import sys",
"-from copy import deepcopy",
"-",
"-sys.setrecursionlimit(10**7)",
"+# 全探索で行う",
"+N, M, Q = list(map(int, input().split()))",
"+query = [list(map(int, input().split())) for _ in range(Q)]",
"+A = [1]",
"- global ans",
"+ global ans",
"- ans = max(tmp_ans, ans)",
... | false | 0.148439 | 0.047825 | 3.103764 | [
"s461757134",
"s823520853"
] |
u316603606 | p03813 | python | s497787895 | s135235677 | 29 | 24 | 9,132 | 8,912 | Accepted | Accepted | 17.24 | x = int (eval(input ()))
if x < 1200:
print ('ABC')
else:
print ('ARC')
| x = int (eval(input ()))
if x>=1200:
print ('ARC')
else:
print ('ABC') | 5 | 5 | 74 | 72 | x = int(eval(input()))
if x < 1200:
print("ABC")
else:
print("ARC")
| x = int(eval(input()))
if x >= 1200:
print("ARC")
else:
print("ABC")
| false | 0 | [
"-if x < 1200:",
"+if x >= 1200:",
"+ print(\"ARC\")",
"+else:",
"-else:",
"- print(\"ARC\")"
] | false | 0.034785 | 0.038802 | 0.89649 | [
"s497787895",
"s135235677"
] |
u760760982 | p02683 | python | s649048758 | s040468442 | 104 | 93 | 9,220 | 9,056 | Accepted | Accepted | 10.58 | n,m,x = list(map(int,input().split()))
c = [list(map(int,input().split())) for _ in range(n)]
ans = []
#n冊の本において買うか買わないかの2通りなので2**n
for i in range(2**n):
#リストの中身は値段1と理解度m個
a = [0]*(m+1)
com = i
for j in range(n):
if com >= (2**(n-j-1)):
com -= 2**(n-j-1)
for k ... | n,m,x = list(map(int,input().split()))
c = [list(map(int,input().split())) for _ in range(n)]
ans = []
#n冊の本において買うか買わないかの2通りなので2**n
for i in range(2**n):
#リストの中身は値段1と理解度m個
a = [0]*m
price = 0
for j in range(n):
#n冊あるうちj冊目を買うか買わないかを判定
if ((i >> j) & 1):
for k in ran... | 22 | 22 | 545 | 542 | n, m, x = list(map(int, input().split()))
c = [list(map(int, input().split())) for _ in range(n)]
ans = []
# n冊の本において買うか買わないかの2通りなので2**n
for i in range(2**n):
# リストの中身は値段1と理解度m個
a = [0] * (m + 1)
com = i
for j in range(n):
if com >= (2 ** (n - j - 1)):
com -= 2 ** (n - j - 1)
... | n, m, x = list(map(int, input().split()))
c = [list(map(int, input().split())) for _ in range(n)]
ans = []
# n冊の本において買うか買わないかの2通りなので2**n
for i in range(2**n):
# リストの中身は値段1と理解度m個
a = [0] * m
price = 0
for j in range(n):
# n冊あるうちj冊目を買うか買わないかを判定
if (i >> j) & 1:
for k in range(m... | false | 0 | [
"- a = [0] * (m + 1)",
"- com = i",
"+ a = [0] * m",
"+ price = 0",
"- if com >= (2 ** (n - j - 1)):",
"- com -= 2 ** (n - j - 1)",
"- for k in range(m + 1):",
"- a[k] += c[j][k]",
"- price = a[0]",
"- del a[0]",
"- if all(a[j] >= ... | false | 0.049142 | 0.048942 | 1.004076 | [
"s649048758",
"s040468442"
] |
u970899068 | p02597 | python | s287056241 | s206846512 | 132 | 90 | 93,476 | 95,848 | Accepted | Accepted | 31.82 | n=int(eval(input()))
a=list(eval(input()))
# あかのインデックス
RR=[-1]
# しろのインデックス
WW=[]
for i in range(n):
if a[i]=='R':
RR.append(i)
else:
WW.append(i)
WW.append(float('inf'))
if a.count('R')==0 or a.count('R')==n:
print((0))
exit()
if a.count('W')==1 or a.count('R')==1:
... | n=int(eval(input()))
a=list(eval(input()))
# あかのインデックス
RR=[]
for i in range(n):
if a[i]=='R':
RR.append(i)
v=a.count('R')
ans=v
for i in range(len(RR)):
if RR[i]+1<=v:
ans-=1
print(ans) | 70 | 17 | 1,152 | 217 | n = int(eval(input()))
a = list(eval(input()))
# あかのインデックス
RR = [-1]
# しろのインデックス
WW = []
for i in range(n):
if a[i] == "R":
RR.append(i)
else:
WW.append(i)
WW.append(float("inf"))
if a.count("R") == 0 or a.count("R") == n:
print((0))
exit()
if a.count("W") == 1 or a.count("R") == 1:
... | n = int(eval(input()))
a = list(eval(input()))
# あかのインデックス
RR = []
for i in range(n):
if a[i] == "R":
RR.append(i)
v = a.count("R")
ans = v
for i in range(len(RR)):
if RR[i] + 1 <= v:
ans -= 1
print(ans)
| false | 75.714286 | [
"-RR = [-1]",
"-# しろのインデックス",
"-WW = []",
"+RR = []",
"- else:",
"- WW.append(i)",
"-WW.append(float(\"inf\"))",
"-if a.count(\"R\") == 0 or a.count(\"R\") == n:",
"- print((0))",
"- exit()",
"-if a.count(\"W\") == 1 or a.count(\"R\") == 1:",
"- print((1))",
"- exit()",... | false | 0.1852 | 0.231684 | 0.799363 | [
"s287056241",
"s206846512"
] |
u059210959 | p02713 | python | s406717833 | s791543433 | 1,980 | 385 | 10,940 | 10,948 | Accepted | Accepted | 80.56 | # encoding:utf-8
import copy
import random
import bisect #bisect_left これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
# import math
import sys
import collections
from math import gcd
mod = 10**9+7
sys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000
d = collections.deque()
def LI(): return list(map(int, sys.... | # encoding:utf-8
import copy
import random
import bisect #bisect_left これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
# import math
import sys
import collections
from math import gcd
mod = 10**9+7
sys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000
d = collections.deque()
def LI(): return list(map(int, sys.... | 40 | 62 | 800 | 1,163 | # encoding:utf-8
import copy
import random
import bisect # bisect_left これで二部探索の大小検索が行える
import fractions # 最小公倍数などはこっち
# import math
import sys
import collections
from math import gcd
mod = 10**9 + 7
sys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000
d = collections.deque()
def LI():
return list(map(int, sys.s... | # encoding:utf-8
import copy
import random
import bisect # bisect_left これで二部探索の大小検索が行える
import fractions # 最小公倍数などはこっち
# import math
import sys
import collections
from math import gcd
mod = 10**9 + 7
sys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000
d = collections.deque()
def LI():
return list(map(int, sys.s... | false | 35.483871 | [
"+\"\"\"answer 2 ぎりぎり",
"- for k in range(1, K + 1):",
"- ans += gcd(gcd(i, j), k)",
"+ for k in range(1, K +1):",
"+ ans += gcd(gcd(i,j), k)",
"+\"\"\"",
"+ans = 0",
"+# (1,2,3)",
"+for i in range(1, K + 1):",
"+ for j in range(i + 1, K + 1):",
"+ f... | false | 0.092025 | 0.057113 | 1.611287 | [
"s406717833",
"s791543433"
] |
u203843959 | p02735 | python | s102500293 | s437792325 | 318 | 29 | 54,492 | 3,316 | Accepted | Accepted | 90.88 | import heapq
H,W=list(map(int,input().split()))
mat=[]
for i in range(H):
array=[x=='.' for x in eval(input())]
mat.append(array)
#print(mat)
#convert mat to graph
#(i0,j0)->(i1,j1,dist)
graph={}
if mat[0][0]:
graph[(0,0)]=[(1,1,0)]
else:
graph[(0,0)]=[(1,1,1)]
for i in range(H):
for ... | import heapq
H,W=list(map(int,input().split()))
mat=[]
for i in range(H):
array=[x=='.' for x in eval(input())]
mat.append(array)
#print(mat)
dist=[]
for i in range(H):
dist.append([-1]*W)
if mat[0][0]:
dist[0][0]=0
else:
dist[0][0]=1
for i in range(1,H):
if mat[i-1][0] and not ma... | 63 | 47 | 1,272 | 869 | import heapq
H, W = list(map(int, input().split()))
mat = []
for i in range(H):
array = [x == "." for x in eval(input())]
mat.append(array)
# print(mat)
# convert mat to graph
# (i0,j0)->(i1,j1,dist)
graph = {}
if mat[0][0]:
graph[(0, 0)] = [(1, 1, 0)]
else:
graph[(0, 0)] = [(1, 1, 1)]
for i in range(H... | import heapq
H, W = list(map(int, input().split()))
mat = []
for i in range(H):
array = [x == "." for x in eval(input())]
mat.append(array)
# print(mat)
dist = []
for i in range(H):
dist.append([-1] * W)
if mat[0][0]:
dist[0][0] = 0
else:
dist[0][0] = 1
for i in range(1, H):
if mat[i - 1][0] an... | false | 25.396825 | [
"-# convert mat to graph",
"-# (i0,j0)->(i1,j1,dist)",
"-graph = {}",
"+dist = []",
"+for i in range(H):",
"+ dist.append([-1] * W)",
"- graph[(0, 0)] = [(1, 1, 0)]",
"+ dist[0][0] = 0",
"- graph[(0, 0)] = [(1, 1, 1)]",
"-for i in range(H):",
"- for j in range(W):",
"- gr... | false | 0.133108 | 0.035566 | 3.742626 | [
"s102500293",
"s437792325"
] |
u146803137 | p02989 | python | s760097571 | s160976456 | 84 | 65 | 14,428 | 20,516 | Accepted | Accepted | 22.62 | import math
def py():
print("Yes")
def pn():
print("No")
def iin():
x = int(eval(input()))
return x
neko = 0
nya = 0
nuko = 0
n = iin()
d = [int(x) for x in input().split()]
d.sort()
neko = int(n/2 - 1)
nuko = neko + 1
if d[neko] != d[nuko]:
for i in range(d[nuko]-d[neko]):
... | n = int(eval(input()))
d = list(map(int,input().split()))
d = sorted(d)
ans = d[n//2] - d[n//2-1]
print(ans)
| 24 | 5 | 352 | 107 | import math
def py():
print("Yes")
def pn():
print("No")
def iin():
x = int(eval(input()))
return x
neko = 0
nya = 0
nuko = 0
n = iin()
d = [int(x) for x in input().split()]
d.sort()
neko = int(n / 2 - 1)
nuko = neko + 1
if d[neko] != d[nuko]:
for i in range(d[nuko] - d[neko]):
nya =... | n = int(eval(input()))
d = list(map(int, input().split()))
d = sorted(d)
ans = d[n // 2] - d[n // 2 - 1]
print(ans)
| false | 79.166667 | [
"-import math",
"-",
"-",
"-def py():",
"- print(\"Yes\")",
"-",
"-",
"-def pn():",
"- print(\"No\")",
"-",
"-",
"-def iin():",
"- x = int(eval(input()))",
"- return x",
"-",
"-",
"-neko = 0",
"-nya = 0",
"-nuko = 0",
"-n = iin()",
"-d = [int(x) for x in input().s... | false | 0.076256 | 0.073193 | 1.041849 | [
"s760097571",
"s160976456"
] |
u463950771 | p03294 | python | s861572064 | s896842773 | 94 | 31 | 3,316 | 3,316 | Accepted | Accepted | 67.02 | N = eval(input())
a = list(map(int, input().split()))
summ = 1
for i in a:
summ *= i
summ2 = 0
for i in a:
summ2 += (summ-1)% i
print(summ2) | N = eval(input())
a = list(map(int, input().split()))
summ2 = sum(a) - int(N)
print(summ2) | 12 | 6 | 156 | 91 | N = eval(input())
a = list(map(int, input().split()))
summ = 1
for i in a:
summ *= i
summ2 = 0
for i in a:
summ2 += (summ - 1) % i
print(summ2)
| N = eval(input())
a = list(map(int, input().split()))
summ2 = sum(a) - int(N)
print(summ2)
| false | 50 | [
"-summ = 1",
"-for i in a:",
"- summ *= i",
"-summ2 = 0",
"-for i in a:",
"- summ2 += (summ - 1) % i",
"+summ2 = sum(a) - int(N)"
] | false | 0.037302 | 0.075643 | 0.493135 | [
"s861572064",
"s896842773"
] |
u453055089 | p02837 | python | s316056385 | s456148053 | 277 | 256 | 45,788 | 45,296 | Accepted | Accepted | 7.58 | n = int(eval(input()))
a_list = []
xy_list = []
for i in range(n):
A = int(eval(input()))
a_list.append(A)
xy = [list(map(int, input().split())) for _ in range(A)]
xy_list.append(xy)
ans = 0
for i in range(2**n):
flag = True
for j in range(n): # 人jについて
if (i >> j) & 1 ==... | n = int(eval(input()))
a = [0]*n
xy = [0]*n
for i in range(n):
a[i] = int(eval(input()))
xy[i] = [list(map(int, input().split())) for _ in range(a[i])]
ans = 0
for i in range(2**n):
flag = True
for j in range(n):
if i >> j & 1 == 1: # 右からj番目の人は正直もの
for k in range(a[j]):... | 33 | 27 | 946 | 741 | n = int(eval(input()))
a_list = []
xy_list = []
for i in range(n):
A = int(eval(input()))
a_list.append(A)
xy = [list(map(int, input().split())) for _ in range(A)]
xy_list.append(xy)
ans = 0
for i in range(2**n):
flag = True
for j in range(n): # 人jについて
if (i >> j) & 1 == 1: # 人jが正直ならば
... | n = int(eval(input()))
a = [0] * n
xy = [0] * n
for i in range(n):
a[i] = int(eval(input()))
xy[i] = [list(map(int, input().split())) for _ in range(a[i])]
ans = 0
for i in range(2**n):
flag = True
for j in range(n):
if i >> j & 1 == 1: # 右からj番目の人は正直もの
for k in range(a[j]):
... | false | 18.181818 | [
"-a_list = []",
"-xy_list = []",
"+a = [0] * n",
"+xy = [0] * n",
"- A = int(eval(input()))",
"- a_list.append(A)",
"- xy = [list(map(int, input().split())) for _ in range(A)]",
"- xy_list.append(xy)",
"+ a[i] = int(eval(input()))",
"+ xy[i] = [list(map(int, input().split())) for... | false | 0.037732 | 0.044729 | 0.843557 | [
"s316056385",
"s456148053"
] |
u102278909 | p02848 | python | s049711696 | s086851630 | 267 | 207 | 48,496 | 42,472 | Accepted | Accepted | 22.47 | # coding: utf-8
import sys
import math
import collections
import itertools
from inspect import currentframe
INF = 10 ** 10
MOD = 10 ** 9 + 7
def input() : return sys.stdin.readline().strip()
def gcd(x, y) : return y if x % y == 0 else gcd(y, x % y)
def lcm(x, y) : return (x * y) // gcd(x, y)
def I() : retu... | # coding: utf-8
import sys
import math
import collections
import itertools
INF = 10 ** 10
MOD = 10 ** 9 + 7
def input() : return sys.stdin.readline().strip()
def gcd(x, y) : return y if x % y == 0 else gcd(y, x % y)
def lcm(x, y) : return (x * y) // gcd(x, y)
def I() : return int(input())
def LI() : return... | 26 | 22 | 957 | 608 | # coding: utf-8
import sys
import math
import collections
import itertools
from inspect import currentframe
INF = 10**10
MOD = 10**9 + 7
def input():
return sys.stdin.readline().strip()
def gcd(x, y):
return y if x % y == 0 else gcd(y, x % y)
def lcm(x, y):
return (x * y) // gcd(x, y)
def I():
... | # coding: utf-8
import sys
import math
import collections
import itertools
INF = 10**10
MOD = 10**9 + 7
def input():
return sys.stdin.readline().strip()
def gcd(x, y):
return y if x % y == 0 else gcd(y, x % y)
def lcm(x, y):
return (x * y) // gcd(x, y)
def I():
return int(input())
def LI():
... | false | 15.384615 | [
"-from inspect import currentframe",
"-def MI():",
"- return map(int, input().split())",
"-",
"-",
"-def chkprint(*args):",
"- names = {id(v): k for k, v in currentframe().f_back.f_locals.items()}",
"- print(\", \".join(names.get(id(arg), \"???\") + \" = \" + repr(arg) for arg in args))",
"... | false | 0.070537 | 0.045617 | 1.546288 | [
"s049711696",
"s086851630"
] |
u911575040 | p03287 | python | s301424151 | s854961495 | 104 | 92 | 17,368 | 16,996 | Accepted | Accepted | 11.54 | import collections
N, M = list(map(int, input().split()))
A = [int(i)%M for i in input().split()]
B = [0]
sum_ = 0
for a in A:
sum_ = (sum_ + a) % M
B.append(sum_)
b = collections.Counter(B)
ans = 0
for c in list(b.values()):
ans += int(c * (c - 1) / 2)
print(ans) | from collections import Counter
from itertools import accumulate
from operator import add, mul
n,m=list(map(int,input().split()))
a=list(map(int,input().split()))
ans=0
b= list(accumulate(a, add))
b=list([x%m for x in b])
c=Counter(b)
c[0]=c[0]+1
ans=0
for i in list(c.values()):
ans+=i*(i-1)//2
prin... | 13 | 15 | 276 | 318 | import collections
N, M = list(map(int, input().split()))
A = [int(i) % M for i in input().split()]
B = [0]
sum_ = 0
for a in A:
sum_ = (sum_ + a) % M
B.append(sum_)
b = collections.Counter(B)
ans = 0
for c in list(b.values()):
ans += int(c * (c - 1) / 2)
print(ans)
| from collections import Counter
from itertools import accumulate
from operator import add, mul
n, m = list(map(int, input().split()))
a = list(map(int, input().split()))
ans = 0
b = list(accumulate(a, add))
b = list([x % m for x in b])
c = Counter(b)
c[0] = c[0] + 1
ans = 0
for i in list(c.values()):
ans += i * (i... | false | 13.333333 | [
"-import collections",
"+from collections import Counter",
"+from itertools import accumulate",
"+from operator import add, mul",
"-N, M = list(map(int, input().split()))",
"-A = [int(i) % M for i in input().split()]",
"-B = [0]",
"-sum_ = 0",
"-for a in A:",
"- sum_ = (sum_ + a) % M",
"- ... | false | 0.04631 | 0.03835 | 1.207569 | [
"s301424151",
"s854961495"
] |
u156815136 | p02725 | python | s160572722 | s749591001 | 186 | 160 | 26,420 | 34,680 | Accepted | Accepted | 13.98 | k,n = list(map(int, input().split()))
a = list(map(int,input().split()))
max_dist = 0
for i in range(n):
nxt = (i + 1) %n
distance = a[nxt] - a[i]
if distance < 0:
distance += k
max_dist = max(max_dist, distance)
print((k - max_dist)) | #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... | 10 | 41 | 259 | 972 | k, n = list(map(int, input().split()))
a = list(map(int, input().split()))
max_dist = 0
for i in range(n):
nxt = (i + 1) % n
distance = a[nxt] - a[i]
if distance < 0:
distance += k
max_dist = max(max_dist, distance)
print((k - max_dist))
| # 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 | 75.609756 | [
"-k, n = list(map(int, input().split()))",
"-a = list(map(int, input().split()))",
"+# 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, perm... | false | 0.036816 | 0.096063 | 0.383245 | [
"s160572722",
"s749591001"
] |
u644907318 | p02838 | python | s102816843 | s135708469 | 1,427 | 768 | 151,784 | 195,948 | Accepted | Accepted | 46.18 | p = 10**9+7
N = int(eval(input()))
A = list(input().split())
B = [0 for _ in range(N)]
for i in range(N):
a = A[i]
b = bin(int(a))[2:]
b = "0"*(60-len(b))+b
B[i] = b
C = {i:0 for i in range(60)}
for j in range(60):
cnt = 0
for i in range(N):
if B[i][j]=="1":
cnt... | p0 = 10**9+7
def pow(x,m):
if m==0:
return 1
if m==1:
return x
if m%2==0:
return (pow(x,m//2)**2)%p0
else:
return (x*(pow(x,(m-1)//2)**2)%p0)%p0
N = int(eval(input()))
A = list(map(int,input().split()))
A = [bin(A[i])[2:] for i in range(N)]
A = ["0"*(60-len... | 22 | 29 | 480 | 643 | p = 10**9 + 7
N = int(eval(input()))
A = list(input().split())
B = [0 for _ in range(N)]
for i in range(N):
a = A[i]
b = bin(int(a))[2:]
b = "0" * (60 - len(b)) + b
B[i] = b
C = {i: 0 for i in range(60)}
for j in range(60):
cnt = 0
for i in range(N):
if B[i][j] == "1":
cnt +=... | p0 = 10**9 + 7
def pow(x, m):
if m == 0:
return 1
if m == 1:
return x
if m % 2 == 0:
return (pow(x, m // 2) ** 2) % p0
else:
return (x * (pow(x, (m - 1) // 2) ** 2) % p0) % p0
N = int(eval(input()))
A = list(map(int, input().split()))
A = [bin(A[i])[2:] for i in range... | false | 24.137931 | [
"-p = 10**9 + 7",
"+p0 = 10**9 + 7",
"+",
"+",
"+def pow(x, m):",
"+ if m == 0:",
"+ return 1",
"+ if m == 1:",
"+ return x",
"+ if m % 2 == 0:",
"+ return (pow(x, m // 2) ** 2) % p0",
"+ else:",
"+ return (x * (pow(x, (m - 1) // 2) ** 2) % p0) % p0",
... | false | 0.037584 | 0.045069 | 0.833932 | [
"s102816843",
"s135708469"
] |
u391675400 | p02696 | python | s236838013 | s244995074 | 24 | 22 | 9,164 | 9,164 | Accepted | Accepted | 8.33 |
a,b,n = list(map(int,input().split()))
x = min(b-1,n)
print((((a * x)//b)) )
|
a,b,n = list(map(int,input().split()))
if b > n:
x = n
else:
x = b - 1
print((((a * x)//b)) )
| 6 | 10 | 79 | 109 | a, b, n = list(map(int, input().split()))
x = min(b - 1, n)
print((((a * x) // b)))
| a, b, n = list(map(int, input().split()))
if b > n:
x = n
else:
x = b - 1
print((((a * x) // b)))
| false | 40 | [
"-x = min(b - 1, n)",
"+if b > n:",
"+ x = n",
"+else:",
"+ x = b - 1"
] | false | 0.065286 | 0.080001 | 0.816063 | [
"s236838013",
"s244995074"
] |
u330661451 | p02773 | python | s004868854 | s360907760 | 674 | 541 | 47,668 | 35,936 | Accepted | Accepted | 19.73 | from collections import Counter
def main():
n = int(eval(input()))
s = [eval(input()) for _ in range(n)]
C = Counter(s)
cl = C.most_common()
mx = cl[0][1]
ans = []
for c in cl:
if (c[1] == mx):
ans.append(c[0])
else:
break
ans.sort()... | from collections import Counter
def main():
n = int(eval(input()))
s = [eval(input()) for _ in range(n)]
C = Counter(s)
mx = max(C.values())
ans = []
for k,v in list(C.items()):
if v == mx:
ans.append(k)
ans.sort()
print(("\n".join(ans)))
if __name__... | 21 | 17 | 389 | 327 | from collections import Counter
def main():
n = int(eval(input()))
s = [eval(input()) for _ in range(n)]
C = Counter(s)
cl = C.most_common()
mx = cl[0][1]
ans = []
for c in cl:
if c[1] == mx:
ans.append(c[0])
else:
break
ans.sort()
for i in a... | from collections import Counter
def main():
n = int(eval(input()))
s = [eval(input()) for _ in range(n)]
C = Counter(s)
mx = max(C.values())
ans = []
for k, v in list(C.items()):
if v == mx:
ans.append(k)
ans.sort()
print(("\n".join(ans)))
if __name__ == "__main__... | false | 19.047619 | [
"- cl = C.most_common()",
"- mx = cl[0][1]",
"+ mx = max(C.values())",
"- for c in cl:",
"- if c[1] == mx:",
"- ans.append(c[0])",
"- else:",
"- break",
"+ for k, v in list(C.items()):",
"+ if v == mx:",
"+ ans.append(k)",
"-... | false | 0.063821 | 0.063477 | 1.005414 | [
"s004868854",
"s360907760"
] |
u333945892 | p02953 | python | s377182936 | s347801164 | 90 | 83 | 15,992 | 14,252 | Accepted | Accepted | 7.78 | from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,copy,time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(eval(input()))
def inpl(): return list(map(int, input().split()))
def inpl_str(): return list(input().split())
... | N = int(eval(input()))
hh = list(map(int, input().split()))
for i in range(1, N):
if hh[i - 1] == hh[i]:
continue
else:
hh[i] -= 1
if hh[i - 1] > hh[i]:
print("No")
exit()
print("Yes")
| 24 | 13 | 551 | 237 | from collections import defaultdict, deque
import sys, heapq, bisect, math, itertools, string, queue, copy, time
sys.setrecursionlimit(10**8)
INF = float("inf")
mod = 10**9 + 7
eps = 10**-7
def inp():
return int(eval(input()))
def inpl():
return list(map(int, input().split()))
def inpl_str():
return ... | N = int(eval(input()))
hh = list(map(int, input().split()))
for i in range(1, N):
if hh[i - 1] == hh[i]:
continue
else:
hh[i] -= 1
if hh[i - 1] > hh[i]:
print("No")
exit()
print("Yes")
| false | 45.833333 | [
"-from collections import defaultdict, deque",
"-import sys, heapq, bisect, math, itertools, string, queue, copy, time",
"-",
"-sys.setrecursionlimit(10**8)",
"-INF = float(\"inf\")",
"-mod = 10**9 + 7",
"-eps = 10**-7",
"-",
"-",
"-def inp():",
"- return int(eval(input()))",
"-",
"-",
... | false | 0.007531 | 0.087293 | 0.086271 | [
"s377182936",
"s347801164"
] |
u077291787 | p03722 | python | s148633637 | s592902688 | 542 | 432 | 3,312 | 3,312 | Accepted | Accepted | 20.3 | # ABC061D - Score Attack
import sys
input = sys.stdin.readline
def bellman_ford(N: int, M: int, E: "Array[Array[int]]") -> int or None:
INF = float("inf")
dist = [INF] * (N + 1)
dist[1] = 0
# relax edges
for i in range(N):
for v, u, w in E: # w: positive -> -w
if v... | # ABC061D - Score Attack
import sys
input = sys.stdin.readline
def bellman_ford(N: int, M: int, E: "Array[Array[int]]") -> int or None:
INF = float("inf")
dist = [INF] * (N + 1)
dist[1] = 0
# relax edges
for i in range(N):
for v, u, w in E: # w: positive -> -w
if d... | 30 | 30 | 878 | 865 | # ABC061D - Score Attack
import sys
input = sys.stdin.readline
def bellman_ford(N: int, M: int, E: "Array[Array[int]]") -> int or None:
INF = float("inf")
dist = [INF] * (N + 1)
dist[1] = 0
# relax edges
for i in range(N):
for v, u, w in E: # w: positive -> -w
if v != INF and... | # ABC061D - Score Attack
import sys
input = sys.stdin.readline
def bellman_ford(N: int, M: int, E: "Array[Array[int]]") -> int or None:
INF = float("inf")
dist = [INF] * (N + 1)
dist[1] = 0
# relax edges
for i in range(N):
for v, u, w in E: # w: positive -> -w
if dist[v] - w ... | false | 0 | [
"- if v != INF and dist[v] - w < dist[u]:",
"+ if dist[v] - w < dist[u]:"
] | false | 0.182726 | 0.097457 | 1.874933 | [
"s148633637",
"s592902688"
] |
u610042046 | p03290 | python | s272001321 | s177511236 | 134 | 123 | 9,212 | 9,132 | Accepted | Accepted | 8.21 | d, g = list(map(int, input().split()))
pc = [list(map(int,input().split())) for _ in range(d)]
ans = g//100 + 1
for i in range(2**d):
count = 0
total = 0
for j in range(d):
if (i >> j) & 1 == 1:
count += pc[j][0]
total += (j+1)*100*pc[j][0] + pc[j][1]
if tot... | d, g = list(map(int, input().split()))
pc = [list(map(int,input().split())) for _ in range(d)]
ans = g//100 + 1
for i in range(2**d):
count = 0
total = 0
for j in range(d):
if (i >> j) & 1 == 1:
count += pc[j][0]
total += (j+1)*100*pc[j][0] + pc[j][1]
if tot... | 25 | 25 | 682 | 684 | d, g = list(map(int, input().split()))
pc = [list(map(int, input().split())) for _ in range(d)]
ans = g // 100 + 1
for i in range(2**d):
count = 0
total = 0
for j in range(d):
if (i >> j) & 1 == 1:
count += pc[j][0]
total += (j + 1) * 100 * pc[j][0] + pc[j][1]
if total >=... | d, g = list(map(int, input().split()))
pc = [list(map(int, input().split())) for _ in range(d)]
ans = g // 100 + 1
for i in range(2**d):
count = 0
total = 0
for j in range(d):
if (i >> j) & 1 == 1:
count += pc[j][0]
total += (j + 1) * 100 * pc[j][0] + pc[j][1]
if total >=... | false | 0 | [
"- for _ in range(pc[k][0]):",
"+ for _ in range(pc[k][0] - 1):",
"+ count += 1",
"+ total += (k + 1) * 100",
"- count += 1",
"- total += (k + 1) * 100"
] | false | 0.109729 | 0.048986 | 2.240012 | [
"s272001321",
"s177511236"
] |
u746419473 | p03110 | python | s627436734 | s494342715 | 20 | 17 | 2,940 | 2,940 | Accepted | Accepted | 15 | n = int(eval(input()))
ans = 0
for _ in range(n):
x, u = list(map(str, input().split()))
x = float(x)
if u == "JPY":
ans += x
elif u == "BTC":
ans += x*380000.0
print(ans)
| n = int(eval(input()))
ans = 0
for _ in range(n):
x, u = list(map(str, input().split()))
x = float(x)
if u == "BTC":
ans += x*380000
else:
ans += x
print(ans)
| 11 | 11 | 203 | 190 | n = int(eval(input()))
ans = 0
for _ in range(n):
x, u = list(map(str, input().split()))
x = float(x)
if u == "JPY":
ans += x
elif u == "BTC":
ans += x * 380000.0
print(ans)
| n = int(eval(input()))
ans = 0
for _ in range(n):
x, u = list(map(str, input().split()))
x = float(x)
if u == "BTC":
ans += x * 380000
else:
ans += x
print(ans)
| false | 0 | [
"- if u == \"JPY\":",
"+ if u == \"BTC\":",
"+ ans += x * 380000",
"+ else:",
"- elif u == \"BTC\":",
"- ans += x * 380000.0"
] | false | 0.04464 | 0.045391 | 0.983456 | [
"s627436734",
"s494342715"
] |
u452512115 | p02689 | python | s400777019 | s994432677 | 435 | 360 | 42,976 | 29,416 | Accepted | Accepted | 17.24 | N, M = list(map(int, input().split()))
H = list(map(int, input().split()))
AB = [tuple(map(int, input().split())) for i in range(M)]
graph = [[] for _ in range(N)]
for a, b in AB:
a, b = a-1, b-1
graph[a].append(b)
graph[b].append(a)
ans = 0
for i, h in enumerate(H):
flag = True
for t... | N, M = list(map(int, input().split()))
H = list(map(int, input().split()))
#AB = [tuple(map(int, input().split())) for i in range(M)]
#丸暗記。隣接リストの初期化
graph = [[] for _ in range(N)]
for _ in range(M):
a, b = list(map(int, input().split()))
graph[a-1].append(b-1)
graph[b-1].append(a-1)
ans = 0
... | 27 | 26 | 445 | 457 | N, M = list(map(int, input().split()))
H = list(map(int, input().split()))
AB = [tuple(map(int, input().split())) for i in range(M)]
graph = [[] for _ in range(N)]
for a, b in AB:
a, b = a - 1, b - 1
graph[a].append(b)
graph[b].append(a)
ans = 0
for i, h in enumerate(H):
flag = True
for to in gr... | N, M = list(map(int, input().split()))
H = list(map(int, input().split()))
# AB = [tuple(map(int, input().split())) for i in range(M)]
# 丸暗記。隣接リストの初期化
graph = [[] for _ in range(N)]
for _ in range(M):
a, b = list(map(int, input().split()))
graph[a - 1].append(b - 1)
graph[b - 1].append(a - 1)
ans = 0
fo... | false | 3.703704 | [
"-AB = [tuple(map(int, input().split())) for i in range(M)]",
"+# AB = [tuple(map(int, input().split())) for i in range(M)]",
"+# 丸暗記。隣接リストの初期化",
"-for a, b in AB:",
"- a, b = a - 1, b - 1",
"- graph[a].append(b)",
"- graph[b].append(a)",
"+for _ in range(M):",
"+ a, b = list(map(int, in... | false | 0.039737 | 0.10227 | 0.388548 | [
"s400777019",
"s994432677"
] |
u276115223 | p02981 | python | s668999024 | s329115615 | 22 | 17 | 2,940 | 2,940 | Accepted | Accepted | 22.73 | # ABC 133: A – T or T
n, a, b = [int(s) for s in input().split()]
print((min(a * n, b))) | # ABC 133: A – T or T
n, a, b = list(map(int, input().split()))
print((min(a * n, b))) | 3 | 3 | 88 | 80 | # ABC 133: A – T or T
n, a, b = [int(s) for s in input().split()]
print((min(a * n, b)))
| # ABC 133: A – T or T
n, a, b = list(map(int, input().split()))
print((min(a * n, b)))
| false | 0 | [
"-n, a, b = [int(s) for s in input().split()]",
"+n, a, b = list(map(int, input().split()))"
] | false | 0.045593 | 0.047226 | 0.965407 | [
"s668999024",
"s329115615"
] |
u046187684 | p02948 | python | s607023958 | s736444474 | 432 | 399 | 25,840 | 25,580 | Accepted | Accepted | 7.64 | import heapq
def solve(string):
n, m, *ab = list(map(int, string.split()))
ab = sorted([(a, b) for a, b in zip(*[iter(ab)] * 2)])
hq, index, cap, count, ans = [], 0, 1, m, 0
while index < n:
_a, _b = ab[index]
if _a > m:
break
if _a <= cap:
h... | import heapq
def solve(string):
n, m, *ab = list(map(int, string.split()))
ab = sorted([(a, b) for a, b in zip(*[iter(ab)] * 2)])
hq, index, cap, count, ans = [], 0, 1, m, 0
while index < n:
_a, _b = ab[index]
if _a > m:
break
if _a <= cap:
h... | 25 | 25 | 737 | 732 | import heapq
def solve(string):
n, m, *ab = list(map(int, string.split()))
ab = sorted([(a, b) for a, b in zip(*[iter(ab)] * 2)])
hq, index, cap, count, ans = [], 0, 1, m, 0
while index < n:
_a, _b = ab[index]
if _a > m:
break
if _a <= cap:
heapq.heappus... | import heapq
def solve(string):
n, m, *ab = list(map(int, string.split()))
ab = sorted([(a, b) for a, b in zip(*[iter(ab)] * 2)])
hq, index, cap, count, ans = [], 0, 1, m, 0
while index < n:
_a, _b = ab[index]
if _a > m:
break
if _a <= cap:
heapq.heappus... | false | 0 | [
"- ans -= heapq.heappop(hq) if len(hq) > 0 else 0",
"+ ans += -heapq.heappop(hq) if len(hq) > 0 else 0",
"- ans -= sum([heapq.heappop(hq) if len(hq) > 0 else 0 for _ in range(count)])",
"+ ans += sum([-heapq.heappop(hq) for _ in range(count) if len(hq) > 0])"
] | false | 0.044564 | 0.045586 | 0.977585 | [
"s607023958",
"s736444474"
] |
u054556734 | p03854 | python | s058114621 | s248733933 | 328 | 275 | 19,644 | 19,764 | Accepted | Accepted | 16.16 | import numpy as np
import scipy.sparse as sps
import scipy.misc as spm
import collections as col
import functools as func
import itertools as ite
import fractions as frac
import math as ma
from math import cos,sin,tan
import cmath as cma
import copy as cp
import sys
def sinput(): return sys.stdin.readline()... | import numpy as np
import scipy.sparse as sps
import scipy.misc as spm
import collections as col
import functools as func
import itertools as ite
import fractions as frac
import math as ma
from math import cos,sin,tan
import cmath as cma
import copy as cp
import sys
def sinput(): return sys.stdin.readline()... | 42 | 42 | 1,086 | 1,056 | import numpy as np
import scipy.sparse as sps
import scipy.misc as spm
import collections as col
import functools as func
import itertools as ite
import fractions as frac
import math as ma
from math import cos, sin, tan
import cmath as cma
import copy as cp
import sys
def sinput():
return sys.stdin.readline().str... | import numpy as np
import scipy.sparse as sps
import scipy.misc as spm
import collections as col
import functools as func
import itertools as ite
import fractions as frac
import math as ma
from math import cos, sin, tan
import cmath as cma
import copy as cp
import sys
def sinput():
return sys.stdin.readline().str... | false | 0 | [
"-s = sinput()[::-1]",
"-a = \"dream\"[::-1]",
"-b = \"dreamer\"[::-1]",
"-c = \"erase\"[::-1]",
"-d = \"eraser\"[::-1]",
"+s = sinput()",
"+a = \"dream\"",
"+b = \"dreamer\"",
"+c = \"erase\"",
"+d = \"eraser\""
] | false | 0.31534 | 0.200706 | 1.571157 | [
"s058114621",
"s248733933"
] |
u488401358 | p02635 | python | s007544899 | s268271159 | 1,897 | 1,719 | 108,476 | 107,040 | Accepted | Accepted | 9.38 | S,K=input().split()
K=int(K)
K=min(K,300)
mod=998244353
a=[]
val=0
for i in range(len(S)):
if S[i]=="0":
a.append(val)
val=0
else:
val+=1
if val!=0:
a.append(val)
m=len(a)
K=min(sum(a),K)
dp=[[[0 for i in range(K+1)] for j in range(K+1)] for k in range(m+1)]
fo... | S,K=input().split()
K=int(K)
K=min(K,300)
mod=998244353
a=[]
val=0
for i in range(len(S)):
if S[i]=="0":
a.append(val)
val=0
else:
val+=1
if val!=0:
a.append(val)
m=len(a)
K=min(sum(a),K)
dp=[[0 for i in range(K+1)] for j in range(K+1)]
for j in range(K+1):
... | 38 | 40 | 828 | 854 | S, K = input().split()
K = int(K)
K = min(K, 300)
mod = 998244353
a = []
val = 0
for i in range(len(S)):
if S[i] == "0":
a.append(val)
val = 0
else:
val += 1
if val != 0:
a.append(val)
m = len(a)
K = min(sum(a), K)
dp = [[[0 for i in range(K + 1)] for j in range(K + 1)] for k in rang... | S, K = input().split()
K = int(K)
K = min(K, 300)
mod = 998244353
a = []
val = 0
for i in range(len(S)):
if S[i] == "0":
a.append(val)
val = 0
else:
val += 1
if val != 0:
a.append(val)
m = len(a)
K = min(sum(a), K)
dp = [[0 for i in range(K + 1)] for j in range(K + 1)]
for j in range... | false | 5 | [
"-dp = [[[0 for i in range(K + 1)] for j in range(K + 1)] for k in range(m + 1)]",
"+dp = [[0 for i in range(K + 1)] for j in range(K + 1)]",
"- dp[m][j][j] = 1",
"+ dp[j][j] = 1",
"+ ndp = [[0 for j in range(K + 1)] for k in range(K + 1)]",
"- dp[i][j][k] = sum(",
"- ... | false | 0.059268 | 0.05749 | 1.030932 | [
"s007544899",
"s268271159"
] |
u396495667 | p03777 | python | s845404019 | s794915153 | 168 | 17 | 38,256 | 2,940 | Accepted | Accepted | 89.88 | a,b = input().split()
if a ==b:
print('H')
else:
print('D') | a,b = input().split()
if a == b== 'H' or a==b=='D':
print('H')
else:
print('D') | 6 | 5 | 69 | 87 | a, b = input().split()
if a == b:
print("H")
else:
print("D")
| a, b = input().split()
if a == b == "H" or a == b == "D":
print("H")
else:
print("D")
| false | 16.666667 | [
"-if a == b:",
"+if a == b == \"H\" or a == b == \"D\":"
] | false | 0.106647 | 0.040304 | 2.646096 | [
"s845404019",
"s794915153"
] |
u852690916 | p03295 | python | s314068922 | s815075714 | 735 | 439 | 65,496 | 56,924 | Accepted | Accepted | 40.27 | N,M=list(map(int, input().split()))
AB=[]
for _ in range(M):
a,b=[int(x)-1 for x in input().split()]
AB.append((a,b,b*10**6+a))
AB.sort(key=lambda x:x[2])
ans=0
i=0
k=0
while i<N-1 and k<M:
a,b,c=AB[k]
i=b-1
ans+=1
j=k+1
while j<M:
a,b,c=AB[j]
if i<a: break
... | import sys
def main():
input = sys.stdin.readline
N,M=list(map(int, input().split()))
AB=[tuple(map(int, input().split())) for _ in range(M)]
from operator import itemgetter
AB.sort(key=itemgetter(1))
ans=0
last=-1
for a,b in AB:
if last<=a:
ans+=1
... | 20 | 17 | 350 | 383 | N, M = list(map(int, input().split()))
AB = []
for _ in range(M):
a, b = [int(x) - 1 for x in input().split()]
AB.append((a, b, b * 10**6 + a))
AB.sort(key=lambda x: x[2])
ans = 0
i = 0
k = 0
while i < N - 1 and k < M:
a, b, c = AB[k]
i = b - 1
ans += 1
j = k + 1
while j < M:
a, b, c... | import sys
def main():
input = sys.stdin.readline
N, M = list(map(int, input().split()))
AB = [tuple(map(int, input().split())) for _ in range(M)]
from operator import itemgetter
AB.sort(key=itemgetter(1))
ans = 0
last = -1
for a, b in AB:
if last <= a:
ans += 1
... | false | 15 | [
"-N, M = list(map(int, input().split()))",
"-AB = []",
"-for _ in range(M):",
"- a, b = [int(x) - 1 for x in input().split()]",
"- AB.append((a, b, b * 10**6 + a))",
"-AB.sort(key=lambda x: x[2])",
"-ans = 0",
"-i = 0",
"-k = 0",
"-while i < N - 1 and k < M:",
"- a, b, c = AB[k]",
"- ... | false | 0.032475 | 0.034655 | 0.9371 | [
"s314068922",
"s815075714"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.