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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
u780025254 | p02398 | python | s190514862 | s330689404 | 30 | 20 | 5,600 | 5,596 | Accepted | Accepted | 33.33 | a, b, c = list(map(int, input().split()))
result = []
for i in range(a, b+1):
if c % i == 0:
result.append(i)
print((len(result)))
| a, b, c = list(map(int, input().split()))
count = 0
for i in range(a, b + 1):
if c % i == 0:
count += 1
print(count)
| 6 | 8 | 140 | 132 | a, b, c = list(map(int, input().split()))
result = []
for i in range(a, b + 1):
if c % i == 0:
result.append(i)
print((len(result)))
| a, b, c = list(map(int, input().split()))
count = 0
for i in range(a, b + 1):
if c % i == 0:
count += 1
print(count)
| false | 25 | [
"-result = []",
"+count = 0",
"- result.append(i)",
"-print((len(result)))",
"+ count += 1",
"+print(count)"
] | false | 0.045806 | 0.048863 | 0.937433 | [
"s190514862",
"s330689404"
] |
u796942881 | p03309 | python | s688704442 | s795812646 | 223 | 194 | 25,772 | 25,180 | Accepted | Accepted | 13 | input = open(0).read
N, *An = list(map(int, input().split()))
def main():
for i in range(N):
An[i] = An[i] - i - 1
ans = 0
An.sort()
for i in range(N):
ans += abs(An[i] - An[N // 2])
print(ans)
return
main()
| def main():
N, *A = list(map(int, open(0).read().split()))
for i in range(N):
A[i] -= i + 1
A.sort()
ans = 0
b = A[N // 2]
for i in range(N):
ans += abs(A[i] - b)
print(ans)
return
main()
| 21 | 14 | 271 | 245 | input = open(0).read
N, *An = list(map(int, input().split()))
def main():
for i in range(N):
An[i] = An[i] - i - 1
ans = 0
An.sort()
for i in range(N):
ans += abs(An[i] - An[N // 2])
print(ans)
return
main()
| def main():
N, *A = list(map(int, open(0).read().split()))
for i in range(N):
A[i] -= i + 1
A.sort()
ans = 0
b = A[N // 2]
for i in range(N):
ans += abs(A[i] - b)
print(ans)
return
main()
| false | 33.333333 | [
"-input = open(0).read",
"-N, *An = list(map(int, input().split()))",
"-",
"-",
"+ N, *A = list(map(int, open(0).read().split()))",
"- An[i] = An[i] - i - 1",
"+ A[i] -= i + 1",
"+ A.sort()",
"- An.sort()",
"+ b = A[N // 2]",
"- ans += abs(An[i] - An[N // 2])",
... | false | 0.039832 | 0.1162 | 0.342785 | [
"s688704442",
"s795812646"
] |
u163320134 | p03006 | python | s730635339 | s036548167 | 626 | 21 | 3,064 | 3,444 | Accepted | Accepted | 96.65 | n=int(eval(input()))
arr=[list(map(int,input().split())) for _ in range(n)]
arr=sorted(arr,key=lambda x:x[1])
arr=sorted(arr,key=lambda x:x[0])
ans=n
for i in range(n):
for j in range(i+1,n):
p,q=arr[j][0]-arr[i][0],arr[j][1]-arr[i][1]
cnt=0
flag=[0]*n
for k in range(n):
if flag[k]==1... | n=int(eval(input()))
arr=[list(map(int,input().split())) for _ in range(n)]
cnt={}
for i in range(n):
for j in range(n):
if i==j:
continue
p=arr[i][0]-arr[j][0]
q=arr[i][1]-arr[j][1]
if (p,q) not in cnt:
cnt[(p,q)]=1
else:
cnt[(p,q)]+=1
if n==1:
print((1))
else:
... | 29 | 18 | 694 | 352 | n = int(eval(input()))
arr = [list(map(int, input().split())) for _ in range(n)]
arr = sorted(arr, key=lambda x: x[1])
arr = sorted(arr, key=lambda x: x[0])
ans = n
for i in range(n):
for j in range(i + 1, n):
p, q = arr[j][0] - arr[i][0], arr[j][1] - arr[i][1]
cnt = 0
flag = [0] * n
... | n = int(eval(input()))
arr = [list(map(int, input().split())) for _ in range(n)]
cnt = {}
for i in range(n):
for j in range(n):
if i == j:
continue
p = arr[i][0] - arr[j][0]
q = arr[i][1] - arr[j][1]
if (p, q) not in cnt:
cnt[(p, q)] = 1
else:
... | false | 37.931034 | [
"-arr = sorted(arr, key=lambda x: x[1])",
"-arr = sorted(arr, key=lambda x: x[0])",
"-ans = n",
"+cnt = {}",
"- for j in range(i + 1, n):",
"- p, q = arr[j][0] - arr[i][0], arr[j][1] - arr[i][1]",
"- cnt = 0",
"- flag = [0] * n",
"- for k in range(n):",
"- ... | false | 0.068966 | 0.037268 | 1.850539 | [
"s730635339",
"s036548167"
] |
u285443936 | p03721 | python | s863676525 | s800088480 | 496 | 436 | 27,872 | 29,144 | Accepted | Accepted | 12.1 | N, K = list(map(int, input().split()))
ab = [list(map(int, input().split())) for i in range(N)]
ab.sort()
counter = 0
array1 = []
for i in range(N):
counter += ab[i][1]
if K <= counter:
ans = ab[i][0]
break
print(ans) | N, K = list(map(int, input().split()))
array = [list(map(int, input().split())) for i in range(N)]
array.sort(key=lambda x:x[0])
i,j = 0,0
while i < K:
i += array[j][1]
j += 1
print((array[j-1][0]))
| 14 | 8 | 239 | 202 | N, K = list(map(int, input().split()))
ab = [list(map(int, input().split())) for i in range(N)]
ab.sort()
counter = 0
array1 = []
for i in range(N):
counter += ab[i][1]
if K <= counter:
ans = ab[i][0]
break
print(ans)
| N, K = list(map(int, input().split()))
array = [list(map(int, input().split())) for i in range(N)]
array.sort(key=lambda x: x[0])
i, j = 0, 0
while i < K:
i += array[j][1]
j += 1
print((array[j - 1][0]))
| false | 42.857143 | [
"-ab = [list(map(int, input().split())) for i in range(N)]",
"-ab.sort()",
"-counter = 0",
"-array1 = []",
"-for i in range(N):",
"- counter += ab[i][1]",
"- if K <= counter:",
"- ans = ab[i][0]",
"- break",
"-print(ans)",
"+array = [list(map(int, input().split())) for i in r... | false | 0.039793 | 0.039876 | 0.997911 | [
"s863676525",
"s800088480"
] |
u197968862 | p02702 | python | s714333032 | s754526510 | 112 | 63 | 9,344 | 68,620 | Accepted | Accepted | 43.75 | s = eval(input())
#s = '9' * 200000
mod = [1] + [0]*2018
t = 0
a = 1
n = len(s)
s = s[::-1]
for i in range(n):
t = (t + int(s[i])*a) % 2019
a = a * 10 % 2019
mod[t] += 1
ans = 0
for i in range(2019):
ans += mod[i]*(mod[i]-1)//2
print(ans) | s = eval(input())
#s = '9' * 200000
mod = [1] + [0]*2018
t, a, n = 0 , 1, len(s)
s = s[::-1]
for i in range(n):
t = (t + int(s[i])*a) % 2019
a = a * 10 % 2019
mod[t] += 1
ans = 0
for i in range(2019):
ans += mod[i]*(mod[i]-1)//2
print(ans) | 16 | 14 | 264 | 263 | s = eval(input())
# s = '9' * 200000
mod = [1] + [0] * 2018
t = 0
a = 1
n = len(s)
s = s[::-1]
for i in range(n):
t = (t + int(s[i]) * a) % 2019
a = a * 10 % 2019
mod[t] += 1
ans = 0
for i in range(2019):
ans += mod[i] * (mod[i] - 1) // 2
print(ans)
| s = eval(input())
# s = '9' * 200000
mod = [1] + [0] * 2018
t, a, n = 0, 1, len(s)
s = s[::-1]
for i in range(n):
t = (t + int(s[i]) * a) % 2019
a = a * 10 % 2019
mod[t] += 1
ans = 0
for i in range(2019):
ans += mod[i] * (mod[i] - 1) // 2
print(ans)
| false | 12.5 | [
"-t = 0",
"-a = 1",
"-n = len(s)",
"+t, a, n = 0, 1, len(s)"
] | false | 0.044552 | 0.036783 | 1.211236 | [
"s714333032",
"s754526510"
] |
u373047809 | p03450 | python | s649070289 | s209928664 | 1,190 | 751 | 8,944 | 52,000 | Accepted | Accepted | 36.89 | #!/usr/bin/env python3
class WeightedUnionFind():
def __init__(self, n):
self.n = n
self.parents = [-1] * n
self.weight = [0] * n
def find(self, x):
if self.parents[x] < 0:
return x
else:
px = self.find(self.parents[x])
sel... | #!/usr/bin/env python3
class WeightedUnionFind():
def __init__(self, n):
self.n = n
self.parents = [-1] * n
self.weight = [0] * n
def find(self, x):
if self.parents[x] < 0:
return x
else:
px = self.find(self.parents[x])
sel... | 55 | 48 | 1,375 | 1,270 | #!/usr/bin/env python3
class WeightedUnionFind:
def __init__(self, n):
self.n = n
self.parents = [-1] * n
self.weight = [0] * n
def find(self, x):
if self.parents[x] < 0:
return x
else:
px = self.find(self.parents[x])
self.weight[x] +=... | #!/usr/bin/env python3
class WeightedUnionFind:
def __init__(self, n):
self.n = n
self.parents = [-1] * n
self.weight = [0] * n
def find(self, x):
if self.parents[x] < 0:
return x
else:
px = self.find(self.parents[x])
self.weight[x] +=... | false | 12.727273 | [
"- x, y = y, x",
"- w = -w",
"+ x, y, w = y, x, -w",
"- return self.weight[y] - self.weight[x]",
"-",
"- def size(self, x):",
"- return -self.parents[self.find(x)]",
"+ return self.weig(y) - self.weig(x)",
"-n, m = map(int, input().split())",
... | false | 0.042246 | 0.068728 | 0.614675 | [
"s649070289",
"s209928664"
] |
u439396449 | p03476 | python | s412434846 | s194640469 | 1,049 | 296 | 9,076 | 7,684 | Accepted | Accepted | 71.78 | import math
Q = int(eval(input()))
# 素数表
n = 100000
P = [False] * n
P[2] = True
for i in range(3, n, 2):
k = True
for j in range(3, int(math.sqrt(i)) + 1, 2):
if i % j == 0:
k = False
break
if k:
P[i] = True
# Nと(N+1)÷2が素数か否か
a = [0] * n
for i in... | import sys
from itertools import accumulate
input = sys.stdin.readline
N = int(eval(input()))
def prime_boolean_table(n):
primes = [True] * (n + 1)
primes[0] = False
primes[1] = False
for i in range(2, n + 1):
if primes[i]:
for j in range(i + i, n + 1, i):
... | 30 | 30 | 535 | 619 | import math
Q = int(eval(input()))
# 素数表
n = 100000
P = [False] * n
P[2] = True
for i in range(3, n, 2):
k = True
for j in range(3, int(math.sqrt(i)) + 1, 2):
if i % j == 0:
k = False
break
if k:
P[i] = True
# Nと(N+1)÷2が素数か否か
a = [0] * n
for i in range(1, n, 2):
... | import sys
from itertools import accumulate
input = sys.stdin.readline
N = int(eval(input()))
def prime_boolean_table(n):
primes = [True] * (n + 1)
primes[0] = False
primes[1] = False
for i in range(2, n + 1):
if primes[i]:
for j in range(i + i, n + 1, i):
primes[j... | false | 0 | [
"-import math",
"+import sys",
"+from itertools import accumulate",
"-Q = int(eval(input()))",
"-# 素数表",
"-n = 100000",
"-P = [False] * n",
"-P[2] = True",
"-for i in range(3, n, 2):",
"- k = True",
"- for j in range(3, int(math.sqrt(i)) + 1, 2):",
"- if i % j == 0:",
"- ... | false | 0.613425 | 0.160688 | 3.817487 | [
"s412434846",
"s194640469"
] |
u729133443 | p02854 | python | s112855509 | s153156472 | 312 | 150 | 102,024 | 25,124 | Accepted | Accepted | 51.92 | n,*a=list(map(int,open(0).read().split()))
s=sum(a)
for i in range(1,n):a[i]+=a[i-1]
print((min(abs(t*2-s)for t in a))) | n,*a=list(map(int,open(0).read().split()))
s=sum(a)
c=0
m=[]
for b in a:c+=b;m+=abs(c+c-s),
print((min(m))) | 4 | 6 | 114 | 104 | n, *a = list(map(int, open(0).read().split()))
s = sum(a)
for i in range(1, n):
a[i] += a[i - 1]
print((min(abs(t * 2 - s) for t in a)))
| n, *a = list(map(int, open(0).read().split()))
s = sum(a)
c = 0
m = []
for b in a:
c += b
m += (abs(c + c - s),)
print((min(m)))
| false | 33.333333 | [
"-for i in range(1, n):",
"- a[i] += a[i - 1]",
"-print((min(abs(t * 2 - s) for t in a)))",
"+c = 0",
"+m = []",
"+for b in a:",
"+ c += b",
"+ m += (abs(c + c - s),)",
"+print((min(m)))"
] | false | 0.071972 | 0.071494 | 1.006685 | [
"s112855509",
"s153156472"
] |
u057964173 | p03957 | python | s173510446 | s788336381 | 20 | 18 | 2,940 | 2,940 | Accepted | Accepted | 10 | import sys
def input(): return sys.stdin.readline().strip()
def resolve():
s=eval(input())
if 'C' in s:
if 'F' in s[s.index('C'):]:
print('Yes')
else:
print('No')
else:
print('No')
resolve() |
import sys
def input(): return sys.stdin.readline().strip()
def resolve():
s=eval(input())
if 'C' in s and 'F' in s and s.find('C')<s.rfind('F'):
print('Yes')
else:
print('No')
resolve() | 12 | 11 | 255 | 220 | import sys
def input():
return sys.stdin.readline().strip()
def resolve():
s = eval(input())
if "C" in s:
if "F" in s[s.index("C") :]:
print("Yes")
else:
print("No")
else:
print("No")
resolve()
| import sys
def input():
return sys.stdin.readline().strip()
def resolve():
s = eval(input())
if "C" in s and "F" in s and s.find("C") < s.rfind("F"):
print("Yes")
else:
print("No")
resolve()
| false | 8.333333 | [
"- if \"C\" in s:",
"- if \"F\" in s[s.index(\"C\") :]:",
"- print(\"Yes\")",
"- else:",
"- print(\"No\")",
"+ if \"C\" in s and \"F\" in s and s.find(\"C\") < s.rfind(\"F\"):",
"+ print(\"Yes\")"
] | false | 0.047427 | 0.048431 | 0.979269 | [
"s173510446",
"s788336381"
] |
u945228737 | p03014 | python | s016343191 | s769521745 | 1,304 | 537 | 433,844 | 206,032 | Accepted | Accepted | 58.82 | # import sys
# sys.setrecursionlimit(10 ** 6)
# import bisect
# from collections import deque
# from decorator import stop_watch
#
#
# @stop_watch
def solve(H, W, Si):
Si = ['#' * (W + 2)] + ['#' + S + '#' for S in Si] + ['#' * (W + 2)]
lamp_map = [[[-1, -1] for _ in range(W + 2)] for _ in range(H +... | # 解説を参考に作成
# import sys
# sys.setrecursionlimit(10 ** 6)
# import bisect
# from collections import deque
# from decorator import stop_watch
#
#
# @stop_watch
def solve(H, W, Si):
R = [[0] * W for _ in range(H)]
L = [[0] * W for _ in range(H)]
D = [[0] * W for _ in range(H)]
U = [[0] * W f... | 50 | 74 | 1,500 | 1,926 | # import sys
# sys.setrecursionlimit(10 ** 6)
# import bisect
# from collections import deque
# from decorator import stop_watch
#
#
# @stop_watch
def solve(H, W, Si):
Si = ["#" * (W + 2)] + ["#" + S + "#" for S in Si] + ["#" * (W + 2)]
lamp_map = [[[-1, -1] for _ in range(W + 2)] for _ in range(H + 2)]
ans... | # 解説を参考に作成
# import sys
# sys.setrecursionlimit(10 ** 6)
# import bisect
# from collections import deque
# from decorator import stop_watch
#
#
# @stop_watch
def solve(H, W, Si):
R = [[0] * W for _ in range(H)]
L = [[0] * W for _ in range(H)]
D = [[0] * W for _ in range(H)]
U = [[0] * W for _ in range(H... | false | 32.432432 | [
"+# 解説を参考に作成",
"- Si = [\"#\" * (W + 2)] + [\"#\" + S + \"#\" for S in Si] + [\"#\" * (W + 2)]",
"- lamp_map = [[[-1, -1] for _ in range(W + 2)] for _ in range(H + 2)]",
"+ R = [[0] * W for _ in range(H)]",
"+ L = [[0] * W for _ in range(H)]",
"+ D = [[0] * W for _ in range(H)]",
"+ U ... | false | 0.048156 | 0.039974 | 1.204683 | [
"s016343191",
"s769521745"
] |
u645855527 | p03222 | python | s488585198 | s828409044 | 93 | 86 | 68,764 | 73,812 | Accepted | Accepted | 7.53 | h, w, K = list(map(int, input().split()))
mod = 10**9+7
dp = [[0] * w for _ in range(h+1)]
dp[0][0] = 1
for i in range(1, h+1):
for j in range(w):
left, center, right = 0, 0, 0
for k in range(2**(w-1)):
invalid = False
for l in range(1, w-1):
i... | H, W, K = list(map(int, input().split()))
mod = 10**9 + 7
dp = [[0] * W for _ in range(H + 1)]
dp[0][0] = 1
def fib(n):
if n <= 1:
return 1
return fib(n-1) + fib(n-2)
for i in range(1, H+1):
for j in range(W):
left = j
right = W - j - 1
dp[i][j] = dp[i... | 44 | 29 | 1,003 | 570 | h, w, K = list(map(int, input().split()))
mod = 10**9 + 7
dp = [[0] * w for _ in range(h + 1)]
dp[0][0] = 1
for i in range(1, h + 1):
for j in range(w):
left, center, right = 0, 0, 0
for k in range(2 ** (w - 1)):
invalid = False
for l in range(1, w - 1):
if k ... | H, W, K = list(map(int, input().split()))
mod = 10**9 + 7
dp = [[0] * W for _ in range(H + 1)]
dp[0][0] = 1
def fib(n):
if n <= 1:
return 1
return fib(n - 1) + fib(n - 2)
for i in range(1, H + 1):
for j in range(W):
left = j
right = W - j - 1
dp[i][j] = dp[i - 1][j] * fib... | false | 34.090909 | [
"-h, w, K = list(map(int, input().split()))",
"+H, W, K = list(map(int, input().split()))",
"-dp = [[0] * w for _ in range(h + 1)]",
"+dp = [[0] * W for _ in range(H + 1)]",
"-for i in range(1, h + 1):",
"- for j in range(w):",
"- left, center, right = 0, 0, 0",
"- for k in range(2 **... | false | 0.065101 | 0.044174 | 1.473723 | [
"s488585198",
"s828409044"
] |
u491550356 | p02660 | python | s723079665 | s952862829 | 165 | 98 | 9,436 | 9,440 | Accepted | Accepted | 40.61 | n = int(eval(input()))
if n == 1:
print((0))
exit()
from collections import Counter
def factorize(n):
d = Counter()
m = 2
while m*m <= n:
while n%m == 0:
n //= m
d[m] += 1
m += 1
if n > 1:
d[n] += 1
return d
fac = factorize... | n = int(eval(input()))
if n == 1:
print((0))
exit()
from collections import Counter
def factorize(n):
d = Counter()
if n < 2:
return d
while n%2 == 0:
n //= 2
d[2] += 1
m = 3
while m*m <= n:
while n%m == 0:
n //= m
... | 27 | 34 | 441 | 543 | n = int(eval(input()))
if n == 1:
print((0))
exit()
from collections import Counter
def factorize(n):
d = Counter()
m = 2
while m * m <= n:
while n % m == 0:
n //= m
d[m] += 1
m += 1
if n > 1:
d[n] += 1
return d
fac = factorize(n)
ans = 0
f... | n = int(eval(input()))
if n == 1:
print((0))
exit()
from collections import Counter
def factorize(n):
d = Counter()
if n < 2:
return d
while n % 2 == 0:
n //= 2
d[2] += 1
m = 3
while m * m <= n:
while n % m == 0:
n //= m
d[m] += 1
... | false | 20.588235 | [
"- m = 2",
"+ if n < 2:",
"+ return d",
"+ while n % 2 == 0:",
"+ n //= 2",
"+ d[2] += 1",
"+ m = 3",
"- m += 1",
"+ m += 2"
] | false | 0.035297 | 0.059667 | 0.591573 | [
"s723079665",
"s952862829"
] |
u588341295 | p03372 | python | s632061308 | s211532265 | 562 | 493 | 20,312 | 36,284 | Accepted | Accepted | 12.28 | # -*- coding: utf-8 -*-
"""
参考:http://blog.livedoor.jp/misteer/archives/9017497.html
https://www.hamayanhamayan.com/entry/2018/04/21/225805
・累積max(累積和の応用)
・先に回る方向がiより手前にmaxがあったとしても、
そのパターンは別の周回のiで考慮されているので、
始点まで戻るマイナス分が多くなっていても問題ない。
どのみち先に回る方向で最終的にansに採用されるのはiまで行った時のはず。
"""
N, C = list(map(int, inpu... | # -*- coding: utf-8 -*-
import sys
def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in ... | 39 | 54 | 975 | 1,428 | # -*- coding: utf-8 -*-
"""
参考:http://blog.livedoor.jp/misteer/archives/9017497.html
https://www.hamayanhamayan.com/entry/2018/04/21/225805
・累積max(累積和の応用)
・先に回る方向がiより手前にmaxがあったとしても、
そのパターンは別の周回のiで考慮されているので、
始点まで戻るマイナス分が多くなっていても問題ない。
どのみち先に回る方向で最終的にansに採用されるのはiまで行った時のはず。
"""
N, C = list(map(int, input().split()))
... | # -*- coding: utf-8 -*-
import sys
def input():
return sys.stdin.readline().strip()
def list2d(a, b, c):
return [[c] * b for i in range(a)]
def list3d(a, b, c, d):
return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e):
return [[[[e] * d for j in range(c)] for j in rang... | false | 27.777778 | [
"-\"\"\"",
"-参考:http://blog.livedoor.jp/misteer/archives/9017497.html",
"- https://www.hamayanhamayan.com/entry/2018/04/21/225805",
"-・累積max(累積和の応用)",
"-・先に回る方向がiより手前にmaxがあったとしても、",
"- そのパターンは別の周回のiで考慮されているので、",
"- 始点まで戻るマイナス分が多くなっていても問題ない。",
"- どのみち先に回る方向で最終的にansに採用されるのはiまで行った時のはず。",
"-\"\"\"",
... | false | 0.035159 | 0.197506 | 0.178015 | [
"s632061308",
"s211532265"
] |
u796942881 | p03240 | python | s352207339 | s231144553 | 101 | 67 | 3,064 | 3,064 | Accepted | Accepted | 33.66 | import sys
N = int(eval(input()))
xn = []
yn = []
hn = []
for i in range(N):
xi, yi, hi = list(map(int, input().split()))
xn.append(xi)
yn.append(yi)
hn.append(hi)
for Cx in range(101):
for Cy in range(101):
last = None
flg = True
for i in range(N)... | def main():
N = int(eval(input()))
xn = []
yn = []
hn = []
for i in range(N):
xi, yi, hi = list(map(int, input().split()))
xn.append(xi)
yn.append(yi)
hn.append(hi)
for Cx in range(101):
for Cy in range(101):
last = None
... | 54 | 41 | 957 | 1,106 | import sys
N = int(eval(input()))
xn = []
yn = []
hn = []
for i in range(N):
xi, yi, hi = list(map(int, input().split()))
xn.append(xi)
yn.append(yi)
hn.append(hi)
for Cx in range(101):
for Cy in range(101):
last = None
flg = True
for i in range(N):
if 0 == hn[i]... | def main():
N = int(eval(input()))
xn = []
yn = []
hn = []
for i in range(N):
xi, yi, hi = list(map(int, input().split()))
xn.append(xi)
yn.append(yi)
hn.append(hi)
for Cx in range(101):
for Cy in range(101):
last = None
flg = True
... | false | 24.074074 | [
"-import sys",
"-",
"-N = int(eval(input()))",
"-xn = []",
"-yn = []",
"-hn = []",
"-for i in range(N):",
"- xi, yi, hi = list(map(int, input().split()))",
"- xn.append(xi)",
"- yn.append(yi)",
"- hn.append(hi)",
"-for Cx in range(101):",
"- for Cy in range(101):",
"- ... | false | 0.059111 | 0.075775 | 0.780095 | [
"s352207339",
"s231144553"
] |
u455354923 | p03086 | python | s139933981 | s119555058 | 111 | 25 | 60,748 | 9,096 | Accepted | Accepted | 77.48 | S=list(eval(input()))
m = 0
ans = 0
for n in S:
if n in ("A","C","G","T"):
m += 1
ans = max(ans,m)
else:
m = 0
print(ans)
| S = eval(input())
cnt,ans=0,0
for i in S:
#print(i)
if i in "ACGT":
cnt += 1
#print(cnt)
else:
#print(cnt,c)
ans = max(ans,cnt)
#print(ans)
cnt = 0
ans = max(ans,cnt)
print(ans)
| 10 | 14 | 157 | 245 | S = list(eval(input()))
m = 0
ans = 0
for n in S:
if n in ("A", "C", "G", "T"):
m += 1
ans = max(ans, m)
else:
m = 0
print(ans)
| S = eval(input())
cnt, ans = 0, 0
for i in S:
# print(i)
if i in "ACGT":
cnt += 1
# print(cnt)
else:
# print(cnt,c)
ans = max(ans, cnt)
# print(ans)
cnt = 0
ans = max(ans, cnt)
print(ans)
| false | 28.571429 | [
"-S = list(eval(input()))",
"-m = 0",
"-ans = 0",
"-for n in S:",
"- if n in (\"A\", \"C\", \"G\", \"T\"):",
"- m += 1",
"- ans = max(ans, m)",
"+S = eval(input())",
"+cnt, ans = 0, 0",
"+for i in S:",
"+ # print(i)",
"+ if i in \"ACGT\":",
"+ cnt += 1",
"+ ... | false | 0.085311 | 0.044885 | 1.900635 | [
"s139933981",
"s119555058"
] |
u281303342 | p03611 | python | s991325425 | s065535199 | 155 | 137 | 15,312 | 15,312 | Accepted | Accepted | 11.61 | from collections import Counter
N = int(eval(input()))
A = Counter(list(map(int,input().split())))
Ans = 0
for n,c in A.most_common():
Ans = max(Ans,A[n]+A[n-1]+A[n+1])
print(Ans) | from collections import Counter
N = int(eval(input()))
A = Counter(list(map(int,input().split())))
Ans = 0
B = A.most_common()
for n,c in B:
Ans = max(Ans,A[n]+A[n-1]+A[n+1])
print(Ans) | 7 | 8 | 183 | 190 | from collections import Counter
N = int(eval(input()))
A = Counter(list(map(int, input().split())))
Ans = 0
for n, c in A.most_common():
Ans = max(Ans, A[n] + A[n - 1] + A[n + 1])
print(Ans)
| from collections import Counter
N = int(eval(input()))
A = Counter(list(map(int, input().split())))
Ans = 0
B = A.most_common()
for n, c in B:
Ans = max(Ans, A[n] + A[n - 1] + A[n + 1])
print(Ans)
| false | 12.5 | [
"-for n, c in A.most_common():",
"+B = A.most_common()",
"+for n, c in B:"
] | false | 0.047251 | 0.04499 | 1.050246 | [
"s991325425",
"s065535199"
] |
u057109575 | p02918 | python | s829183833 | s514391973 | 186 | 64 | 39,024 | 62,276 | Accepted | Accepted | 65.59 | N, K = list(map(int, input().split()))
S = eval(input())
x = S.count("RL")
y = int(S[0] == "L") + int(S[-1] == "R")
print((min(N - 1, N - (x * 2 + y) + K * 2)))
| N, K = list(map(int, input().split()))
S = eval(input())
x = S.count("RL")
y = int(S[0] == "L") + int(S[-1] == "R")
print((min(N - 1, N - 2 * x - y + 2 * K)))
| 7 | 6 | 159 | 151 | N, K = list(map(int, input().split()))
S = eval(input())
x = S.count("RL")
y = int(S[0] == "L") + int(S[-1] == "R")
print((min(N - 1, N - (x * 2 + y) + K * 2)))
| N, K = list(map(int, input().split()))
S = eval(input())
x = S.count("RL")
y = int(S[0] == "L") + int(S[-1] == "R")
print((min(N - 1, N - 2 * x - y + 2 * K)))
| false | 14.285714 | [
"-print((min(N - 1, N - (x * 2 + y) + K * 2)))",
"+print((min(N - 1, N - 2 * x - y + 2 * K)))"
] | false | 0.041609 | 0.037473 | 1.110377 | [
"s829183833",
"s514391973"
] |
u490489966 | p03013 | python | s793919985 | s936859021 | 238 | 220 | 7,768 | 6,900 | Accepted | Accepted | 7.56 | #C
n, m = list(map(int, input().split()))
a = [1] * (n + 1)
mod=1e9+7
for i in range(m):
a[int(eval(input()))] = 0
b = [1] * (n + 1)
if a[1] == 0:
b[1] = 0
for i in range(2, n + 1):
b[i] = int(a[i] * (b[i - 2] + b[i - 1]) % mod)
print((b[n])) | #C
n, m = list(map(int, input().split()))
a = [1] * (n + 1)#進めるかどうか
b = [1] * (n + 1)#移動方法
#進めない:0 進める:1
for i in range(m):a[int(eval(input()))] = 0
mod = 1e9+7
# print(a)
if a[1] == 0:b[1] = 0
for i in range(2, n+1):b[i] = (b[i - 1] + b[i - 2]) * a[i] % mod
#b[i]=(b[2段前]+b[1段前])*a[i] 進めるかどうか(1,0)
print(... | 12 | 12 | 251 | 319 | # C
n, m = list(map(int, input().split()))
a = [1] * (n + 1)
mod = 1e9 + 7
for i in range(m):
a[int(eval(input()))] = 0
b = [1] * (n + 1)
if a[1] == 0:
b[1] = 0
for i in range(2, n + 1):
b[i] = int(a[i] * (b[i - 2] + b[i - 1]) % mod)
print((b[n]))
| # C
n, m = list(map(int, input().split()))
a = [1] * (n + 1) # 進めるかどうか
b = [1] * (n + 1) # 移動方法
# 進めない:0 進める:1
for i in range(m):
a[int(eval(input()))] = 0
mod = 1e9 + 7
# print(a)
if a[1] == 0:
b[1] = 0
for i in range(2, n + 1):
b[i] = (b[i - 1] + b[i - 2]) * a[i] % mod
# b[i]=(b[2段前]+b[1段前])*a[i] 進めるかどう... | false | 0 | [
"-a = [1] * (n + 1)",
"-mod = 1e9 + 7",
"+a = [1] * (n + 1) # 進めるかどうか",
"+b = [1] * (n + 1) # 移動方法",
"+# 進めない:0 進める:1",
"-b = [1] * (n + 1)",
"+mod = 1e9 + 7",
"+# print(a)",
"- b[i] = int(a[i] * (b[i - 2] + b[i - 1]) % mod)",
"-print((b[n]))",
"+ b[i] = (b[i - 1] + b[i - 2]) * a[i] % mo... | false | 0.101457 | 0.045072 | 2.250987 | [
"s793919985",
"s936859021"
] |
u941753895 | p02922 | python | s606334303 | s029745281 | 74 | 17 | 6,828 | 2,940 | Accepted | Accepted | 77.03 | import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,queue,copy
sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
de... | # 入力
a,b=list(map(int,input().split()))
# 初期状態(1口)
n=1
# タップの数
ans=0
# タップを1つずつ差していく
# 差すことでa口増えるが、差した口も1つ減る
while True:
# b口以上になったら終了
if n>=b:
print(ans)
exit()
n+=a
n-=1
ans+=1
| 27 | 21 | 649 | 221 | import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, queue, copy
sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]
def LI():
return [int(x) ... | # 入力
a, b = list(map(int, input().split()))
# 初期状態(1口)
n = 1
# タップの数
ans = 0
# タップを1つずつ差していく
# 差すことでa口増えるが、差した口も1つ減る
while True:
# b口以上になったら終了
if n >= b:
print(ans)
exit()
n += a
n -= 1
ans += 1
| false | 22.222222 | [
"-import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, queue, copy",
"-",
"-sys.setrecursionlimit(10**7)",
"-inf = 10**20",
"-mod = 10**9 + 7",
"-dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]",
"-ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1),... | false | 0.037274 | 0.037711 | 0.988419 | [
"s606334303",
"s029745281"
] |
u347640436 | p03161 | python | s962894355 | s256963193 | 1,877 | 1,607 | 13,980 | 20,668 | Accepted | Accepted | 14.38 | # DP(貰うDP)
def main():
from builtins import abs, max, min, range
N, K = list(map(int, input().split()))
h = list(map(int, input().split()))
dp = [0] * N
for i in range(1, N):
dp[i] = min(dp[j] + abs(h[i] - h[j]) for j in range(max(0, i - K), i))
print((dp[N - 1]))
main()
| def main():
from builtins import abs
N, K = list(map(int, input().split()))
h = list(map(int, input().split()))
dp = [0] * N
for i in range(1, N):
dp[i] = min(dp[j] + abs(h[i] - h[j]) for j in range(max(0, i - K), i))
print((dp[N - 1]))
main()
| 13 | 12 | 311 | 282 | # DP(貰うDP)
def main():
from builtins import abs, max, min, range
N, K = list(map(int, input().split()))
h = list(map(int, input().split()))
dp = [0] * N
for i in range(1, N):
dp[i] = min(dp[j] + abs(h[i] - h[j]) for j in range(max(0, i - K), i))
print((dp[N - 1]))
main()
| def main():
from builtins import abs
N, K = list(map(int, input().split()))
h = list(map(int, input().split()))
dp = [0] * N
for i in range(1, N):
dp[i] = min(dp[j] + abs(h[i] - h[j]) for j in range(max(0, i - K), i))
print((dp[N - 1]))
main()
| false | 7.692308 | [
"-# DP(貰うDP)",
"- from builtins import abs, max, min, range",
"+ from builtins import abs"
] | false | 0.031373 | 0.032761 | 0.957614 | [
"s962894355",
"s256963193"
] |
u325227960 | p03013 | python | s930509697 | s548687158 | 243 | 203 | 9,540 | 8,628 | Accepted | Accepted | 16.46 | n,m = list(map(int,input().split()))
A = [int(eval(input())) for i in range(m)]
B = [0 for i in range(10**5+10)]
for i in range(len(A)):
B[A[i]] = 1
mod = 10**9 + 7
DP = [1,1]
if B[1] == 1:
DP[1] = 0
for i in range(2,n+1):
p1 = DP[i-2] % mod
p2 = DP[i-1] % mod
if B[i-2] == 1:
... | n,m = list(map(int,input().split()))
A = [int(eval(input())) for i in range(m)]
B = [0 for i in range(10**5+10)]
for i in range(len(A)):
B[A[i]] = 1
mod = 10**9 + 7
DP = [1,1]
if B[1] == 1:
DP[1] = 0
for i in range(2,n+1):
if B[i] == 0:
DP.append((DP[i-1]+DP[i-2])%mod)
else:
... | 20 | 19 | 395 | 374 | n, m = list(map(int, input().split()))
A = [int(eval(input())) for i in range(m)]
B = [0 for i in range(10**5 + 10)]
for i in range(len(A)):
B[A[i]] = 1
mod = 10**9 + 7
DP = [1, 1]
if B[1] == 1:
DP[1] = 0
for i in range(2, n + 1):
p1 = DP[i - 2] % mod
p2 = DP[i - 1] % mod
if B[i - 2] == 1:
p... | n, m = list(map(int, input().split()))
A = [int(eval(input())) for i in range(m)]
B = [0 for i in range(10**5 + 10)]
for i in range(len(A)):
B[A[i]] = 1
mod = 10**9 + 7
DP = [1, 1]
if B[1] == 1:
DP[1] = 0
for i in range(2, n + 1):
if B[i] == 0:
DP.append((DP[i - 1] + DP[i - 2]) % mod)
else:
... | false | 5 | [
"- p1 = DP[i - 2] % mod",
"- p2 = DP[i - 1] % mod",
"- if B[i - 2] == 1:",
"- p1 = 0",
"- if B[i - 1] == 1:",
"- p2 = 0",
"- DP.append((p1 + p2) % mod)",
"+ if B[i] == 0:",
"+ DP.append((DP[i - 1] + DP[i - 2]) % mod)",
"+ else:",
"+ DP.append(0)",... | false | 0.092616 | 0.047532 | 1.948508 | [
"s930509697",
"s548687158"
] |
u367701763 | p02889 | python | s765707907 | s772135925 | 1,666 | 805 | 554,788 | 98,368 | Accepted | Accepted | 51.68 | class Graph:
class Edge:
def __init__(self, to, cost):
"""
:param to: 終点ノード
:param cost: 辺の重み
"""
self.to, self.cost = to, cost
def __init__(self, n, directed=False, decrement=True, edges=[]):
self.n = n
self.direct... | # https://atcoder.jp/contests/abc143/submissions/15557307
"""
タグ: ワーシャルフロイド
"""
class Graph:
class Edge:
def __init__(self, to, cost):
"""
:param to: 終点ノード
:param cost: 辺の重み
"""
self.to, self.cost = to, cost
def __init__(self... | 93 | 75 | 2,807 | 2,103 | class Graph:
class Edge:
def __init__(self, to, cost):
"""
:param to: 終点ノード
:param cost: 辺の重み
"""
self.to, self.cost = to, cost
def __init__(self, n, directed=False, decrement=True, edges=[]):
self.n = n
self.directed = direct... | # https://atcoder.jp/contests/abc143/submissions/15557307
"""
タグ: ワーシャルフロイド
"""
class Graph:
class Edge:
def __init__(self, to, cost):
"""
:param to: 終点ノード
:param cost: 辺の重み
"""
self.to, self.cost = to, cost
def __init__(self, n, directed=F... | false | 19.354839 | [
"+# https://atcoder.jp/contests/abc143/submissions/15557307",
"+\"\"\"",
"+タグ: ワーシャルフロイド",
"+\"\"\"",
"+",
"+",
"- def warshall_folyd2(self, INF=1 << 30):",
"- \"\"\"",
"- :param INF: INF = 10**18 にすると、負のコストがある場合に少し面倒になる",
"- :return: 頂点 i, j 間の距離を行列として返す",
"- \"\"... | false | 0.107579 | 0.041367 | 2.600635 | [
"s765707907",
"s772135925"
] |
u531599639 | p03030 | python | s530176377 | s932542759 | 26 | 23 | 9,112 | 9,116 | Accepted | Accepted | 11.54 | n=int(eval(input()))
d=list(list(input().split())+[i+1] for i in range(n))
d.sort(key=lambda x:(x[0],-int(x[1])))
for v in d:print((v[2])) | n=int(eval(input()))
d=sorted(list(list(input().split())+[i+1] for i in range(n)),key=lambda x:(x[0],-int(x[1])))
for v in d:print((v[2])) | 4 | 3 | 133 | 132 | n = int(eval(input()))
d = list(list(input().split()) + [i + 1] for i in range(n))
d.sort(key=lambda x: (x[0], -int(x[1])))
for v in d:
print((v[2]))
| n = int(eval(input()))
d = sorted(
list(list(input().split()) + [i + 1] for i in range(n)),
key=lambda x: (x[0], -int(x[1])),
)
for v in d:
print((v[2]))
| false | 25 | [
"-d = list(list(input().split()) + [i + 1] for i in range(n))",
"-d.sort(key=lambda x: (x[0], -int(x[1])))",
"+d = sorted(",
"+ list(list(input().split()) + [i + 1] for i in range(n)),",
"+ key=lambda x: (x[0], -int(x[1])),",
"+)"
] | false | 0.037705 | 0.036375 | 1.036584 | [
"s530176377",
"s932542759"
] |
u934442292 | p02715 | python | s115283606 | s167832226 | 317 | 286 | 11,224 | 11,084 | Accepted | Accepted | 9.78 | import sys
input = sys.stdin.readline
P = 10 ** 9 + 7
def main():
N, K = list(map(int, input().split()))
ans = 0
n_gcd = [0] * (K + 1)
for k in reversed(list(range(1, K + 1))):
n_gcd[k] = pow(K // k, N, mod=P)
for m in range(2, K // k + 1):
n_gcd[k] -= n_gcd... | import sys
input = sys.stdin.readline
P = 10 ** 9 + 7
def main():
N, K = list(map(int, input().split()))
ans = 0
n_gcd = [0] * (K + 1)
for k in reversed(list(range(1, K + 1))):
n = pow(K // k, N, mod=P)
for m in range(2, K // k + 1):
n -= n_gcd[k * m]
... | 23 | 23 | 441 | 430 | import sys
input = sys.stdin.readline
P = 10**9 + 7
def main():
N, K = list(map(int, input().split()))
ans = 0
n_gcd = [0] * (K + 1)
for k in reversed(list(range(1, K + 1))):
n_gcd[k] = pow(K // k, N, mod=P)
for m in range(2, K // k + 1):
n_gcd[k] -= n_gcd[k * m]
n... | import sys
input = sys.stdin.readline
P = 10**9 + 7
def main():
N, K = list(map(int, input().split()))
ans = 0
n_gcd = [0] * (K + 1)
for k in reversed(list(range(1, K + 1))):
n = pow(K // k, N, mod=P)
for m in range(2, K // k + 1):
n -= n_gcd[k * m]
n_gcd[k] = n % ... | false | 0 | [
"- n_gcd[k] = pow(K // k, N, mod=P)",
"+ n = pow(K // k, N, mod=P)",
"- n_gcd[k] -= n_gcd[k * m]",
"- n_gcd[k] %= P",
"+ n -= n_gcd[k * m]",
"+ n_gcd[k] = n % P"
] | false | 0.147148 | 0.106238 | 1.385081 | [
"s115283606",
"s167832226"
] |
u569960318 | p02266 | python | s325498350 | s992100557 | 70 | 30 | 8,716 | 8,048 | Accepted | Accepted | 57.14 | from collections import deque
def scan(que, ps, way):
Li = 0
pp = ps
while len(que) > 0:
if way==0:
p = que.popleft()
else:
p = que.pop()
if p < ps:
Li += ps - p
else:
break
pp = p
return Li
if __n... | DOWN = []
EDGE = []
POOL = []
for i, c in enumerate(eval(input())):
if c == '\\':
DOWN.append(i)
elif c == '/':
if DOWN:
e = DOWN.pop()
Li = i - e # Calcurate 1 line. \______/
while EDGE: # Merge connected pools.
if EDGE[-1] > e:... | 52 | 22 | 1,165 | 536 | from collections import deque
def scan(que, ps, way):
Li = 0
pp = ps
while len(que) > 0:
if way == 0:
p = que.popleft()
else:
p = que.pop()
if p < ps:
Li += ps - p
else:
break
pp = p
return Li
if __name__ == "__m... | DOWN = []
EDGE = []
POOL = []
for i, c in enumerate(eval(input())):
if c == "\\":
DOWN.append(i)
elif c == "/":
if DOWN:
e = DOWN.pop()
Li = i - e # Calcurate 1 line. \______/
while EDGE: # Merge connected pools.
if EDGE[-1] > e:
... | false | 57.692308 | [
"-from collections import deque",
"-",
"-",
"-def scan(que, ps, way):",
"- Li = 0",
"- pp = ps",
"- while len(que) > 0:",
"- if way == 0:",
"- p = que.popleft()",
"- else:",
"- p = que.pop()",
"- if p < ps:",
"- Li += ps - p",
... | false | 0.037735 | 0.036406 | 1.036508 | [
"s325498350",
"s992100557"
] |
u226108478 | p03457 | python | s269558835 | s851853077 | 1,495 | 332 | 72,892 | 11,828 | Accepted | Accepted | 77.79 | # -*- coding: utf-8 -*-
# AtCoder Beginner Contest
# Problem C
class TravelingPlan(object):
def __init__(self):
from collections import OrderedDict
self._points = OrderedDict()
def add_point(self, name: str):
if name not in self._points:
self._points[name] ... | # -*- coding: utf-8 -*-
def main():
n = int(eval(input()))
ts, xs, ys = [0], [0], [0]
for i in range(n):
ti, xi, yi = list(map(int, input().split()))
ts.append(ti)
xs.append(xi)
ys.append(yi)
for j in range(n):
dt = ts[j + 1] - ts[j]
dxy... | 95 | 28 | 2,357 | 553 | # -*- coding: utf-8 -*-
# AtCoder Beginner Contest
# Problem C
class TravelingPlan(object):
def __init__(self):
from collections import OrderedDict
self._points = OrderedDict()
def add_point(self, name: str):
if name not in self._points:
self._points[name] = Point()
... | # -*- coding: utf-8 -*-
def main():
n = int(eval(input()))
ts, xs, ys = [0], [0], [0]
for i in range(n):
ti, xi, yi = list(map(int, input().split()))
ts.append(ti)
xs.append(xi)
ys.append(yi)
for j in range(n):
dt = ts[j + 1] - ts[j]
dxy = (xs[j + 1] - xs[... | false | 70.526316 | [
"-# AtCoder Beginner Contest",
"-# Problem C",
"-class TravelingPlan(object):",
"- def __init__(self):",
"- from collections import OrderedDict",
"-",
"- self._points = OrderedDict()",
"-",
"- def add_point(self, name: str):",
"- if name not in self._points:",
"- ... | false | 0.045127 | 0.068819 | 0.655731 | [
"s269558835",
"s851853077"
] |
u888092736 | p02720 | python | s665206328 | s104600774 | 149 | 98 | 21,200 | 14,524 | Accepted | Accepted | 34.23 | import sys
sys.setrecursionlimit(10 ** 5)
def dfs(v):
ans.append(v)
if v > 1_000_000_000:
return
for d in range(10):
if abs(d - v % 10) <= 1:
nv = v * 10 + d
dfs(nv)
K = int(eval(input()))
ans = []
[dfs(i) for i in range(1, 10)]
print((sorted(an... | import sys
sys.setrecursionlimit(10 ** 5)
def dfs(v):
if v > 3234566667:
return
ans.append(v)
d = v % 10
if d - 1 >= 0:
dfs(v * 10 + d - 1)
dfs(v * 10 + d)
if d + 1 < 10:
dfs(v * 10 + d + 1)
K = int(eval(input()))
ans = []
[dfs(i) for i in range(1,... | 19 | 21 | 324 | 347 | import sys
sys.setrecursionlimit(10**5)
def dfs(v):
ans.append(v)
if v > 1_000_000_000:
return
for d in range(10):
if abs(d - v % 10) <= 1:
nv = v * 10 + d
dfs(nv)
K = int(eval(input()))
ans = []
[dfs(i) for i in range(1, 10)]
print((sorted(ans)[K - 1]))
| import sys
sys.setrecursionlimit(10**5)
def dfs(v):
if v > 3234566667:
return
ans.append(v)
d = v % 10
if d - 1 >= 0:
dfs(v * 10 + d - 1)
dfs(v * 10 + d)
if d + 1 < 10:
dfs(v * 10 + d + 1)
K = int(eval(input()))
ans = []
[dfs(i) for i in range(1, 10)]
print((sorted(a... | false | 9.52381 | [
"+ if v > 3234566667:",
"+ return",
"- if v > 1_000_000_000:",
"- return",
"- for d in range(10):",
"- if abs(d - v % 10) <= 1:",
"- nv = v * 10 + d",
"- dfs(nv)",
"+ d = v % 10",
"+ if d - 1 >= 0:",
"+ dfs(v * 10 + d - 1)",
"+ ... | false | 0.475649 | 0.397409 | 1.196877 | [
"s665206328",
"s104600774"
] |
u593500796 | p03160 | python | s802342515 | s623825786 | 126 | 102 | 13,924 | 20,520 | Accepted | Accepted | 19.05 | N = int(eval(input()))
h = [int(h) for h in input().split()]
def jump(i, j):
return abs(h[j] - h[i])
a, b = 0, jump(0, 1)
for i in range(2, N):
a, b = b, min(b + jump(i - 1, i), a + jump(i - 2, i))
print(b)
| def solve(n, stone_heights):
if n == 0 or n == 1: return 0
if n == 2:
return abs(stone_heights[1] - stone_heights[0])
cost_arr = [0, abs(stone_heights[1] - stone_heights[0])]
i = 2
while i < n:
cost_to_i_from_1_stone_before = abs(stone_heights[i] - stone_heights[i - 1])
cost_to_i_from_2_st... | 10 | 19 | 220 | 791 | N = int(eval(input()))
h = [int(h) for h in input().split()]
def jump(i, j):
return abs(h[j] - h[i])
a, b = 0, jump(0, 1)
for i in range(2, N):
a, b = b, min(b + jump(i - 1, i), a + jump(i - 2, i))
print(b)
| def solve(n, stone_heights):
if n == 0 or n == 1:
return 0
if n == 2:
return abs(stone_heights[1] - stone_heights[0])
cost_arr = [0, abs(stone_heights[1] - stone_heights[0])]
i = 2
while i < n:
cost_to_i_from_1_stone_before = abs(stone_heights[i] - stone_heights[i - 1])
... | false | 47.368421 | [
"-N = int(eval(input()))",
"-h = [int(h) for h in input().split()]",
"+def solve(n, stone_heights):",
"+ if n == 0 or n == 1:",
"+ return 0",
"+ if n == 2:",
"+ return abs(stone_heights[1] - stone_heights[0])",
"+ cost_arr = [0, abs(stone_heights[1] - stone_heights[0])]",
"+ ... | false | 0.042188 | 0.048483 | 0.870163 | [
"s802342515",
"s623825786"
] |
u373047809 | p02603 | python | s092027408 | s696037002 | 33 | 27 | 9,000 | 9,084 | Accepted | Accepted | 18.18 | n, *a = list(map(int, open(0).read().split()))
m = 1000
for a, b in zip(a, a[1:]):
if a < b:m = m // a * b + m % a
print(m) | n, *a = list(map(int, open(0).read().split()))
a += 1,
m = 1000
def groupby():
c, res = [], []
for i in range(n + 1):
if a[i-1] <= a[i]:
pass
else:
res += [c[0], c[-1]],
c = []
c += a[i],
return res
for i, j in groupby():
m = m // i * j + m % i
print(m) | 5 | 18 | 123 | 304 | n, *a = list(map(int, open(0).read().split()))
m = 1000
for a, b in zip(a, a[1:]):
if a < b:
m = m // a * b + m % a
print(m)
| n, *a = list(map(int, open(0).read().split()))
a += (1,)
m = 1000
def groupby():
c, res = [], []
for i in range(n + 1):
if a[i - 1] <= a[i]:
pass
else:
res += ([c[0], c[-1]],)
c = []
c += (a[i],)
return res
for i, j in groupby():
m = m // i... | false | 72.222222 | [
"+a += (1,)",
"-for a, b in zip(a, a[1:]):",
"- if a < b:",
"- m = m // a * b + m % a",
"+",
"+",
"+def groupby():",
"+ c, res = [], []",
"+ for i in range(n + 1):",
"+ if a[i - 1] <= a[i]:",
"+ pass",
"+ else:",
"+ res += ([c[0], c[-1]],)"... | false | 0.049397 | 0.102953 | 0.479807 | [
"s092027408",
"s696037002"
] |
u643679148 | p02724 | python | s173785954 | s411869989 | 296 | 26 | 9,040 | 9,092 | Accepted | Accepted | 91.22 | x = int(eval(input()))
c_500 = 0
c_5 = 0
while True:
temp = x - 500
if temp < 0:
break
else:
c_500 += 1
x = temp
while True:
temp = x - 5
if temp < 0:
break
else:
c_5 += 1
x = temp
print((c_500 * 2 * 500 + c_5 * 5))
| x = int(eval(input()))
c_500 = x // 500
r_500 = x % 500
c_5 = r_500 // 5
print((c_500 * 1000 + c_5 * 5))
| 21 | 7 | 303 | 105 | x = int(eval(input()))
c_500 = 0
c_5 = 0
while True:
temp = x - 500
if temp < 0:
break
else:
c_500 += 1
x = temp
while True:
temp = x - 5
if temp < 0:
break
else:
c_5 += 1
x = temp
print((c_500 * 2 * 500 + c_5 * 5))
| x = int(eval(input()))
c_500 = x // 500
r_500 = x % 500
c_5 = r_500 // 5
print((c_500 * 1000 + c_5 * 5))
| false | 66.666667 | [
"-c_500 = 0",
"-c_5 = 0",
"-while True:",
"- temp = x - 500",
"- if temp < 0:",
"- break",
"- else:",
"- c_500 += 1",
"- x = temp",
"-while True:",
"- temp = x - 5",
"- if temp < 0:",
"- break",
"- else:",
"- c_5 += 1",
"- x =... | false | 0.26313 | 0.035089 | 7.498979 | [
"s173785954",
"s411869989"
] |
u762420987 | p03289 | python | s095544645 | s613873099 | 21 | 17 | 3,316 | 3,060 | Accepted | Accepted | 19.05 | from collections import Counter
S = eval(input())
def lower_s(string):
big_c = 0
for c in string[1:]:
if c == "C":
if big_c == 1:
return False
else:
big_c = 1
continue
if c == c.upper():
return False
... | def is_u(c):
return c == c.upper()
S = eval(input())
a = S[0] == "A"
b = S[2:-1].count("C") == 1
c = sum([int(is_u(c)) for c in S]) == 2
# print(a, b, c)
if a and b and c:
print("AC")
else:
print("WA") | 18 | 11 | 439 | 217 | from collections import Counter
S = eval(input())
def lower_s(string):
big_c = 0
for c in string[1:]:
if c == "C":
if big_c == 1:
return False
else:
big_c = 1
continue
if c == c.upper():
return False
retur... | def is_u(c):
return c == c.upper()
S = eval(input())
a = S[0] == "A"
b = S[2:-1].count("C") == 1
c = sum([int(is_u(c)) for c in S]) == 2
# print(a, b, c)
if a and b and c:
print("AC")
else:
print("WA")
| false | 38.888889 | [
"-from collections import Counter",
"+def is_u(c):",
"+ return c == c.upper()",
"+",
"-",
"-",
"-def lower_s(string):",
"- big_c = 0",
"- for c in string[1:]:",
"- if c == \"C\":",
"- if big_c == 1:",
"- return False",
"- else:",
"- ... | false | 0.043198 | 0.133028 | 0.32473 | [
"s095544645",
"s613873099"
] |
u296215701 | p02952 | python | s246420837 | s029119451 | 70 | 58 | 2,940 | 2,940 | Accepted | Accepted | 17.14 | N = int(eval(input()))
cnt = 0
while N > 0:
s = str(N)
length = len(s)
if length % 2 == 0:
N -= 1
else:
cnt += 1
N -= 1
print(cnt) | N = int(eval(input()))
cnt = 0
for i in range(1, N + 1):
if len(str(i)) % 2 == 1:
cnt += 1
print(cnt) | 13 | 8 | 162 | 110 | N = int(eval(input()))
cnt = 0
while N > 0:
s = str(N)
length = len(s)
if length % 2 == 0:
N -= 1
else:
cnt += 1
N -= 1
print(cnt)
| N = int(eval(input()))
cnt = 0
for i in range(1, N + 1):
if len(str(i)) % 2 == 1:
cnt += 1
print(cnt)
| false | 38.461538 | [
"-while N > 0:",
"- s = str(N)",
"- length = len(s)",
"- if length % 2 == 0:",
"- N -= 1",
"- else:",
"+for i in range(1, N + 1):",
"+ if len(str(i)) % 2 == 1:",
"- N -= 1"
] | false | 0.044864 | 0.040374 | 1.111188 | [
"s246420837",
"s029119451"
] |
u647766105 | p00461 | python | s250386234 | s919498635 | 330 | 260 | 5,316 | 6,708 | Accepted | Accepted | 21.21 | while True:
n = eval(input())
if n == 0:
break
m = eval(input())
s = input()
cur,score = 0,0
for c in s:
if cur <= 2*n:
if cur % 2 == 0:
cur = cur+1 if c=="I" else 0
else:
... | while True:
n = eval(input())
if n == 0:
break
m = eval(input())
s = input()
graph = []
for i in range(n):
graph.append({"I":2*i+1,"O":0,"score":0})
graph.append({"I":1,"O":2*(i+1),"score":0})
graph.append({"I":2*n+1,"... | 17 | 17 | 473 | 520 | while True:
n = eval(input())
if n == 0:
break
m = eval(input())
s = input()
cur, score = 0, 0
for c in s:
if cur <= 2 * n:
if cur % 2 == 0:
cur = cur + 1 if c == "I" else 0
else:
cur = 1 if c == "I" else cur + 1
eli... | while True:
n = eval(input())
if n == 0:
break
m = eval(input())
s = input()
graph = []
for i in range(n):
graph.append({"I": 2 * i + 1, "O": 0, "score": 0})
graph.append({"I": 1, "O": 2 * (i + 1), "score": 0})
graph.append({"I": 2 * n + 1, "O": 0, "score": 0})
gr... | false | 0 | [
"+ graph = []",
"+ for i in range(n):",
"+ graph.append({\"I\": 2 * i + 1, \"O\": 0, \"score\": 0})",
"+ graph.append({\"I\": 1, \"O\": 2 * (i + 1), \"score\": 0})",
"+ graph.append({\"I\": 2 * n + 1, \"O\": 0, \"score\": 0})",
"+ graph.append({\"I\": 1, \"O\": 2 * n, \"score\": ... | false | 0.064893 | 0.042534 | 1.525682 | [
"s250386234",
"s919498635"
] |
u906428167 | p03108 | python | s774211084 | s504051667 | 1,153 | 788 | 107,212 | 26,392 | Accepted | Accepted | 31.66 | n,m = list(map(int,input().split()))
e = [0]*m
for i in range(m):
a,b = list(map(int,input().split()))
e[m-1-i] = [a-1,b-1]
class uf():
def __init__(self,n):
self.n = n
self.root = [-1]*(n+1)
self.rank = [0]*(n+1)
def find(self,x):
if self.root[x] <... | n,m = list(map(int,input().split()))
e = [0]*m
for i in range(m):
a,b = list(map(int,input().split()))
e[m-1-i] = [a-1,b-1]
root = [-1]*n
rank = [0]*n
def find(x):
if root[x] < 0:
return x
else:
root[x] = find(root[x])
return root[x]
def unite(x,y):
... | 57 | 51 | 1,283 | 931 | n, m = list(map(int, input().split()))
e = [0] * m
for i in range(m):
a, b = list(map(int, input().split()))
e[m - 1 - i] = [a - 1, b - 1]
class uf:
def __init__(self, n):
self.n = n
self.root = [-1] * (n + 1)
self.rank = [0] * (n + 1)
def find(self, x):
if self.root[x... | n, m = list(map(int, input().split()))
e = [0] * m
for i in range(m):
a, b = list(map(int, input().split()))
e[m - 1 - i] = [a - 1, b - 1]
root = [-1] * n
rank = [0] * n
def find(x):
if root[x] < 0:
return x
else:
root[x] = find(root[x])
return root[x]
def unite(x, y):
x ... | false | 10.526316 | [
"+root = [-1] * n",
"+rank = [0] * n",
"-class uf:",
"- def __init__(self, n):",
"- self.n = n",
"- self.root = [-1] * (n + 1)",
"- self.rank = [0] * (n + 1)",
"-",
"- def find(self, x):",
"- if self.root[x] < 0:",
"- return x",
"- else:",
... | false | 0.035494 | 0.03615 | 0.981862 | [
"s774211084",
"s504051667"
] |
u796942881 | p03043 | python | s480030021 | s739663709 | 293 | 17 | 3,188 | 3,060 | Accepted | Accepted | 94.2 | import math
def main():
N, K = list(map(int, input().split()))
print(((max(0, N - K + 1) + sum(
max(0, N - (math.ceil(K * (1 / 2) ** i)) + 1) * (1 / 2) ** i
- max(0, N - (math.ceil(K * (1 / 2) ** (i - 1))) + 1) * (1 / 2) ** i
for i in range(1, K))) / N))
return
main()... | import math
def main():
N, K = list(map(int, input().split()))
print(((max(0, N - K + 1) + sum(
max(0, N - (math.ceil(K * (1 / 2) ** i)) + 1) * (1 / 2) ** i
- max(0, N - (math.ceil(K * (1 / 2) ** (i - 1))) + 1) * (1 / 2) ** i
for i in range(1, int(math.log2(K)) + 1 + 1))) / N))... | 13 | 13 | 313 | 337 | import math
def main():
N, K = list(map(int, input().split()))
print(
(
(
max(0, N - K + 1)
+ sum(
max(0, N - (math.ceil(K * (1 / 2) ** i)) + 1) * (1 / 2) ** i
- max(0, N - (math.ceil(K * (1 / 2) ** (i - 1))) + 1) * (1... | import math
def main():
N, K = list(map(int, input().split()))
print(
(
(
max(0, N - K + 1)
+ sum(
max(0, N - (math.ceil(K * (1 / 2) ** i)) + 1) * (1 / 2) ** i
- max(0, N - (math.ceil(K * (1 / 2) ** (i - 1))) + 1) * (1... | false | 0 | [
"- for i in range(1, K)",
"+ for i in range(1, int(math.log2(K)) + 1 + 1)"
] | false | 0.114849 | 0.03647 | 3.149117 | [
"s480030021",
"s739663709"
] |
u849151695 | p02719 | python | s630541681 | s312294271 | 269 | 17 | 2,940 | 2,940 | Accepted | Accepted | 93.68 | #
N, K = list(map(int,input().split()))
N %= K
min = N
for i in range(10**6):
N = abs(N-K)
if min > N:
min = N
if N == 0:
min = 0
break
print(min) | #input
N, K = list(map(int,input().split()))
#main
t = N % K
ans = min(t, K - t)
#output
print(ans) | 12 | 9 | 188 | 103 | #
N, K = list(map(int, input().split()))
N %= K
min = N
for i in range(10**6):
N = abs(N - K)
if min > N:
min = N
if N == 0:
min = 0
break
print(min)
| # input
N, K = list(map(int, input().split()))
# main
t = N % K
ans = min(t, K - t)
# output
print(ans)
| false | 25 | [
"-#",
"+# input",
"-N %= K",
"-min = N",
"-for i in range(10**6):",
"- N = abs(N - K)",
"- if min > N:",
"- min = N",
"- if N == 0:",
"- min = 0",
"- break",
"-print(min)",
"+# main",
"+t = N % K",
"+ans = min(t, K - t)",
"+# output",
"+print(ans)"
] | false | 0.275219 | 0.035601 | 7.730604 | [
"s630541681",
"s312294271"
] |
u089830331 | p02257 | python | s880371202 | s000539013 | 560 | 50 | 7,756 | 7,700 | Accepted | Accepted | 91.07 | def is_prime(n):
for i in range(2, int(n ** 0.5) + 1):
if n % i == 0: return False
return True
count = 0
for i in range(int(eval(input()))):
if is_prime(int(eval(input()))) : count += 1
print(count) | def is_prime(n):
if n == 2: return True
if n < 2 or n % 2 == 0: return False
return pow(2, n - 1, n) == 1
count = 0
for i in range(int(eval(input()))):
if is_prime(int(eval(input()))) : count += 1
print(count) | 9 | 9 | 205 | 214 | def is_prime(n):
for i in range(2, int(n**0.5) + 1):
if n % i == 0:
return False
return True
count = 0
for i in range(int(eval(input()))):
if is_prime(int(eval(input()))):
count += 1
print(count)
| def is_prime(n):
if n == 2:
return True
if n < 2 or n % 2 == 0:
return False
return pow(2, n - 1, n) == 1
count = 0
for i in range(int(eval(input()))):
if is_prime(int(eval(input()))):
count += 1
print(count)
| false | 0 | [
"- for i in range(2, int(n**0.5) + 1):",
"- if n % i == 0:",
"- return False",
"- return True",
"+ if n == 2:",
"+ return True",
"+ if n < 2 or n % 2 == 0:",
"+ return False",
"+ return pow(2, n - 1, n) == 1"
] | false | 0.035757 | 0.035243 | 1.014612 | [
"s880371202",
"s000539013"
] |
u968166680 | p03240 | python | s357023481 | s046146420 | 2,421 | 88 | 74,924 | 73,652 | Accepted | Accepted | 96.37 | import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007
def main():
N, *XYH = list(map(int, read().split()))
for cx in range(101):
for cy in range(101):
ok = 10 ** 9 + 100
... | import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007
def main():
N, *XYH = list(map(int, read().split()))
for x, y, h in zip(*[iter(XYH)] * 3):
if h != 0:
x0, y0, h0 = x... | 43 | 34 | 1,100 | 764 | import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10**9)
INF = 1 << 60
MOD = 1000000007
def main():
N, *XYH = list(map(int, read().split()))
for cx in range(101):
for cy in range(101):
ok = 10**9 + 100
ng = 0
... | import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10**9)
INF = 1 << 60
MOD = 1000000007
def main():
N, *XYH = list(map(int, read().split()))
for x, y, h in zip(*[iter(XYH)] * 3):
if h != 0:
x0, y0, h0 = x, y, h
for cx ... | false | 20.930233 | [
"+ for x, y, h in zip(*[iter(XYH)] * 3):",
"+ if h != 0:",
"+ x0, y0, h0 = x, y, h",
"- ok = 10**9 + 100",
"- ng = 0",
"- while ok - ng > 1:",
"- mid = (ok + ng) // 2",
"- valid = True",
"- for x, y, h... | false | 0.317871 | 0.040216 | 7.90404 | [
"s357023481",
"s046146420"
] |
u222668979 | p02678 | python | s595898965 | s696092714 | 734 | 529 | 76,312 | 156,772 | Accepted | Accepted | 27.93 | from collections import deque
import sys
input = sys.stdin.readline
def bfs(NEAR, S, N): # 幅優先探索 # キュー
pas = [-1 for _ in range(N)]
pas[S] = 's'
frag = set([S])
que = deque([S])
while len(que) > 0:
q = que.popleft()
for i in NEAR[q]:
if i in frag: # 処理... | from collections import deque
def nearlist(N, LIST):
NEAR = [set() for _ in range(N)]
for a, b in LIST:
NEAR[a - 1].add(b - 1)
NEAR[b - 1].add(a - 1)
return NEAR
def bfs(NEAR, S, N): # 幅優先探索 # キュー
PATH = [-1 for _ in range(N)]
PATH[S] = 's'
frag, que = set([S]... | 37 | 35 | 812 | 759 | from collections import deque
import sys
input = sys.stdin.readline
def bfs(NEAR, S, N): # 幅優先探索 # キュー
pas = [-1 for _ in range(N)]
pas[S] = "s"
frag = set([S])
que = deque([S])
while len(que) > 0:
q = que.popleft()
for i in NEAR[q]:
if i in frag: # 処理済みか否か
... | from collections import deque
def nearlist(N, LIST):
NEAR = [set() for _ in range(N)]
for a, b in LIST:
NEAR[a - 1].add(b - 1)
NEAR[b - 1].add(a - 1)
return NEAR
def bfs(NEAR, S, N): # 幅優先探索 # キュー
PATH = [-1 for _ in range(N)]
PATH[S] = "s"
frag, que = set([S]), deque([S])
... | false | 5.405405 | [
"-import sys",
"-input = sys.stdin.readline",
"+",
"+def nearlist(N, LIST):",
"+ NEAR = [set() for _ in range(N)]",
"+ for a, b in LIST:",
"+ NEAR[a - 1].add(b - 1)",
"+ NEAR[b - 1].add(a - 1)",
"+ return NEAR",
"- pas = [-1 for _ in range(N)]",
"- pas[S] = \"s\"",
... | false | 0.034598 | 0.035901 | 0.963729 | [
"s595898965",
"s696092714"
] |
u815659544 | p03208 | python | s698905720 | s628953503 | 245 | 222 | 7,384 | 11,288 | Accepted | Accepted | 9.39 |
import sys
INPUT = sys.stdin.readline
def SINGLE_INT(): return int(INPUT())
def MULTIPLE_INT_LIST(): return list(map(int, INPUT().split()))
def MULTIPLE_INT_MAP(): return list(map(int, INPUT().split()))
def SINGLE_STRING(): return INPUT()
def MULTIPLE_STRING(): return INPUT().split()
N, K = MULTIPLE_INT_MA... |
import sys
INPUT = sys.stdin.readline
def SINGLE_INT(): return int(INPUT())
def MULTIPLE_INT_LIST(): return list(map(int, INPUT().split()))
def MULTIPLE_INT_MAP(): return list(map(int, INPUT().split()))
def SINGLE_STRING(): return INPUT()
def MULTIPLE_STRING(): return INPUT().split()
N, K = MULTIPLE_INT_MA... | 21 | 18 | 514 | 458 | import sys
INPUT = sys.stdin.readline
def SINGLE_INT():
return int(INPUT())
def MULTIPLE_INT_LIST():
return list(map(int, INPUT().split()))
def MULTIPLE_INT_MAP():
return list(map(int, INPUT().split()))
def SINGLE_STRING():
return INPUT()
def MULTIPLE_STRING():
return INPUT().split()
N,... | import sys
INPUT = sys.stdin.readline
def SINGLE_INT():
return int(INPUT())
def MULTIPLE_INT_LIST():
return list(map(int, INPUT().split()))
def MULTIPLE_INT_MAP():
return list(map(int, INPUT().split()))
def SINGLE_STRING():
return INPUT()
def MULTIPLE_STRING():
return INPUT().split()
N,... | false | 14.285714 | [
"-for i in range(0, N - K + 1):",
"- ans = min(ans, trees[i + K - 1] - trees[i])",
"- if ans == 0:",
"- break",
"-print(ans)",
"+print((min([trees[i + K - 1] - trees[i] for i in range(N - K + 1)])))"
] | false | 0.040755 | 0.047893 | 0.850953 | [
"s698905720",
"s628953503"
] |
u707124227 | p03048 | python | s480954142 | s375286048 | 1,741 | 264 | 2,940 | 40,300 | Accepted | Accepted | 84.84 | r,g,b,n=list(map(int,input().split()))
ans=0
for x in range(n//r+1):
for y in range((n-x*r)//g+1):
if (n-x*r-y*g)%b==0:
ans+=1
print(ans) | R,G,B,N=list(map(int,input().split()))
R,G,B=sorted([R,G,B])
ans=0
for b in range(1+N//B):
for g in range(1+(N-b*B)//G):
if (N-b*B-g*G)%R==0:
ans+=1
print(ans) | 7 | 8 | 161 | 197 | r, g, b, n = list(map(int, input().split()))
ans = 0
for x in range(n // r + 1):
for y in range((n - x * r) // g + 1):
if (n - x * r - y * g) % b == 0:
ans += 1
print(ans)
| R, G, B, N = list(map(int, input().split()))
R, G, B = sorted([R, G, B])
ans = 0
for b in range(1 + N // B):
for g in range(1 + (N - b * B) // G):
if (N - b * B - g * G) % R == 0:
ans += 1
print(ans)
| false | 12.5 | [
"-r, g, b, n = list(map(int, input().split()))",
"+R, G, B, N = list(map(int, input().split()))",
"+R, G, B = sorted([R, G, B])",
"-for x in range(n // r + 1):",
"- for y in range((n - x * r) // g + 1):",
"- if (n - x * r - y * g) % b == 0:",
"+for b in range(1 + N // B):",
"+ for g in ra... | false | 0.051456 | 0.042473 | 1.2115 | [
"s480954142",
"s375286048"
] |
u077898957 | p03285 | python | s508025109 | s552343587 | 21 | 18 | 3,316 | 2,940 | Accepted | Accepted | 14.29 | n = int(eval(input()))
money = [4*i + 7*j for i in range(n//4+1) for j in range(n//7+1)]
print(('Yes' if n in money else 'No'))
| n=int(eval(input()))
X=[]
for i in range(0,26):
for j in range(0,15):
if i*4+j*7<=100:
X.append(i*4+j*7)
print(('Yes' if n in X else 'No'))
| 3 | 7 | 122 | 162 | n = int(eval(input()))
money = [4 * i + 7 * j for i in range(n // 4 + 1) for j in range(n // 7 + 1)]
print(("Yes" if n in money else "No"))
| n = int(eval(input()))
X = []
for i in range(0, 26):
for j in range(0, 15):
if i * 4 + j * 7 <= 100:
X.append(i * 4 + j * 7)
print(("Yes" if n in X else "No"))
| false | 57.142857 | [
"-money = [4 * i + 7 * j for i in range(n // 4 + 1) for j in range(n // 7 + 1)]",
"-print((\"Yes\" if n in money else \"No\"))",
"+X = []",
"+for i in range(0, 26):",
"+ for j in range(0, 15):",
"+ if i * 4 + j * 7 <= 100:",
"+ X.append(i * 4 + j * 7)",
"+print((\"Yes\" if n in X ... | false | 0.03591 | 0.035966 | 0.998455 | [
"s508025109",
"s552343587"
] |
u440566786 | p03377 | python | s999409317 | s424186045 | 177 | 66 | 38,256 | 61,872 | Accepted | Accepted | 62.71 | a,b,x = map(int,input().split())
print("YES") if a<=x<=a+b else print("NO")
| import sys
INF = 1 << 60
MOD = 10**9 + 7 # 998244353
sys.setrecursionlimit(2147483647)
input = lambda:sys.stdin.readline().rstrip()
def resolve():
a, b, x = list(map(int, input().split()))
print(("YES" if a <= x <= a + b else "NO"))
resolve() | 2 | 9 | 76 | 250 | a, b, x = map(int, input().split())
print("YES") if a <= x <= a + b else print("NO")
| import sys
INF = 1 << 60
MOD = 10**9 + 7 # 998244353
sys.setrecursionlimit(2147483647)
input = lambda: sys.stdin.readline().rstrip()
def resolve():
a, b, x = list(map(int, input().split()))
print(("YES" if a <= x <= a + b else "NO"))
resolve()
| false | 77.777778 | [
"-a, b, x = map(int, input().split())",
"-print(\"YES\") if a <= x <= a + b else print(\"NO\")",
"+import sys",
"+",
"+INF = 1 << 60",
"+MOD = 10**9 + 7 # 998244353",
"+sys.setrecursionlimit(2147483647)",
"+input = lambda: sys.stdin.readline().rstrip()",
"+",
"+",
"+def resolve():",
"+ a, ... | false | 0.065106 | 0.074498 | 0.873928 | [
"s999409317",
"s424186045"
] |
u392319141 | p02837 | python | s212139006 | s188855189 | 257 | 198 | 45,548 | 3,064 | Accepted | Accepted | 22.96 | N = int(eval(input()))
M = []
for _ in range(N):
A = int(eval(input()))
state = []
for _ in range(A):
x, y = list(map(int, input().split()))
x -= 1
state.append((x, y))
M.append(state)
ans = 0
for mask in range(1 << N):
can = True
for i, s in enumerate(M)... | N = int(eval(input()))
S = []
for _ in range(N):
A = int(eval(input()))
S.append([tuple(map(int, input().split())) for _ in range(A)])
def sol(state):
for i, A in enumerate(S):
if (state & (1 << i)) == 0:
continue
for j, s in A:
if ((state & (1 << (j - 1... | 30 | 20 | 678 | 483 | N = int(eval(input()))
M = []
for _ in range(N):
A = int(eval(input()))
state = []
for _ in range(A):
x, y = list(map(int, input().split()))
x -= 1
state.append((x, y))
M.append(state)
ans = 0
for mask in range(1 << N):
can = True
for i, s in enumerate(M):
if (mas... | N = int(eval(input()))
S = []
for _ in range(N):
A = int(eval(input()))
S.append([tuple(map(int, input().split())) for _ in range(A)])
def sol(state):
for i, A in enumerate(S):
if (state & (1 << i)) == 0:
continue
for j, s in A:
if ((state & (1 << (j - 1))) != 0) !=... | false | 33.333333 | [
"-M = []",
"+S = []",
"- state = []",
"- for _ in range(A):",
"- x, y = list(map(int, input().split()))",
"- x -= 1",
"- state.append((x, y))",
"- M.append(state)",
"+ S.append([tuple(map(int, input().split())) for _ in range(A)])",
"+",
"+",
"+def sol(state):"... | false | 0.034842 | 0.043704 | 0.797209 | [
"s212139006",
"s188855189"
] |
u191874006 | p03547 | python | s549804030 | s525490988 | 172 | 70 | 38,384 | 65,520 | Accepted | Accepted | 59.3 | #!/usr/bin/env python3
#ABC78 A
x,y = list(input().split())
if x < y:
print('<')
elif x > y:
print('>')
elif x == y:
print('=')
| #!/usr/bin/env python3
import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from... | 11 | 26 | 156 | 682 | #!/usr/bin/env python3
# ABC78 A
x, y = list(input().split())
if x < y:
print("<")
elif x > y:
print(">")
elif x == y:
print("=")
| #!/usr/bin/env python3
import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop, heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collectio... | false | 57.692308 | [
"-# ABC78 A",
"-x, y = list(input().split())",
"-if x < y:",
"+import sys",
"+import math",
"+from bisect import bisect_right as br",
"+from bisect import bisect_left as bl",
"+",
"+sys.setrecursionlimit(2147483647)",
"+from heapq import heappush, heappop, heappushpop",
"+from collections import... | false | 0.033833 | 0.035772 | 0.9458 | [
"s549804030",
"s525490988"
] |
u200785298 | p03017 | python | s842039490 | s199959123 | 90 | 19 | 3,508 | 3,572 | Accepted | Accepted | 78.89 | #!/usr/bin/env python3
import sys
YES = "Yes" # type: str
NO = "No" # type: str
def solve(N: int, A: int, B: int, C: int, D: int, S: str):
ret = YES
for i in range(A - 1, C - 1):
if S[i:i + 2] == '##':
ret = NO
print(ret)
return
for i in range(B -... | #!/usr/bin/env python3
import sys
YES = "Yes" # type: str
NO = "No" # type: str
def solve(N: int, A: int, B: int, C: int, D: int, S: str):
ret = YES
##for i in range(A - 1, C - 1):
## if S[i:i + 2] == '##':
## ret = NO
## print(ret)
## return
##for i ... | 52 | 52 | 1,338 | 1,363 | #!/usr/bin/env python3
import sys
YES = "Yes" # type: str
NO = "No" # type: str
def solve(N: int, A: int, B: int, C: int, D: int, S: str):
ret = YES
for i in range(A - 1, C - 1):
if S[i : i + 2] == "##":
ret = NO
print(ret)
return
for i in range(B - 1, D - 1)... | #!/usr/bin/env python3
import sys
YES = "Yes" # type: str
NO = "No" # type: str
def solve(N: int, A: int, B: int, C: int, D: int, S: str):
ret = YES
##for i in range(A - 1, C - 1):
## if S[i:i + 2] == '##':
## ret = NO
## print(ret)
## return
##for i in range(B -... | false | 0 | [
"- for i in range(A - 1, C - 1):",
"- if S[i : i + 2] == \"##\":",
"- ret = NO",
"- print(ret)",
"- return",
"- for i in range(B - 1, D - 1):",
"- if S[i : i + 2] == \"##\":",
"- ret = NO",
"- print(ret)",
"- ret... | false | 0.034683 | 0.036093 | 0.96093 | [
"s842039490",
"s199959123"
] |
u254871849 | p03038 | python | s744370141 | s903267508 | 519 | 463 | 28,088 | 47,128 | Accepted | Accepted | 10.79 | # 2019-11-13 08:30:54(JST)
import sys
import collections
# import math
# from string import ascii_lowercase, ascii_uppercase, digits
# from bisect import bisect_left as bi_l, bisect_right as bi_r
# import itertools
# from functools import reduce
# import operator as op
# from scipy.misc import comb # float
# ... | import sys
from collections import defaultdict
n, m = list(map(int, sys.stdin.readline().split()))
*A, = list(map(int, sys.stdin.readline().split()))
BC = list(zip(*[list(map(int, sys.stdin.read().split()))] * 2))
def main():
res = defaultdict(int)
for a in A:
res[a] += 1
for b, c... | 42 | 30 | 1,074 | 614 | # 2019-11-13 08:30:54(JST)
import sys
import collections
# import math
# from string import ascii_lowercase, ascii_uppercase, digits
# from bisect import bisect_left as bi_l, bisect_right as bi_r
# import itertools
# from functools import reduce
# import operator as op
# from scipy.misc import comb # float
# import nu... | import sys
from collections import defaultdict
n, m = list(map(int, sys.stdin.readline().split()))
(*A,) = list(map(int, sys.stdin.readline().split()))
BC = list(zip(*[list(map(int, sys.stdin.read().split()))] * 2))
def main():
res = defaultdict(int)
for a in A:
res[a] += 1
for b, c in BC:
... | false | 28.571429 | [
"-# 2019-11-13 08:30:54(JST)",
"-import collections",
"+from collections import defaultdict",
"-# import math",
"-# from string import ascii_lowercase, ascii_uppercase, digits",
"-# from bisect import bisect_left as bi_l, bisect_right as bi_r",
"-# import itertools",
"-# from functools import reduce",... | false | 0.036808 | 0.045306 | 0.812443 | [
"s744370141",
"s903267508"
] |
u179169725 | p02837 | python | s964916068 | s065403191 | 246 | 111 | 43,484 | 3,064 | Accepted | Accepted | 54.88 | # https://atcoder.jp/contests/abc147/tasks/abc147_c
# 制約が少ない→全探索可能
# 全探索によって矛盾がない場合を探す
# 問題はどうやって矛盾しているかどうかをどうやって判別するか
# katei[i]で1のあるiが成り立っているか確かめれば良い(矛盾しなければ良い)
# つまり、ある人の発言において、正直者ものの{i} in {katei[i]==1}となる
# かつ、不親切ものの{i} not in {j|katei[i]==1}となればよい。
N = int(eval(input()))
syoujiki = []
fusin = []
f... | # https://atcoder.jp/contests/abc147/tasks/abc147_c
# ビット全探索を自作ライブラリでやり直し
# 仮定している不親切な人と、実際に証言で言及されている不親切な人が一致するなかで最大の正直者の場合が答え
# 具体的には、仮定をおく→正直ものの証言を集める→仮定に反する証言がある場合は矛盾
# 矛盾するときは無視、矛盾しないときの人数を記録していく。
def iter_p_adic(p, length):
'''
連続して増加するp進数をリストとして返す。lengthはリストの長さ
return
----------
... | 54 | 70 | 1,324 | 1,537 | # https://atcoder.jp/contests/abc147/tasks/abc147_c
# 制約が少ない→全探索可能
# 全探索によって矛盾がない場合を探す
# 問題はどうやって矛盾しているかどうかをどうやって判別するか
# katei[i]で1のあるiが成り立っているか確かめれば良い(矛盾しなければ良い)
# つまり、ある人の発言において、正直者ものの{i} in {katei[i]==1}となる
# かつ、不親切ものの{i} not in {j|katei[i]==1}となればよい。
N = int(eval(input()))
syoujiki = []
fusin = []
for _ in range(N)... | # https://atcoder.jp/contests/abc147/tasks/abc147_c
# ビット全探索を自作ライブラリでやり直し
# 仮定している不親切な人と、実際に証言で言及されている不親切な人が一致するなかで最大の正直者の場合が答え
# 具体的には、仮定をおく→正直ものの証言を集める→仮定に反する証言がある場合は矛盾
# 矛盾するときは無視、矛盾しないときの人数を記録していく。
def iter_p_adic(p, length):
"""
連続して増加するp進数をリストとして返す。lengthはリストの長さ
return
----------
所望のp進数リストを次々返... | false | 22.857143 | [
"-# 制約が少ない→全探索可能",
"-# 全探索によって矛盾がない場合を探す",
"-# 問題はどうやって矛盾しているかどうかをどうやって判別するか",
"-# katei[i]で1のあるiが成り立っているか確かめれば良い(矛盾しなければ良い)",
"-# つまり、ある人の発言において、正直者ものの{i} in {katei[i]==1}となる",
"-# かつ、不親切ものの{i} not in {j|katei[i]==1}となればよい。",
"-N = int(eval(input()))",
"-syoujiki = []",
"-fusin = []",
"-for _ in ... | false | 0.034741 | 0.040722 | 0.853123 | [
"s964916068",
"s065403191"
] |
u618002097 | p03633 | python | s861146951 | s146381687 | 299 | 270 | 63,980 | 64,620 | Accepted | Accepted | 9.7 | N = int(eval(input()))
a = [int(eval(input())) for i in range(N)]
import fractions
ans = a[0]
for i in range(1, N):
ans = ans * a[i] // fractions.gcd(ans, a[i])
print(ans) | N = int(eval(input()))
T = [int(eval(input())) for i in range(N)]
import fractions
from functools import reduce
def lcm_base(x, y):
return (x * y) // fractions.gcd(x, y)
def lcm(*numbers):
return reduce(lcm_base, numbers, 1)
def lcm_list(numbers):
return reduce(lcm_base, numbers, 1)
print(... | 7 | 15 | 169 | 320 | N = int(eval(input()))
a = [int(eval(input())) for i in range(N)]
import fractions
ans = a[0]
for i in range(1, N):
ans = ans * a[i] // fractions.gcd(ans, a[i])
print(ans)
| N = int(eval(input()))
T = [int(eval(input())) for i in range(N)]
import fractions
from functools import reduce
def lcm_base(x, y):
return (x * y) // fractions.gcd(x, y)
def lcm(*numbers):
return reduce(lcm_base, numbers, 1)
def lcm_list(numbers):
return reduce(lcm_base, numbers, 1)
print((lcm_list(... | false | 53.333333 | [
"-a = [int(eval(input())) for i in range(N)]",
"+T = [int(eval(input())) for i in range(N)]",
"+from functools import reduce",
"-ans = a[0]",
"-for i in range(1, N):",
"- ans = ans * a[i] // fractions.gcd(ans, a[i])",
"-print(ans)",
"+",
"+def lcm_base(x, y):",
"+ return (x * y) // fractions... | false | 0.04559 | 0.048248 | 0.944925 | [
"s861146951",
"s146381687"
] |
u312025627 | p03565 | python | s430538428 | s888761535 | 179 | 17 | 38,756 | 3,064 | Accepted | Accepted | 90.5 | def main():
s = eval(input())
t = eval(input())
s_len = len(s)
t_len = len(t)
def t_check(t_true,t_can):
for tt,tc in zip(t_true,t_can):
if tc != '?' and tt != tc:
return False
else:
return True
if s_len < t... | def main():
S = input()
T = input()
N = len(S)
M = len(T)
ans = ""
for i, s in enumerate(S[::-1]):
cur = S[-(M+i):-i] if i != 0 else S[(-(M+i)):]
if len(cur) == M:
pass
else:
continue
if (s == T[-1] or s == "?") and \
... | 31 | 28 | 820 | 682 | def main():
s = eval(input())
t = eval(input())
s_len = len(s)
t_len = len(t)
def t_check(t_true, t_can):
for tt, tc in zip(t_true, t_can):
if tc != "?" and tt != tc:
return False
else:
return True
if s_len < t_len:
print("UNRESTO... | def main():
S = input()
T = input()
N = len(S)
M = len(T)
ans = ""
for i, s in enumerate(S[::-1]):
cur = S[-(M + i) : -i] if i != 0 else S[(-(M + i)) :]
if len(cur) == M:
pass
else:
continue
if (s == T[-1] or s == "?") and all(
... | false | 9.677419 | [
"- s = eval(input())",
"- t = eval(input())",
"- s_len = len(s)",
"- t_len = len(t)",
"-",
"- def t_check(t_true, t_can):",
"- for tt, tc in zip(t_true, t_can):",
"- if tc != \"?\" and tt != tc:",
"- return False",
"+ S = input()",
"+ T = inp... | false | 0.046188 | 0.066792 | 0.691516 | [
"s430538428",
"s888761535"
] |
u426683236 | p03424 | python | s223750211 | s903845641 | 170 | 22 | 38,256 | 3,316 | Accepted | Accepted | 87.06 | N=int(eval(input()))
S=list(input().split())
ans='Three'
if 'Y' in S:
ans='Four'
print(ans)
| from collections import Counter
n = int(eval(input()))
S = list(input().split())
c = Counter(S)
if len(c) == 4:
print('Four')
else:
print('Three')
| 6 | 9 | 95 | 158 | N = int(eval(input()))
S = list(input().split())
ans = "Three"
if "Y" in S:
ans = "Four"
print(ans)
| from collections import Counter
n = int(eval(input()))
S = list(input().split())
c = Counter(S)
if len(c) == 4:
print("Four")
else:
print("Three")
| false | 33.333333 | [
"-N = int(eval(input()))",
"+from collections import Counter",
"+",
"+n = int(eval(input()))",
"-ans = \"Three\"",
"-if \"Y\" in S:",
"- ans = \"Four\"",
"-print(ans)",
"+c = Counter(S)",
"+if len(c) == 4:",
"+ print(\"Four\")",
"+else:",
"+ print(\"Three\")"
] | false | 0.041046 | 0.041975 | 0.977858 | [
"s223750211",
"s903845641"
] |
u865383026 | p03624 | python | s439936505 | s656925807 | 36 | 30 | 9,916 | 9,160 | Accepted | Accepted | 16.67 | import string
L = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
S = set(eval(input()))
for i in L:
if i not in S:
print(i)
break
else:
print(None) | A = ['a','s','d','f','g','h','j','k','l','z','x','c','v','b','n','m','q','w','e','r','t','y','u','i','o','p']
S = list(set(eval(input())))
for i in S:
A.remove(i)
A.sort()
try:
print((A[0]))
except:
print("None")
| 9 | 9 | 245 | 225 | import string
L = [
"a",
"b",
"c",
"d",
"e",
"f",
"g",
"h",
"i",
"j",
"k",
"l",
"m",
"n",
"o",
"p",
"q",
"r",
"s",
"t",
"u",
"v",
"w",
"x",
"y",
"z",
]
S = set(eval(input()))
for i in L:
if i not in S:
p... | A = [
"a",
"s",
"d",
"f",
"g",
"h",
"j",
"k",
"l",
"z",
"x",
"c",
"v",
"b",
"n",
"m",
"q",
"w",
"e",
"r",
"t",
"y",
"u",
"i",
"o",
"p",
]
S = list(set(eval(input())))
for i in S:
A.remove(i)
A.sort()
try:
pri... | false | 0 | [
"-import string",
"-",
"-L = [",
"+A = [",
"- \"b\",",
"- \"c\",",
"+ \"s\",",
"- \"e\",",
"- \"i\",",
"+ \"z\",",
"+ \"x\",",
"+ \"c\",",
"+ \"v\",",
"+ \"b\",",
"+ \"n\",",
"- \"n\",",
"+ \"q\",",
"+ \"w\",",
"+ \"e\",",
"+ \"r\... | false | 0.11074 | 0.041427 | 2.673154 | [
"s439936505",
"s656925807"
] |
u752907799 | p02571 | python | s380130734 | s603433770 | 50 | 42 | 8,980 | 8,960 | Accepted | Accepted | 16 | S, T = eval(input()), eval(input())
print((min([sum([0 if x == y else 1 for x, y in zip(S[i:i + len(T)], T)]) for i in range(len(S) - len(T) + 1)])))
| S, T = eval(input()), eval(input());print((min([sum([0 if x == y else 1 for x, y in zip(S[i:], T)]) for i in range(len(S) - len(T) + 1)])))
| 2 | 1 | 137 | 126 | S, T = eval(input()), eval(input())
print(
(
min(
[
sum([0 if x == y else 1 for x, y in zip(S[i : i + len(T)], T)])
for i in range(len(S) - len(T) + 1)
]
)
)
)
| S, T = eval(input()), eval(input())
print(
(
min(
[
sum([0 if x == y else 1 for x, y in zip(S[i:], T)])
for i in range(len(S) - len(T) + 1)
]
)
)
)
| false | 50 | [
"- sum([0 if x == y else 1 for x, y in zip(S[i : i + len(T)], T)])",
"+ sum([0 if x == y else 1 for x, y in zip(S[i:], T)])"
] | false | 0.141429 | 0.049393 | 2.863343 | [
"s380130734",
"s603433770"
] |
u786793781 | p02918 | python | s428911931 | s257968822 | 55 | 38 | 3,316 | 3,316 | Accepted | Accepted | 30.91 | # -*- coding: utf-8 -*-
# https://atcoder.jp/contests/abc140/tasks/abc140_d
N, K = list(map(int, input().split()))
S = input().strip()
happiness = 0
for idx in range(1, N):
if S[idx] == S[idx - 1]:
happiness += 1
# 一人しか幸せにできないときがあるか?
#
# あっ...これは不要なのでは...
# 単に後述の幸せの最大値で丸めればよいのでは
# always_t... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
N, K = list(map(int, input().split()))
S = input().strip()
# 初期の幸せ度を調べる
happiness = 0
previous_face = S[0]
for i in range(1, N):
if S[i] == previous_face:
happiness += 1
else:
previous_face = S[i]
# 並べ替え後の幸せ度
happiness = happiness... | 24 | 22 | 460 | 401 | # -*- coding: utf-8 -*-
# https://atcoder.jp/contests/abc140/tasks/abc140_d
N, K = list(map(int, input().split()))
S = input().strip()
happiness = 0
for idx in range(1, N):
if S[idx] == S[idx - 1]:
happiness += 1
# 一人しか幸せにできないときがあるか?
#
# あっ...これは不要なのでは...
# 単に後述の幸せの最大値で丸めればよいのでは
# always_two_happiness = S[0... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
N, K = list(map(int, input().split()))
S = input().strip()
# 初期の幸せ度を調べる
happiness = 0
previous_face = S[0]
for i in range(1, N):
if S[i] == previous_face:
happiness += 1
else:
previous_face = S[i]
# 並べ替え後の幸せ度
happiness = happiness + 2 * K
if N - 1 <... | false | 8.333333 | [
"+#!/usr/bin/env python3",
"-# https://atcoder.jp/contests/abc140/tasks/abc140_d",
"+# 初期の幸せ度を調べる",
"-for idx in range(1, N):",
"- if S[idx] == S[idx - 1]:",
"+previous_face = S[0]",
"+for i in range(1, N):",
"+ if S[i] == previous_face:",
"-# 一人しか幸せにできないときがあるか?",
"-#",
"-# あっ...これは不要なのでは.... | false | 0.067512 | 0.03725 | 1.812419 | [
"s428911931",
"s257968822"
] |
u883792993 | p03329 | python | s015249524 | s926896255 | 1,223 | 601 | 3,860 | 3,860 | Accepted | Accepted | 50.86 | import math
N=int(eval(input()))
number_of_withdrawal=[100000]
# def floor(float_number):
# integer = 0
# while integer < float_number:
# integer+=1
# if integer == float_number:
# return integer
# else:
# integer-=1
# return integer
for money_6 in range... | N=int(eval(input()))
money_list=[1,6,36,216,1296,7776,46656,9,81,729,6561,59049]
dp=[0]
for i in range(1,N+1):
dp.append(100000)
for i in range(N):
for money in money_list:
if i+money <= N:
dp[i+money]=min(dp[i+money],dp[i]+1)
print((dp[N])) | 33 | 11 | 827 | 272 | import math
N = int(eval(input()))
number_of_withdrawal = [100000]
# def floor(float_number):
# integer = 0
# while integer < float_number:
# integer+=1
# if integer == float_number:
# return integer
# else:
# integer-=1
# return integer
for money_6 in range(0, N + 1):
... | N = int(eval(input()))
money_list = [1, 6, 36, 216, 1296, 7776, 46656, 9, 81, 729, 6561, 59049]
dp = [0]
for i in range(1, N + 1):
dp.append(100000)
for i in range(N):
for money in money_list:
if i + money <= N:
dp[i + money] = min(dp[i + money], dp[i] + 1)
print((dp[N]))
| false | 66.666667 | [
"-import math",
"-",
"-number_of_withdrawal = [100000]",
"-# def floor(float_number):",
"-# integer = 0",
"-# while integer < float_number:",
"-# integer+=1",
"-# if integer == float_number:",
"-# return integer",
"-# else:",
"-# integer-=1",
"-# ... | false | 0.459357 | 0.113942 | 4.031495 | [
"s015249524",
"s926896255"
] |
u008357982 | p02768 | python | s902886959 | s615088957 | 265 | 151 | 10,932 | 3,060 | Accepted | Accepted | 43.02 | n, a, b = list(map(int, input().split()))
mod = 10**9 + 7
def neko(n, k):
if n < k:
return 0
if n < 0 or k < 0:
return 0
k = min(n - k, k)
ans = 1
inv = [1] * (k + 1)
if k >= 1:
ans *= (n - k + 1) % mod
for i in range(2, k + 1):
inv[i] = mod -... | n, a, b = list(map(int, input().split()))
mod = 10**9 + 7
def neko(n, r):
p, q = 1, 1
for i in range(r):
p = p * (n - i) % mod
q = q * (i + 1) % mod
return p * pow(q, mod - 2, mod) % mod
print(((pow(2, n, mod) - 1 - neko(n, a) - neko(n, b)) % mod))
| 21 | 13 | 476 | 285 | n, a, b = list(map(int, input().split()))
mod = 10**9 + 7
def neko(n, k):
if n < k:
return 0
if n < 0 or k < 0:
return 0
k = min(n - k, k)
ans = 1
inv = [1] * (k + 1)
if k >= 1:
ans *= (n - k + 1) % mod
for i in range(2, k + 1):
inv[i] = mod - inv[mod % i] *... | n, a, b = list(map(int, input().split()))
mod = 10**9 + 7
def neko(n, r):
p, q = 1, 1
for i in range(r):
p = p * (n - i) % mod
q = q * (i + 1) % mod
return p * pow(q, mod - 2, mod) % mod
print(((pow(2, n, mod) - 1 - neko(n, a) - neko(n, b)) % mod))
| false | 38.095238 | [
"-def neko(n, k):",
"- if n < k:",
"- return 0",
"- if n < 0 or k < 0:",
"- return 0",
"- k = min(n - k, k)",
"- ans = 1",
"- inv = [1] * (k + 1)",
"- if k >= 1:",
"- ans *= (n - k + 1) % mod",
"- for i in range(2, k + 1):",
"- inv[i] = mod - in... | false | 0.312693 | 0.128555 | 2.432356 | [
"s902886959",
"s615088957"
] |
u248424983 | p02412 | python | s968184872 | s687775403 | 850 | 30 | 7,676 | 7,608 | Accepted | Accepted | 96.47 | import itertools
while True:
n,x = list(map(int,input().split()))
if n==x==0: break
ret = 0
for i in itertools.combinations([i+1 for i in range(n)],3):
if sum(i) == x: ret+= 1
print(ret) | while True:
n,x = list(map(int,input().split()))
if n == x == 0: break
ret = 0
max = x - 2
if n <= x: max = n
for _ in range(max):
if max == 2: break
mid = max - 1
for _ in range(mid):
min = x - max - mid
if min <= 0: mid -= 1
... | 8 | 22 | 221 | 470 | import itertools
while True:
n, x = list(map(int, input().split()))
if n == x == 0:
break
ret = 0
for i in itertools.combinations([i + 1 for i in range(n)], 3):
if sum(i) == x:
ret += 1
print(ret)
| while True:
n, x = list(map(int, input().split()))
if n == x == 0:
break
ret = 0
max = x - 2
if n <= x:
max = n
for _ in range(max):
if max == 2:
break
mid = max - 1
for _ in range(mid):
min = x - max - mid
if min <= 0:
... | false | 63.636364 | [
"-import itertools",
"-",
"- for i in itertools.combinations([i + 1 for i in range(n)], 3):",
"- if sum(i) == x:",
"- ret += 1",
"+ max = x - 2",
"+ if n <= x:",
"+ max = n",
"+ for _ in range(max):",
"+ if max == 2:",
"+ break",
"+ ... | false | 0.067223 | 0.037224 | 1.805939 | [
"s968184872",
"s687775403"
] |
u830580569 | p03651 | python | s080147966 | s852237471 | 105 | 86 | 12,636 | 13,148 | Accepted | Accepted | 18.1 | from fractions import gcd
from functools import reduce
N, K = list(map(int, input().split(' ')))
A = list(map(int, input().split(' ')))
M = max(A)
G = reduce(gcd, sorted(A))
if not K % G and K <= M:
print('POSSIBLE')
else:
print('IMPOSSIBLE') | from fractions import gcd
from functools import reduce
def get_difference():
# get input from raw_input()
n, k = list(map(int, input().split(' ')))
l = [int(e) for e in input().split(' ')]
if k in l:
print("POSSIBLE")
return
if k>max(l):
print("IMPOSSIBLE")
return
gcd_v = reduce(gcd, l)
... | 11 | 22 | 229 | 409 | from fractions import gcd
from functools import reduce
N, K = list(map(int, input().split(" ")))
A = list(map(int, input().split(" ")))
M = max(A)
G = reduce(gcd, sorted(A))
if not K % G and K <= M:
print("POSSIBLE")
else:
print("IMPOSSIBLE")
| from fractions import gcd
from functools import reduce
def get_difference():
# get input from raw_input()
n, k = list(map(int, input().split(" ")))
l = [int(e) for e in input().split(" ")]
if k in l:
print("POSSIBLE")
return
if k > max(l):
print("IMPOSSIBLE")
return... | false | 50 | [
"-N, K = list(map(int, input().split(\" \")))",
"-A = list(map(int, input().split(\" \")))",
"-M = max(A)",
"-G = reduce(gcd, sorted(A))",
"-if not K % G and K <= M:",
"- print(\"POSSIBLE\")",
"-else:",
"- print(\"IMPOSSIBLE\")",
"+",
"+def get_difference():",
"+ # get input from raw_in... | false | 0.053675 | 0.061352 | 0.874868 | [
"s080147966",
"s852237471"
] |
u760802228 | p03486 | python | s325283807 | s507543916 | 19 | 17 | 2,940 | 2,940 | Accepted | Accepted | 10.53 | s = list(eval(input()))
t = list(eval(input()))
s.sort()
t.sort(reverse = True)
if s < t:
print("Yes")
else:
print("No") | if sorted(eval(input())) < sorted(eval(input()))[::-1]:
print("Yes")
else:
print("No") | 8 | 4 | 131 | 93 | s = list(eval(input()))
t = list(eval(input()))
s.sort()
t.sort(reverse=True)
if s < t:
print("Yes")
else:
print("No")
| if sorted(eval(input())) < sorted(eval(input()))[::-1]:
print("Yes")
else:
print("No")
| false | 50 | [
"-s = list(eval(input()))",
"-t = list(eval(input()))",
"-s.sort()",
"-t.sort(reverse=True)",
"-if s < t:",
"+if sorted(eval(input())) < sorted(eval(input()))[::-1]:"
] | false | 0.038095 | 0.038713 | 0.98402 | [
"s325283807",
"s507543916"
] |
u466331465 | p02972 | python | s072604750 | s255715182 | 793 | 301 | 23,476 | 13,148 | Accepted | Accepted | 62.04 | #import numpy as np
N = int(input())
a = [0]+list(map(int,input().split()))
ans = [0]*(N+1)
an = []
for i in range(N,0,-1):
c =0
b = [i*j for j in range(2,N//i+1)]
for j in b:
c +=ans[j]
c = c%2
if c!=a[i]:
ans[i]=1
an.append(i)
print(len(an))
for i in range(len(an)):
print(an[i]... | #import numpy as np
N = int(input())
a = [0]+list(map(int,input().split()))
ans = [0]*(N+1)
an = []
for i in range(N,0,-1):
c =0
c = sum(ans[2*i::i])
if c%2!=a[i]:
ans[i]=1
an.append(i)
print(len(an))
for i in range(len(an)):
print(an[i],end=" ")
| 17 | 14 | 330 | 276 | # import numpy as np
N = int(input())
a = [0] + list(map(int, input().split()))
ans = [0] * (N + 1)
an = []
for i in range(N, 0, -1):
c = 0
b = [i * j for j in range(2, N // i + 1)]
for j in b:
c += ans[j]
c = c % 2
if c != a[i]:
ans[i] = 1
an.append(i)
print(len(an))
for i i... | # import numpy as np
N = int(input())
a = [0] + list(map(int, input().split()))
ans = [0] * (N + 1)
an = []
for i in range(N, 0, -1):
c = 0
c = sum(ans[2 * i :: i])
if c % 2 != a[i]:
ans[i] = 1
an.append(i)
print(len(an))
for i in range(len(an)):
print(an[i], end=" ")
| false | 17.647059 | [
"- b = [i * j for j in range(2, N // i + 1)]",
"- for j in b:",
"- c += ans[j]",
"- c = c % 2",
"- if c != a[i]:",
"+ c = sum(ans[2 * i :: i])",
"+ if c % 2 != a[i]:"
] | false | 0.086868 | 0.038565 | 2.252473 | [
"s072604750",
"s255715182"
] |
u724687935 | p03450 | python | s705012278 | s932881154 | 1,108 | 1,013 | 24,500 | 128,908 | Accepted | Accepted | 8.57 | import sys
class UnionFind():
def __init__(self, n):
self.parents = [-1] * n
def find(self, x):
if self.parents[x] < 0:
return x
else:
self.parents[x] = self.find(self.parents[x])
return self.parents[x]
def union(self, x, y):
... | import sys
sys.setrecursionlimit(10 ** 6)
def dfs(p):
result = True
for np, D in edge[p]:
if pos[np] is None:
pos[np] = pos[p] + D
result &= dfs(np)
else:
if pos[p] + D != pos[np]:
result &= False
return result
N, M = li... | 88 | 33 | 2,150 | 692 | import sys
class UnionFind:
def __init__(self, n):
self.parents = [-1] * n
def find(self, x):
if self.parents[x] < 0:
return x
else:
self.parents[x] = self.find(self.parents[x])
return self.parents[x]
def union(self, x, y):
x = self.fin... | import sys
sys.setrecursionlimit(10**6)
def dfs(p):
result = True
for np, D in edge[p]:
if pos[np] is None:
pos[np] = pos[p] + D
result &= dfs(np)
else:
if pos[p] + D != pos[np]:
result &= False
return result
N, M = list(map(int, input... | false | 62.5 | [
"-",
"-class UnionFind:",
"- def __init__(self, n):",
"- self.parents = [-1] * n",
"-",
"- def find(self, x):",
"- if self.parents[x] < 0:",
"- return x",
"- else:",
"- self.parents[x] = self.find(self.parents[x])",
"- return self.paren... | false | 0.041178 | 0.0446 | 0.923279 | [
"s705012278",
"s932881154"
] |
u077291787 | p03162 | python | s505032725 | s045440238 | 415 | 379 | 47,280 | 71,772 | Accepted | Accepted | 8.67 | # EduDPC - Vacation
import sys
input = sys.stdin.readline
n = int(eval(input()))
arr = [list(map(int, input().rstrip().split())) for _ in range(n)]
dp = [[0, 0, 0] for i in range(n)]
dp[0] = arr[0]
for i in range(1, n):
dp[i][0] = max(dp[i - 1][1], dp[i - 1][2]) + arr[i][0]
dp[i][1] = max(dp[i - 1][0... | # dpC - Vacation
# 貰うDP
import sys
input = sys.stdin.readline
def main():
n = int(eval(input()))
A = tuple(tuple(map(int, input().rstrip().split())) for _ in range(n))
dp = [[0] * 3 for _ in range(n)]
dp[0] = A[0]
for i in range(1, n): # i-th day
for j in range(3): # yesterday
... | 13 | 20 | 422 | 520 | # EduDPC - Vacation
import sys
input = sys.stdin.readline
n = int(eval(input()))
arr = [list(map(int, input().rstrip().split())) for _ in range(n)]
dp = [[0, 0, 0] for i in range(n)]
dp[0] = arr[0]
for i in range(1, n):
dp[i][0] = max(dp[i - 1][1], dp[i - 1][2]) + arr[i][0]
dp[i][1] = max(dp[i - 1][0], dp[i - ... | # dpC - Vacation
# 貰うDP
import sys
input = sys.stdin.readline
def main():
n = int(eval(input()))
A = tuple(tuple(map(int, input().rstrip().split())) for _ in range(n))
dp = [[0] * 3 for _ in range(n)]
dp[0] = A[0]
for i in range(1, n): # i-th day
for j in range(3): # yesterday
... | false | 35 | [
"-# EduDPC - Vacation",
"+# dpC - Vacation",
"+# 貰うDP",
"-n = int(eval(input()))",
"-arr = [list(map(int, input().rstrip().split())) for _ in range(n)]",
"-dp = [[0, 0, 0] for i in range(n)]",
"-dp[0] = arr[0]",
"-for i in range(1, n):",
"- dp[i][0] = max(dp[i - 1][1], dp[i - 1][2]) + arr[i][0]",... | false | 0.087757 | 0.119718 | 0.733034 | [
"s505032725",
"s045440238"
] |
u145950990 | p03042 | python | s489191701 | s071243962 | 173 | 30 | 38,384 | 9,068 | Accepted | Accepted | 82.66 | s = eval(input())
s1 = int(s[:2])
s2 = int(s[2:])
m = list(range(1,13))
if s1 in m and s2 in m:
print('AMBIGUOUS')
elif s1 in m:
print('MMYY')
elif s2 in m:
print('YYMM')
else:
print('NA') | s = eval(input())
s1 = int(s[:2])
s2 = int(s[2:])
if 1<=s1<=12 and 1<=s2<=12:
print('AMBIGUOUS')
elif 1<=s1<=12:
print('MMYY')
elif 1<=s2<=12:
print('YYMM')
else:
print('NA') | 12 | 11 | 203 | 194 | s = eval(input())
s1 = int(s[:2])
s2 = int(s[2:])
m = list(range(1, 13))
if s1 in m and s2 in m:
print("AMBIGUOUS")
elif s1 in m:
print("MMYY")
elif s2 in m:
print("YYMM")
else:
print("NA")
| s = eval(input())
s1 = int(s[:2])
s2 = int(s[2:])
if 1 <= s1 <= 12 and 1 <= s2 <= 12:
print("AMBIGUOUS")
elif 1 <= s1 <= 12:
print("MMYY")
elif 1 <= s2 <= 12:
print("YYMM")
else:
print("NA")
| false | 8.333333 | [
"-m = list(range(1, 13))",
"-if s1 in m and s2 in m:",
"+if 1 <= s1 <= 12 and 1 <= s2 <= 12:",
"-elif s1 in m:",
"+elif 1 <= s1 <= 12:",
"-elif s2 in m:",
"+elif 1 <= s2 <= 12:"
] | false | 0.044075 | 0.03813 | 1.155933 | [
"s489191701",
"s071243962"
] |
u272525952 | p02658 | python | s805774611 | s314526733 | 55 | 46 | 21,612 | 21,528 | Accepted | Accepted | 16.36 | n=int(eval(input()))
l=list(map(int,input().split()))
num=1
if l.count(0)!=0:
print((0))
else:
flag=True
for i in l:
if num>10**18:
print((-1))
flag=False
break
else:
num*=i
if flag==True:
if num>10**18:
... | n=int(eval(input()))
l=list(map(int,input().split()))
if l.count(0)!=0:
print((0))
else:
num=1
for i in l:
if num>10**18:
break
else:
num*=i
if num>10**18:
print((-1))
else:
print(num) | 19 | 15 | 358 | 226 | n = int(eval(input()))
l = list(map(int, input().split()))
num = 1
if l.count(0) != 0:
print((0))
else:
flag = True
for i in l:
if num > 10**18:
print((-1))
flag = False
break
else:
num *= i
if flag == True:
if num > 10**18:
... | n = int(eval(input()))
l = list(map(int, input().split()))
if l.count(0) != 0:
print((0))
else:
num = 1
for i in l:
if num > 10**18:
break
else:
num *= i
if num > 10**18:
print((-1))
else:
print(num)
| false | 21.052632 | [
"-num = 1",
"- flag = True",
"+ num = 1",
"- print((-1))",
"- flag = False",
"- if flag == True:",
"- if num > 10**18:",
"- print((-1))",
"- else:",
"- print(num)",
"+ if num > 10**18:",
"+ print((-1))",
"+ else:... | false | 0.09628 | 0.040619 | 2.370314 | [
"s805774611",
"s314526733"
] |
u593019570 | p02796 | python | s047571210 | s981101998 | 423 | 391 | 44,592 | 44,520 | Accepted | Accepted | 7.57 | n = int(eval(input()))
a = []
for _ in range(n):
a.append(list(map(int,input().split())))
d = [[a[i][0]-a[i][1],a[i][0]+a[i][1]] for i in range(n)]
d = sorted(d, key = lambda x: x[1])
#print(d)
b = [-100000000000000000]
c = [0]
for i in range(n):
for j in range(len(b)):
if d[i][0] >... | n = int(eval(input()))
a = []
for _ in range(n):
a.append(list(map(int,input().split())))
d = [[a[i][0]-a[i][1],a[i][0]+a[i][1]] for i in range(n)]
d = sorted(d, key = lambda x: x[1])
b = -100000000000000000
c = 0
for i in range(n):
if d[i][0] >= b:
b = d[i][1]
c = c + 1
... | 28 | 21 | 467 | 339 | n = int(eval(input()))
a = []
for _ in range(n):
a.append(list(map(int, input().split())))
d = [[a[i][0] - a[i][1], a[i][0] + a[i][1]] for i in range(n)]
d = sorted(d, key=lambda x: x[1])
# print(d)
b = [-100000000000000000]
c = [0]
for i in range(n):
for j in range(len(b)):
if d[i][0] >= b[j]:
... | n = int(eval(input()))
a = []
for _ in range(n):
a.append(list(map(int, input().split())))
d = [[a[i][0] - a[i][1], a[i][0] + a[i][1]] for i in range(n)]
d = sorted(d, key=lambda x: x[1])
b = -100000000000000000
c = 0
for i in range(n):
if d[i][0] >= b:
b = d[i][1]
c = c + 1
print(c)
| false | 25 | [
"-# print(d)",
"-b = [-100000000000000000]",
"-c = [0]",
"+b = -100000000000000000",
"+c = 0",
"- for j in range(len(b)):",
"- if d[i][0] >= b[j]:",
"- b = [d[i][1]]",
"- c = [c[j] + 1]",
"- break",
"- # print(b)",
"- # print(c)",
"-print((max... | false | 0.047408 | 0.073764 | 0.642704 | [
"s047571210",
"s981101998"
] |
u912237403 | p00075 | python | s708690389 | s231588876 | 20 | 10 | 4,208 | 4,204 | Accepted | Accepted | 50 | import sys
for s in sys.stdin:
n,w,h=list(map(float, s.split(",")))
bmi=w/h/h
if bmi>=25: print(int(n)) | import sys
for s in sys.stdin:
n,w,h=s.split(",")
n,w,h=int(n),float(w),float(h)
bmi=w/h/h
if bmi>=25: print(n) | 5 | 6 | 112 | 131 | import sys
for s in sys.stdin:
n, w, h = list(map(float, s.split(",")))
bmi = w / h / h
if bmi >= 25:
print(int(n))
| import sys
for s in sys.stdin:
n, w, h = s.split(",")
n, w, h = int(n), float(w), float(h)
bmi = w / h / h
if bmi >= 25:
print(n)
| false | 16.666667 | [
"- n, w, h = list(map(float, s.split(\",\")))",
"+ n, w, h = s.split(\",\")",
"+ n, w, h = int(n), float(w), float(h)",
"- print(int(n))",
"+ print(n)"
] | false | 0.03679 | 0.035502 | 1.036268 | [
"s708690389",
"s231588876"
] |
u550061714 | p02586 | python | s274252916 | s787541740 | 2,065 | 1,816 | 379,852 | 466,308 | Accepted | Accepted | 12.06 | import sys
input = sys.stdin.readline
R, C, K = list(map(int, input().split()))
D = dict()
for _ in range(K):
r, c, v = list(map(int, input().split()))
D[(r, c)] = v
dp0 = [[0] * (C + 1) for _ in range(R + 1)]
dp1 = [[0] * (C + 1) for _ in range(R + 1)]
dp2 = [[0] * (C + 1) for _ in range(R + 1)]... | import numpy as np
import sys
from numba import njit, i8
input = sys.stdin.readline
R, C, K = list(map(int, input().split()))
table = [[0] * (C + 1) for _ in range(R + 1)]
for _ in range(K):
r, c, v = list(map(int, input().split()))
table[r][c] = v
table = np.array(table, dtype=np.int64)
@njit... | 27 | 36 | 998 | 1,309 | import sys
input = sys.stdin.readline
R, C, K = list(map(int, input().split()))
D = dict()
for _ in range(K):
r, c, v = list(map(int, input().split()))
D[(r, c)] = v
dp0 = [[0] * (C + 1) for _ in range(R + 1)]
dp1 = [[0] * (C + 1) for _ in range(R + 1)]
dp2 = [[0] * (C + 1) for _ in range(R + 1)]
dp3 = [[0] * ... | import numpy as np
import sys
from numba import njit, i8
input = sys.stdin.readline
R, C, K = list(map(int, input().split()))
table = [[0] * (C + 1) for _ in range(R + 1)]
for _ in range(K):
r, c, v = list(map(int, input().split()))
table[r][c] = v
table = np.array(table, dtype=np.int64)
@njit((i8, i8, i8[:,... | false | 25 | [
"+import numpy as np",
"+from numba import njit, i8",
"-D = dict()",
"+table = [[0] * (C + 1) for _ in range(R + 1)]",
"- D[(r, c)] = v",
"-dp0 = [[0] * (C + 1) for _ in range(R + 1)]",
"-dp1 = [[0] * (C + 1) for _ in range(R + 1)]",
"-dp2 = [[0] * (C + 1) for _ in range(R + 1)]",
"-dp3 = [[0] * ... | false | 0.099606 | 0.31478 | 0.316431 | [
"s274252916",
"s787541740"
] |
u006880673 | p02720 | python | s136935017 | s075782017 | 100 | 86 | 19,404 | 74,784 | Accepted | Accepted | 14 | # 再帰的なDFS
def rec(d, val, nums):
nums.append(val)
if d == 10:
return
for delta in (-1, 0, 1):
add = val % 10 + delta
if add >= 0 and add <= 9:
rec(d+1, val * 10 + add, nums)
def main():
K = int(eval(input()))
nums = []
for val in range(1, 1... | from collections import deque
K = int(eval(input()))
que = deque([1, 2, 3, 4, 5, 6, 7, 8, 9])
for i in range(K):
num = que.popleft()
if i == K-1:
print(num)
break
if num%10 == 0:
que.append(num*10 + num%10)
que.append(num*10 + num%10 + 1)
elif num%10 == 9:
... | 20 | 18 | 393 | 518 | # 再帰的なDFS
def rec(d, val, nums):
nums.append(val)
if d == 10:
return
for delta in (-1, 0, 1):
add = val % 10 + delta
if add >= 0 and add <= 9:
rec(d + 1, val * 10 + add, nums)
def main():
K = int(eval(input()))
nums = []
for val in range(1, 10):
rec(... | from collections import deque
K = int(eval(input()))
que = deque([1, 2, 3, 4, 5, 6, 7, 8, 9])
for i in range(K):
num = que.popleft()
if i == K - 1:
print(num)
break
if num % 10 == 0:
que.append(num * 10 + num % 10)
que.append(num * 10 + num % 10 + 1)
elif num % 10 == 9:
... | false | 10 | [
"-# 再帰的なDFS",
"-def rec(d, val, nums):",
"- nums.append(val)",
"- if d == 10:",
"- return",
"- for delta in (-1, 0, 1):",
"- add = val % 10 + delta",
"- if add >= 0 and add <= 9:",
"- rec(d + 1, val * 10 + add, nums)",
"+from collections import deque",
"-... | false | 0.187552 | 0.209454 | 0.895433 | [
"s136935017",
"s075782017"
] |
u628285938 | p03221 | python | s825133041 | s095396285 | 498 | 442 | 45,536 | 45,340 | Accepted | Accepted | 11.24 | # -*- coding: utf-8 -*-
"""
Created on Tue Sep 15 01:01:58 2020
@author: liang
"""
#ゼロパディング+インデックス
#str(1).zfill(6) + str(a.index(2) + 1).zfill(6)
#index(x) が重い => indexを使わなくて良いようにする
N, M = list(map(int, input().split()))
#d = [list() for _ in range(N)]
dic = dict()
dic2 = dict()
P = list()
#insert O... | # -*- coding: utf-8 -*-
"""
Created on Tue Sep 15 01:01:58 2020
@author: liang
"""
#ゼロパディング+インデックス
#str(1).zfill(6) + str(a.index(2) + 1).zfill(6)
#index(x) が重い => indexを使わなくて良いようにする
N, M = list(map(int, input().split()))
#d = [list() for _ in range(N)]
dic = dict()
dic2 = dict()
P = list()
#insert O... | 46 | 48 | 1,017 | 1,024 | # -*- coding: utf-8 -*-
"""
Created on Tue Sep 15 01:01:58 2020
@author: liang
"""
# ゼロパディング+インデックス
# str(1).zfill(6) + str(a.index(2) + 1).zfill(6)
# index(x) が重い => indexを使わなくて良いようにする
N, M = list(map(int, input().split()))
# d = [list() for _ in range(N)]
dic = dict()
dic2 = dict()
P = list()
# insert O(M)
for i in r... | # -*- coding: utf-8 -*-
"""
Created on Tue Sep 15 01:01:58 2020
@author: liang
"""
# ゼロパディング+インデックス
# str(1).zfill(6) + str(a.index(2) + 1).zfill(6)
# index(x) が重い => indexを使わなくて良いようにする
N, M = list(map(int, input().split()))
# d = [list() for _ in range(N)]
dic = dict()
dic2 = dict()
P = list()
# insert O(M)
for i in r... | false | 4.166667 | [
"- # ans = str(p).zfill(6)+str(d[p-1].index(y)+1).zfill(6)",
"+ ans = str(p).zfill(6) + str(dic2[y]).zfill(6)",
"+ \"\"\"",
"- ans = \"\"",
"- ans += \"0\" * (6 - len(str(p))) + str(p)",
"- # t = dic[p].index(y)+1",
"+ ans = ''",
"+ ans += '0'*( 6 - len(str(p))) + str(p)",
"+... | false | 0.037198 | 0.109805 | 0.338769 | [
"s825133041",
"s095396285"
] |
u682730715 | p03038 | python | s210107623 | s467796815 | 580 | 486 | 96,276 | 30,836 | Accepted | Accepted | 16.21 | # coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *
readl= lambda: list(map(int, sys.stdin.readline().split()))
readt= lambda: tuple(... | # coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *
readl= lambda: list(map(int, sys.stdin.readline().split()))
readt= lambda: tuple(... | 35 | 38 | 856 | 877 | # coding: UTF-8
import sys
# sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *
readl = lambda: list(map(int, sys.stdin.readline().split()))
readt = lambda: tuple(map(int, s... | # coding: UTF-8
import sys
# sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *
readl = lambda: list(map(int, sys.stdin.readline().split()))
readt = lambda: tuple(map(int, s... | false | 7.894737 | [
"- heapq.heappush(k, (-i, 1))",
"+ k.append((i, 1))",
"- heapq.heappush(k, (-y, x))",
"+ k.append((y, x))",
"+k.sort(reverse=True)",
"+index = 0",
"- x, y = heapq.heappop(k)",
"- count += min(y * (-x), n * (-x))",
"+ x, y = k[index]",
"+ count += min(y * (x), n * (x))",
"... | false | 0.045043 | 0.049368 | 0.912394 | [
"s210107623",
"s467796815"
] |
u692498898 | p02802 | python | s172728042 | s346880234 | 344 | 305 | 27,888 | 4,596 | Accepted | Accepted | 11.34 | n, m = list(map(int, input().split()))
submit = []
for i in range(m):
temp = [x for x in input().split()]
submit.append(temp)
ac = [0] * (n + 1)
wa = [0] * (n + 1)
for i in range(m):
result = submit[i][1]
question = int(submit[i][0])
if result == 'AC' and ac[question] == 0:
... | n,m=list(map(int,input().split()))
ac=[0]*(n+1)
wa=[0]*(n+1)
for i in range(m):
p,s=input().split()
if ac[int(p)]!=1:
if s=='WA':
wa[int(p)]=wa[int(p)]+1
else:
ac[int(p)]=1
for i in range(n+1):
if ac[i]==0:
wa[i]=0
print((sum(ac),sum(wa))) | 24 | 14 | 499 | 274 | n, m = list(map(int, input().split()))
submit = []
for i in range(m):
temp = [x for x in input().split()]
submit.append(temp)
ac = [0] * (n + 1)
wa = [0] * (n + 1)
for i in range(m):
result = submit[i][1]
question = int(submit[i][0])
if result == "AC" and ac[question] == 0:
ac[question] = 1
... | n, m = list(map(int, input().split()))
ac = [0] * (n + 1)
wa = [0] * (n + 1)
for i in range(m):
p, s = input().split()
if ac[int(p)] != 1:
if s == "WA":
wa[int(p)] = wa[int(p)] + 1
else:
ac[int(p)] = 1
for i in range(n + 1):
if ac[i] == 0:
wa[i] = 0
print((sum... | false | 41.666667 | [
"-submit = []",
"-for i in range(m):",
"- temp = [x for x in input().split()]",
"- submit.append(temp)",
"- result = submit[i][1]",
"- question = int(submit[i][0])",
"- if result == \"AC\" and ac[question] == 0:",
"- ac[question] = 1",
"- elif result == \"WA\" and ac[questio... | false | 0.039568 | 0.038953 | 1.015784 | [
"s172728042",
"s346880234"
] |
u581187895 | p02911 | python | s541949156 | s340970213 | 648 | 250 | 21,460 | 8,244 | Accepted | Accepted | 61.42 | import numpy as np
from collections import Counter
N, K, Q = list(map(int, input().split()))
A = np.array([K]*N)-Q
correct = Counter([int(eval(input()))-1 for _ in range(Q)])
#correct = sorted(correct.;items(), key:lambda x: x[0])
for i in range(N):
if i in list(correct.keys()):
A[i] += correct[i]
... | N, K, Q = map(int, input().split())
score = [K-Q]*(N+1)
for _ in range(Q):
a = int(input())
score[a] += 1
[print("No" if ans < 1 else "Yes") for ans in score[1:]]
| 14 | 7 | 342 | 173 | import numpy as np
from collections import Counter
N, K, Q = list(map(int, input().split()))
A = np.array([K] * N) - Q
correct = Counter([int(eval(input())) - 1 for _ in range(Q)])
# correct = sorted(correct.;items(), key:lambda x: x[0])
for i in range(N):
if i in list(correct.keys()):
A[i] += correct[i]
... | N, K, Q = map(int, input().split())
score = [K - Q] * (N + 1)
for _ in range(Q):
a = int(input())
score[a] += 1
[print("No" if ans < 1 else "Yes") for ans in score[1:]]
| false | 50 | [
"-import numpy as np",
"-from collections import Counter",
"-",
"-N, K, Q = list(map(int, input().split()))",
"-A = np.array([K] * N) - Q",
"-correct = Counter([int(eval(input())) - 1 for _ in range(Q)])",
"-# correct = sorted(correct.;items(), key:lambda x: x[0])",
"-for i in range(N):",
"- if i... | false | 0.255947 | 0.036192 | 7.071886 | [
"s541949156",
"s340970213"
] |
u038676814 | p02576 | python | s417945968 | s169290971 | 31 | 25 | 9,116 | 9,120 | Accepted | Accepted | 19.35 | import math
N,X,T = list(map(int, input().split()))
print((math.ceil(N/X) * T)) | import math
N,X,T = list(map(int, input().split()))
print(((N+(X-1))//X * T)) | 3 | 3 | 73 | 71 | import math
N, X, T = list(map(int, input().split()))
print((math.ceil(N / X) * T))
| import math
N, X, T = list(map(int, input().split()))
print(((N + (X - 1)) // X * T))
| false | 0 | [
"-print((math.ceil(N / X) * T))",
"+print(((N + (X - 1)) // X * T))"
] | false | 0.043893 | 0.042562 | 1.031271 | [
"s417945968",
"s169290971"
] |
u172035535 | p03109 | python | s142132958 | s915915526 | 38 | 17 | 4,696 | 2,940 | Accepted | Accepted | 55.26 | import datetime
S = eval(input())
date_a = datetime.datetime(2019,4,30)
date_b = datetime.datetime.strptime(S,'%Y/%m/%d')
if date_a >= date_b:print('Heisei')
else:print('TBD') | s = eval(input())
if (int(s[:4]) >= 2019) and (int(s[5:7]) >= 5):
print('TBD')
else:
print('Heisei') | 6 | 6 | 174 | 102 | import datetime
S = eval(input())
date_a = datetime.datetime(2019, 4, 30)
date_b = datetime.datetime.strptime(S, "%Y/%m/%d")
if date_a >= date_b:
print("Heisei")
else:
print("TBD")
| s = eval(input())
if (int(s[:4]) >= 2019) and (int(s[5:7]) >= 5):
print("TBD")
else:
print("Heisei")
| false | 0 | [
"-import datetime",
"-",
"-S = eval(input())",
"-date_a = datetime.datetime(2019, 4, 30)",
"-date_b = datetime.datetime.strptime(S, \"%Y/%m/%d\")",
"-if date_a >= date_b:",
"+s = eval(input())",
"+if (int(s[:4]) >= 2019) and (int(s[5:7]) >= 5):",
"+ print(\"TBD\")",
"+else:",
"-else:",
"- ... | false | 0.043976 | 0.047878 | 0.918511 | [
"s142132958",
"s915915526"
] |
u912237403 | p00138 | python | s744679764 | s739203564 | 20 | 10 | 4,204 | 4,208 | Accepted | Accepted | 50 | x=[]
y=[]
for _ in [0]*3:
a = sorted([input().split()[::-1] for _ in [0]*8])
x += a[0:2]
y += a[2:4]
x += sorted(y)[0:2]
for e in x:
print(" ".join(e[::-1])) | x=[]
for e in [[input() for _ in [0]*8] for _ in [0]*3]+[x]:
b = sorted(e, key = lambda x: x.split()[1])
x += b[2:4]
print('\n'.join(b[:2])) | 10 | 5 | 178 | 153 | x = []
y = []
for _ in [0] * 3:
a = sorted([input().split()[::-1] for _ in [0] * 8])
x += a[0:2]
y += a[2:4]
x += sorted(y)[0:2]
for e in x:
print(" ".join(e[::-1]))
| x = []
for e in [[input() for _ in [0] * 8] for _ in [0] * 3] + [x]:
b = sorted(e, key=lambda x: x.split()[1])
x += b[2:4]
print("\n".join(b[:2]))
| false | 50 | [
"-y = []",
"-for _ in [0] * 3:",
"- a = sorted([input().split()[::-1] for _ in [0] * 8])",
"- x += a[0:2]",
"- y += a[2:4]",
"-x += sorted(y)[0:2]",
"-for e in x:",
"- print(\" \".join(e[::-1]))",
"+for e in [[input() for _ in [0] * 8] for _ in [0] * 3] + [x]:",
"+ b = sorted(e, key... | false | 0.035612 | 0.035015 | 1.01705 | [
"s744679764",
"s739203564"
] |
u991567869 | p02708 | python | s171991551 | s079722373 | 102 | 61 | 9,136 | 9,172 | Accepted | Accepted | 40.2 | n, k = list(map(int, input().split()))
ans = 0
for i in range(k - 1, n + 1):
ans += ((i + 1)*(n + n - i)//2)
for i in range(k - 1, n + 1):
ans -= (i + 1)*i//2
ans += n + 2 - k
print((ans%(10**9 + 7))) | n, k = list(map(int, input().split()))
ans = 0
for i in range(k - 1, n + 1):
ans += (i + 1)*(n - i) + 1
print((ans%(10**9 + 7))) | 9 | 7 | 209 | 132 | n, k = list(map(int, input().split()))
ans = 0
for i in range(k - 1, n + 1):
ans += (i + 1) * (n + n - i) // 2
for i in range(k - 1, n + 1):
ans -= (i + 1) * i // 2
ans += n + 2 - k
print((ans % (10**9 + 7)))
| n, k = list(map(int, input().split()))
ans = 0
for i in range(k - 1, n + 1):
ans += (i + 1) * (n - i) + 1
print((ans % (10**9 + 7)))
| false | 22.222222 | [
"- ans += (i + 1) * (n + n - i) // 2",
"-for i in range(k - 1, n + 1):",
"- ans -= (i + 1) * i // 2",
"-ans += n + 2 - k",
"+ ans += (i + 1) * (n - i) + 1"
] | false | 0.060089 | 0.115562 | 0.519969 | [
"s171991551",
"s079722373"
] |
u945181840 | p03283 | python | s181682501 | s560231891 | 1,450 | 608 | 99,788 | 99,824 | Accepted | Accepted | 58.07 | import numpy as np
import sys
readlines = sys.stdin.readlines()
N, M, Q = list(map(int, readlines[0].split()))
city = np.zeros((N + 2, N + 1), dtype=int)
L, R = np.array([i.split() for i in readlines[1:M + 1]], dtype=int).T
pq = [list(map(int, i.split())) for i in readlines[M + 1:]]
np.add.at(city, (L, R), 1... | import numpy as np
import sys
readlines = sys.stdin.readlines()
N, M, Q = list(map(int, readlines[0].split()))
city = np.zeros((N + 1, N + 1), dtype=int)
L, R = np.array([i.split() for i in readlines[1:M + 1]], dtype=int).T
p, q = np.array([i.split() for i in readlines[M + 1:]], dtype=int).T
np.add.at(city, ... | 15 | 16 | 476 | 502 | import numpy as np
import sys
readlines = sys.stdin.readlines()
N, M, Q = list(map(int, readlines[0].split()))
city = np.zeros((N + 2, N + 1), dtype=int)
L, R = np.array([i.split() for i in readlines[1 : M + 1]], dtype=int).T
pq = [list(map(int, i.split())) for i in readlines[M + 1 :]]
np.add.at(city, (L, R), 1)
np.cu... | import numpy as np
import sys
readlines = sys.stdin.readlines()
N, M, Q = list(map(int, readlines[0].split()))
city = np.zeros((N + 1, N + 1), dtype=int)
L, R = np.array([i.split() for i in readlines[1 : M + 1]], dtype=int).T
p, q = np.array([i.split() for i in readlines[M + 1 :]], dtype=int).T
np.add.at(city, (L, R),... | false | 6.25 | [
"-city = np.zeros((N + 2, N + 1), dtype=int)",
"+city = np.zeros((N + 1, N + 1), dtype=int)",
"-pq = [list(map(int, i.split())) for i in readlines[M + 1 :]]",
"+p, q = np.array([i.split() for i in readlines[M + 1 :]], dtype=int).T",
"-for p, q in pq:",
"- print((city[q][q] - city[q][p - 1] - city[p - 1... | false | 0.243396 | 0.239011 | 1.018347 | [
"s181682501",
"s560231891"
] |
u864013199 | p03062 | python | s475624028 | s242772937 | 294 | 201 | 26,060 | 25,584 | Accepted | Accepted | 31.63 | N = int(eval(input()))
A = list(map(int,input().split()))
#偶数個しか正負反転できない
#小さい順に並べてマイナスは全部、境界は判定
S = sorted([[i,A[i]] for i in range(N)],key=lambda x: x[1])
judge = [False]*N
for j in range(0,N-1,2):
if S[j][1]+S[j+1][1]<0:
judge[S[j][0]] = True
judge[S[j+1][0]] = True
for i in range(N-1):
... | N = int(eval(input()))
A = list(map(int,input().split()))
#アルゴリズム(動的計画法)で殴る解法
INF = float("inf")
dp = [[0,0] for _ in range(N+1)]
dp[0][1] = -INF
for i in range(N):
dp[i+1][0] = max(dp[i][0]+A[i],dp[i][1]-A[i])
dp[i+1][1] = max(dp[i][0]-A[i],dp[i][1]+A[i])
print((dp[N][0])) | 16 | 10 | 416 | 283 | N = int(eval(input()))
A = list(map(int, input().split()))
# 偶数個しか正負反転できない
# 小さい順に並べてマイナスは全部、境界は判定
S = sorted([[i, A[i]] for i in range(N)], key=lambda x: x[1])
judge = [False] * N
for j in range(0, N - 1, 2):
if S[j][1] + S[j + 1][1] < 0:
judge[S[j][0]] = True
judge[S[j + 1][0]] = True
for i in ran... | N = int(eval(input()))
A = list(map(int, input().split()))
# アルゴリズム(動的計画法)で殴る解法
INF = float("inf")
dp = [[0, 0] for _ in range(N + 1)]
dp[0][1] = -INF
for i in range(N):
dp[i + 1][0] = max(dp[i][0] + A[i], dp[i][1] - A[i])
dp[i + 1][1] = max(dp[i][0] - A[i], dp[i][1] + A[i])
print((dp[N][0]))
| false | 37.5 | [
"-# 偶数個しか正負反転できない",
"-# 小さい順に並べてマイナスは全部、境界は判定",
"-S = sorted([[i, A[i]] for i in range(N)], key=lambda x: x[1])",
"-judge = [False] * N",
"-for j in range(0, N - 1, 2):",
"- if S[j][1] + S[j + 1][1] < 0:",
"- judge[S[j][0]] = True",
"- judge[S[j + 1][0]] = True",
"-for i in range(N ... | false | 0.039099 | 0.08741 | 0.447312 | [
"s475624028",
"s242772937"
] |
u556799364 | p03565 | python | s633930171 | s530823040 | 161 | 30 | 38,256 | 9,036 | Accepted | Accepted | 81.37 | S = eval(input())
T = eval(input())
len_S, len_T = len(S), len(T)
def judge(start):
# print(S[start: start+len_T])
for j in range(len_T):
if S[start+j] == '?':
continue
elif S[start+j] == T[j]:
continue
else:
return False
... | # -*- coding: utf-8 -*-
S = eval(input())
T = eval(input())
candidates = []
for i in range(len(S) - len(T) + 1):
is_ok = True
for j in range(len(T)):
if S[i+j] == '?' or S[i+j] == T[j]:
pass
else:
is_ok = False
# print(is_ok)
if is_ok:
can... | 30 | 24 | 511 | 529 | S = eval(input())
T = eval(input())
len_S, len_T = len(S), len(T)
def judge(start):
# print(S[start: start+len_T])
for j in range(len_T):
if S[start + j] == "?":
continue
elif S[start + j] == T[j]:
continue
else:
return False
return True
for i ... | # -*- coding: utf-8 -*-
S = eval(input())
T = eval(input())
candidates = []
for i in range(len(S) - len(T) + 1):
is_ok = True
for j in range(len(T)):
if S[i + j] == "?" or S[i + j] == T[j]:
pass
else:
is_ok = False
# print(is_ok)
if is_ok:
candidate = S[:i... | false | 20 | [
"+# -*- coding: utf-8 -*-",
"-len_S, len_T = len(S), len(T)",
"-",
"-",
"-def judge(start):",
"- # print(S[start: start+len_T])",
"- for j in range(len_T):",
"- if S[start + j] == \"?\":",
"- continue",
"- elif S[start + j] == T[j]:",
"- continue",
"+c... | false | 0.038193 | 0.039746 | 0.960941 | [
"s633930171",
"s530823040"
] |
u510829608 | p02267 | python | s263575935 | s310799103 | 30 | 20 | 8,444 | 8,156 | Accepted | Accepted | 33.33 | n = int(eval(input()))
li1 = list(map(int,input().split()))
m = int(eval(input()))
li2 = list(map(int,input().split()))
cnt = 0
for i in li2:
if i in li1:
cnt +=1
print(cnt) | n = int(eval(input()))
S = set(map(int, input().split()))
q = int(eval(input()))
T = list(map(int, input().split()))
sum = 0
for i in T:
if i in S:
sum +=1
print(sum) | 10 | 12 | 174 | 188 | n = int(eval(input()))
li1 = list(map(int, input().split()))
m = int(eval(input()))
li2 = list(map(int, input().split()))
cnt = 0
for i in li2:
if i in li1:
cnt += 1
print(cnt)
| n = int(eval(input()))
S = set(map(int, input().split()))
q = int(eval(input()))
T = list(map(int, input().split()))
sum = 0
for i in T:
if i in S:
sum += 1
print(sum)
| false | 16.666667 | [
"-li1 = list(map(int, input().split()))",
"-m = int(eval(input()))",
"-li2 = list(map(int, input().split()))",
"-cnt = 0",
"-for i in li2:",
"- if i in li1:",
"- cnt += 1",
"-print(cnt)",
"+S = set(map(int, input().split()))",
"+q = int(eval(input()))",
"+T = list(map(int, input().spli... | false | 0.088696 | 0.081031 | 1.094602 | [
"s263575935",
"s310799103"
] |
u879870653 | p03208 | python | s680242974 | s144515683 | 284 | 238 | 8,280 | 8,280 | Accepted | Accepted | 16.2 | N,K = list(map(int,input().split()))
L = []
for i in range(N) :
l = int(eval(input()))
L.append(l)
L = sorted(L)
ans = 10**9+1
for i in range(len(L)-K+1) :
mi = L[i]
ma = L[i+K-1]
di = ma - mi
if di < ans :
ans = di
print(ans)
| N,K = list(map(int,input().split()))
L = sorted([int(eval(input())) for i in range(N)])
ans = float("inf")
for i in range(N-K+1) :
ans = min(ans, L[i+K-1]-L[i])
print(ans)
| 14 | 6 | 260 | 169 | N, K = list(map(int, input().split()))
L = []
for i in range(N):
l = int(eval(input()))
L.append(l)
L = sorted(L)
ans = 10**9 + 1
for i in range(len(L) - K + 1):
mi = L[i]
ma = L[i + K - 1]
di = ma - mi
if di < ans:
ans = di
print(ans)
| N, K = list(map(int, input().split()))
L = sorted([int(eval(input())) for i in range(N)])
ans = float("inf")
for i in range(N - K + 1):
ans = min(ans, L[i + K - 1] - L[i])
print(ans)
| false | 57.142857 | [
"-L = []",
"-for i in range(N):",
"- l = int(eval(input()))",
"- L.append(l)",
"-L = sorted(L)",
"-ans = 10**9 + 1",
"-for i in range(len(L) - K + 1):",
"- mi = L[i]",
"- ma = L[i + K - 1]",
"- di = ma - mi",
"- if di < ans:",
"- ans = di",
"+L = sorted([int(eval(inp... | false | 0.0495 | 0.048384 | 1.023058 | [
"s680242974",
"s144515683"
] |
u141786930 | p03557 | python | s644850281 | s219042647 | 396 | 307 | 23,360 | 24,844 | Accepted | Accepted | 22.47 | # C - Snuke Festival
import bisect
N = int(eval(input()))
A = list(int(x) for x in input().split())
B = list(int(x) for x in input().split())
C = list(int(x) for x in input().split())
A.sort()
C.sort()
ans = 0
for j in range(N):
ans += bisect.bisect_left(A, B[j]) * (N - bisect.bisect_right(C, B[j]... | # C - Snuke Festival
import numpy as np
N = int(eval(input()))
A = np.array(list(int(x) for x in input().split()))
B = np.array(list(int(x) for x in input().split()))
C = np.array(list(int(x) for x in input().split()))
A.sort()
C.sort()
ans = np.sum(np.searchsorted(A, B,'left') * (N - np.searchsorted(C, B,'... | 17 | 12 | 330 | 335 | # C - Snuke Festival
import bisect
N = int(eval(input()))
A = list(int(x) for x in input().split())
B = list(int(x) for x in input().split())
C = list(int(x) for x in input().split())
A.sort()
C.sort()
ans = 0
for j in range(N):
ans += bisect.bisect_left(A, B[j]) * (N - bisect.bisect_right(C, B[j]))
print(ans)
| # C - Snuke Festival
import numpy as np
N = int(eval(input()))
A = np.array(list(int(x) for x in input().split()))
B = np.array(list(int(x) for x in input().split()))
C = np.array(list(int(x) for x in input().split()))
A.sort()
C.sort()
ans = np.sum(np.searchsorted(A, B, "left") * (N - np.searchsorted(C, B, "right")))... | false | 29.411765 | [
"-import bisect",
"+import numpy as np",
"-A = list(int(x) for x in input().split())",
"-B = list(int(x) for x in input().split())",
"-C = list(int(x) for x in input().split())",
"+A = np.array(list(int(x) for x in input().split()))",
"+B = np.array(list(int(x) for x in input().split()))",
"+C = np.ar... | false | 0.088377 | 0.234337 | 0.377138 | [
"s644850281",
"s219042647"
] |
u506910932 | p02756 | python | s669657480 | s660440593 | 512 | 286 | 8,436 | 8,692 | Accepted | Accepted | 44.14 | from collections import deque
d = deque(eval(input()))
reverse = -1
n = int(eval(input()))
for i in range(n):
query = input().split()
if len(query) == 1:
reverse *= (-1)
else:
f = int(query[1])
c = query[2]
if reverse == -1:
if f == 1:
... | from collections import deque
import sys
input = lambda: sys.stdin.readline().rstrip()
d = deque(eval(input()))
reverse = -1
n = int(eval(input()))
for i in range(n):
query = input().split()
if len(query) == 1:
reverse *= (-1)
else:
f = int(query[1])
c = query[2]
... | 27 | 29 | 553 | 622 | from collections import deque
d = deque(eval(input()))
reverse = -1
n = int(eval(input()))
for i in range(n):
query = input().split()
if len(query) == 1:
reverse *= -1
else:
f = int(query[1])
c = query[2]
if reverse == -1:
if f == 1:
d.appendleft(... | from collections import deque
import sys
input = lambda: sys.stdin.readline().rstrip()
d = deque(eval(input()))
reverse = -1
n = int(eval(input()))
for i in range(n):
query = input().split()
if len(query) == 1:
reverse *= -1
else:
f = int(query[1])
c = query[2]
if reverse ==... | false | 6.896552 | [
"+import sys",
"+input = lambda: sys.stdin.readline().rstrip()",
"+# print(d)"
] | false | 0.035876 | 0.079834 | 0.449381 | [
"s669657480",
"s660440593"
] |
u046187684 | p03136 | python | s692663910 | s618623728 | 195 | 175 | 38,384 | 38,708 | Accepted | Accepted | 10.26 | def solve(string):
l = list(map(int, string.split()))
l= sorted(l)
return "Yes" if sum(l[:len(l)-1]) > l[-1] else "No"
if __name__ == '__main__':
eval(input())
print((solve(eval(input()))))
| def solve(string):
n, *l = list(map(int, string.split()))
l= sorted(l)
return "Yes" if sum(l[:-1]) > l[-1] else "No"
if __name__ == '__main__':
print((solve("\n".join([eval(input()), eval(input())]))))
| 9 | 8 | 200 | 207 | def solve(string):
l = list(map(int, string.split()))
l = sorted(l)
return "Yes" if sum(l[: len(l) - 1]) > l[-1] else "No"
if __name__ == "__main__":
eval(input())
print((solve(eval(input()))))
| def solve(string):
n, *l = list(map(int, string.split()))
l = sorted(l)
return "Yes" if sum(l[:-1]) > l[-1] else "No"
if __name__ == "__main__":
print((solve("\n".join([eval(input()), eval(input())]))))
| false | 11.111111 | [
"- l = list(map(int, string.split()))",
"+ n, *l = list(map(int, string.split()))",
"- return \"Yes\" if sum(l[: len(l) - 1]) > l[-1] else \"No\"",
"+ return \"Yes\" if sum(l[:-1]) > l[-1] else \"No\"",
"- eval(input())",
"- print((solve(eval(input()))))",
"+ print((solve(\"\\n\".jo... | false | 0.047511 | 0.006705 | 7.085777 | [
"s692663910",
"s618623728"
] |
u970899068 | p02756 | python | s698385099 | s420695109 | 996 | 906 | 118,140 | 118,744 | Accepted | Accepted | 9.04 | import collections
from collections import deque
s= eval(input())
n=int(eval(input()))
q= [list(input().split()) for i in range(n)]
s=deque(s)
flag=True
for i in range(n):
if q[i][0]==str(1):
if flag:
flag=False
else:
flag=True
else:
if flag:
... | import collections
from collections import deque
s= eval(input())
n=int(eval(input()))
q= [list(input().split()) for i in range(n)]
s=deque(s)
flag=True
for i in range(n):
if q[i][0]==str(1):
if flag:
flag=False
else:
flag=True
else:
if q[i][1]==... | 30 | 30 | 623 | 626 | import collections
from collections import deque
s = eval(input())
n = int(eval(input()))
q = [list(input().split()) for i in range(n)]
s = deque(s)
flag = True
for i in range(n):
if q[i][0] == str(1):
if flag:
flag = False
else:
flag = True
else:
if flag:
... | import collections
from collections import deque
s = eval(input())
n = int(eval(input()))
q = [list(input().split()) for i in range(n)]
s = deque(s)
flag = True
for i in range(n):
if q[i][0] == str(1):
if flag:
flag = False
else:
flag = True
else:
if q[i][1] == s... | false | 0 | [
"- if flag:",
"- if q[i][1] == str(1):",
"+ if q[i][1] == str(1):",
"+ if flag:",
"- else:",
"- if q[i][1] == str(1):",
"+ if q[i][1] == str(2):",
"+ if flag:"
] | false | 0.035743 | 0.037484 | 0.953565 | [
"s698385099",
"s420695109"
] |
u977193988 | p03044 | python | s513860544 | s958204344 | 741 | 548 | 49,184 | 42,872 | Accepted | Accepted | 26.05 | import sys
import heapq
def input():
return sys.stdin.readline().strip()
def dijkstra(start, n_nodes, edge):
dist = [float("inf")] * n_nodes
dist[start] = 0
# 優先度キューの準備
q = [(dist[start], start)]
heapq.heapify(q)
while q:
# スタートから最も最短距離のものを取り出す
d, i = heap... | import sys
import heapq
def input():
return sys.stdin.readline().strip()
def dijkstra(start, n_nodes, edge):
dist = [float("inf")] * n_nodes
dist[start] = 0
# 優先度キューの準備
q = [(dist[start], start)]
heapq.heapify(q)
while q:
# スタートから最も最短距離のものを取り出す
d, i = heap... | 47 | 47 | 1,134 | 1,134 | import sys
import heapq
def input():
return sys.stdin.readline().strip()
def dijkstra(start, n_nodes, edge):
dist = [float("inf")] * n_nodes
dist[start] = 0
# 優先度キューの準備
q = [(dist[start], start)]
heapq.heapify(q)
while q:
# スタートから最も最短距離のものを取り出す
d, i = heapq.heappop(q)
... | import sys
import heapq
def input():
return sys.stdin.readline().strip()
def dijkstra(start, n_nodes, edge):
dist = [float("inf")] * n_nodes
dist[start] = 0
# 優先度キューの準備
q = [(dist[start], start)]
heapq.heapify(q)
while q:
# スタートから最も最短距離のものを取り出す
d, i = heapq.heappop(q)
... | false | 0 | [
"- edge[u - 1].append([w, v - 1])",
"- edge[v - 1].append([w, u - 1])",
"+ edge[u - 1].append((w, v - 1))",
"+ edge[v - 1].append((w, u - 1))"
] | false | 0.034546 | 0.03237 | 1.067231 | [
"s513860544",
"s958204344"
] |
u225388820 | p03164 | python | s246553451 | s182105973 | 1,061 | 577 | 314,484 | 173,040 | Accepted | Accepted | 45.62 | """
重さと価値がそれぞれw_i,v_iであるようなn個の品物がある.
これらの品物の中から, 重さの総和がWを超えないように選んだ時の,
価値の総和の最大値を求めよ.
1<=n<=100, 1<=w_i<=10^7, 1<=v_i<=100, 1<=W<=10^9
"""
#-------------------------------------------------------------------------------
#入力
INF=float('inf')
n ,W= list(map(int, input().split()))
w=[0]*n
v=[0]*n
for i in ra... | """
重さと価値がそれぞれw_i,v_iであるようなn個の品物がある.
これらの品物の中から, 重さの総和がWを超えないように選んだ時の,
価値の総和の最大値を求めよ.
1<=n<=100, 1<=w_i<=10^7, 1<=v_i<=100, 1<=W<=10^9
"""
#-------------------------------------------------------------------------------
#入力
INF=2*10**9
n,W = list(map(int,input().split()))
w=[0]*n
v=[0]*n
for i in range(n)... | 31 | 31 | 701 | 717 | """
重さと価値がそれぞれw_i,v_iであるようなn個の品物がある.
これらの品物の中から, 重さの総和がWを超えないように選んだ時の,
価値の総和の最大値を求めよ.
1<=n<=100, 1<=w_i<=10^7, 1<=v_i<=100, 1<=W<=10^9
"""
# -------------------------------------------------------------------------------
# 入力
INF = float("inf")
n, W = list(map(int, input().split()))
w = [0] * n
v = [0] * n
for i in ran... | """
重さと価値がそれぞれw_i,v_iであるようなn個の品物がある.
これらの品物の中から, 重さの総和がWを超えないように選んだ時の,
価値の総和の最大値を求めよ.
1<=n<=100, 1<=w_i<=10^7, 1<=v_i<=100, 1<=W<=10^9
"""
# -------------------------------------------------------------------------------
# 入力
INF = 2 * 10**9
n, W = list(map(int, input().split()))
w = [0] * n
v = [0] * n
for i in range(... | false | 0 | [
"-INF = float(\"inf\")",
"+INF = 2 * 10**9",
"-V = sum(v)",
"-dp = [[INF for i in range(V + 1)] for j in range(n + 1)]",
"+max_v = max(v)",
"+dp = [[INF for i in range(n * max_v + 1)] for j in range(n + 1)]",
"- for j in range(V + 1):",
"+ for j in range(n * max_v + 1):",
"-for i in range(V + ... | false | 0.037051 | 0.036357 | 1.019074 | [
"s246553451",
"s182105973"
] |
u022407960 | p02242 | python | s999625718 | s061698784 | 50 | 30 | 8,908 | 8,252 | Accepted | Accepted | 40 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
input:
5
0 3 2 3 3 1 1 2
1 2 0 2 3 4
2 3 0 3 3 1 4 1
3 4 2 1 0 1 1 4 4 3
4 2 2 1 3 3
output:
0 0
1 2
2 2
3 1
4 3
"""
import sys
import heapq as hp
WHITE, GRAY, BLACK = 0, 1, 2
D_MAX = int(1e7 + 1)
def generate_adj_matrix(v_info):
fo... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
input:
5
0 3 2 3 3 1 1 2
1 2 0 2 3 4
2 3 0 3 3 1 4 1
3 4 2 1 0 1 1 4 4 3
4 2 2 1 3 3
output:
0 0
1 2
2 2
3 1
4 3
"""
import sys
import heapq as hp
WHITE, GRAY, BLACK = 0, 1, 2
D_MAX = int(1e7 + 1)
def generate_adj_matrix(v_info):
fo... | 82 | 81 | 2,407 | 2,324 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
input:
5
0 3 2 3 3 1 1 2
1 2 0 2 3 4
2 3 0 3 3 1 4 1
3 4 2 1 0 1 1 4 4 3
4 2 2 1 3 3
output:
0 0
1 2
2 2
3 1
4 3
"""
import sys
import heapq as hp
WHITE, GRAY, BLACK = 0, 1, 2
D_MAX = int(1e7 + 1)
def generate_adj_matrix(v_info):
for v_detail in v_info:
v... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
input:
5
0 3 2 3 3 1 1 2
1 2 0 2 3 4
2 3 0 3 3 1 4 1
3 4 2 1 0 1 1 4 4 3
4 2 2 1 3 3
output:
0 0
1 2
2 2
3 1
4 3
"""
import sys
import heapq as hp
WHITE, GRAY, BLACK = 0, 1, 2
D_MAX = int(1e7 + 1)
def generate_adj_matrix(v_info):
for each in v_info:
v_ind... | false | 1.219512 | [
"- for v_detail in v_info:",
"- v_index = int(v_detail[0])",
"- v_adj_length = int(v_detail[1])",
"- v_adj_list = v_detail[2:]",
"+ for each in v_info:",
"+ v_index, v_adj_length, *v_adj_list = list(map(int, each))",
"- for j in range(0, v_adj_length * 2, 2):",
... | false | 0.157625 | 0.050897 | 3.096943 | [
"s999625718",
"s061698784"
] |
u589734885 | p02548 | python | s014839218 | s938691954 | 404 | 109 | 9,152 | 9,124 | Accepted | Accepted | 73.02 | n = int(eval(input()))
a, b, c = 1, 1, 1
ans = 0
while n >= c:
while b <= (n-c):
ans += (n-c)//b
b += 1
c += 1
print(ans)
| def solve1():
n = int(eval(input()))
a, b, c = 1, 1, 1
ans = 0
while n >= c:
while b <= (n-c):
ans += (n-c)//b
b += 1
c += 1
print(ans)
def solve2():
n = int(eval(input()))
ans = 0
for i in range(1, n):
ans += (n-1)/... | 11 | 25 | 152 | 343 | n = int(eval(input()))
a, b, c = 1, 1, 1
ans = 0
while n >= c:
while b <= (n - c):
ans += (n - c) // b
b += 1
c += 1
print(ans)
| def solve1():
n = int(eval(input()))
a, b, c = 1, 1, 1
ans = 0
while n >= c:
while b <= (n - c):
ans += (n - c) // b
b += 1
c += 1
print(ans)
def solve2():
n = int(eval(input()))
ans = 0
for i in range(1, n):
ans += (n - 1) // i
print... | false | 56 | [
"-n = int(eval(input()))",
"-a, b, c = 1, 1, 1",
"-ans = 0",
"-while n >= c:",
"- while b <= (n - c):",
"- ans += (n - c) // b",
"- b += 1",
"- c += 1",
"-print(ans)",
"+def solve1():",
"+ n = int(eval(input()))",
"+ a, b, c = 1, 1, 1",
"+ ans = 0",
"+ while... | false | 0.089419 | 0.190903 | 0.468399 | [
"s014839218",
"s938691954"
] |
u607865971 | p03675 | python | s747458694 | s221273015 | 182 | 167 | 29,252 | 29,124 | Accepted | Accepted | 8.24 | import sys
import collections
import math
n = int(eval(input()))
A = [int(x) for x in input().split()]
R = [0] * n
idx = 0
for i in range(n-1, -1, -2):
R[idx] = A[i]
idx += 1
for i in range(n % 2, n, +2):
R[idx] = A[i]
idx += 1
print((" ".join([str(i) for i in R])))
sys.exit(0)... |
import sys
import collections
import math
from collections import Counter
from collections import deque
n = int(eval(input()))
A = [int(x) for x in input().split()]
Q = deque()
f = True
if n % 2 == 0:
f = not f
for a in A:
if f:
Q.appendleft(a)
else:
Q.append(a)
... | 21 | 26 | 313 | 380 | import sys
import collections
import math
n = int(eval(input()))
A = [int(x) for x in input().split()]
R = [0] * n
idx = 0
for i in range(n - 1, -1, -2):
R[idx] = A[i]
idx += 1
for i in range(n % 2, n, +2):
R[idx] = A[i]
idx += 1
print((" ".join([str(i) for i in R])))
sys.exit(0)
| import sys
import collections
import math
from collections import Counter
from collections import deque
n = int(eval(input()))
A = [int(x) for x in input().split()]
Q = deque()
f = True
if n % 2 == 0:
f = not f
for a in A:
if f:
Q.appendleft(a)
else:
Q.append(a)
f = not f
print((" ".joi... | false | 19.230769 | [
"+from collections import Counter",
"+from collections import deque",
"-R = [0] * n",
"-idx = 0",
"-for i in range(n - 1, -1, -2):",
"- R[idx] = A[i]",
"- idx += 1",
"-for i in range(n % 2, n, +2):",
"- R[idx] = A[i]",
"- idx += 1",
"-print((\" \".join([str(i) for i in R])))",
"+Q ... | false | 0.048572 | 0.049017 | 0.990916 | [
"s747458694",
"s221273015"
] |
u126232616 | p03457 | python | s229872967 | s501903224 | 368 | 189 | 3,060 | 10,284 | Accepted | Accepted | 48.64 | n = int(eval(input()))
ans = "Yes"
t,x,y = 0,0,0
for i in range(n):
t1,x1,y1 = list(map(int,input().split()))
td,dis = t1-t,x1+y1-x-y
if td%2 != dis%2 or td < dis:
ans = "No"
break
t,x,y = t1,x1,y1
print(ans) | from sys import stdin
input = stdin.readline
lines = stdin.readlines
n = int(eval(input()))
txy = ((list(map(int, line.split()))) for line in lines())
ans = "Yes"
t,x,y = 0,0,0
for t1,x1,y1 in txy:
td,dis = t1-t,abs(x1-x)+abs(y1-y)
if td%2 != dis%2 or td < dis:
ans = "No"
... | 11 | 19 | 238 | 349 | n = int(eval(input()))
ans = "Yes"
t, x, y = 0, 0, 0
for i in range(n):
t1, x1, y1 = list(map(int, input().split()))
td, dis = t1 - t, x1 + y1 - x - y
if td % 2 != dis % 2 or td < dis:
ans = "No"
break
t, x, y = t1, x1, y1
print(ans)
| from sys import stdin
input = stdin.readline
lines = stdin.readlines
n = int(eval(input()))
txy = ((list(map(int, line.split()))) for line in lines())
ans = "Yes"
t, x, y = 0, 0, 0
for t1, x1, y1 in txy:
td, dis = t1 - t, abs(x1 - x) + abs(y1 - y)
if td % 2 != dis % 2 or td < dis:
ans = "No"
br... | false | 42.105263 | [
"+from sys import stdin",
"+",
"+input = stdin.readline",
"+lines = stdin.readlines",
"+txy = ((list(map(int, line.split()))) for line in lines())",
"-for i in range(n):",
"- t1, x1, y1 = list(map(int, input().split()))",
"- td, dis = t1 - t, x1 + y1 - x - y",
"+for t1, x1, y1 in txy:",
"+ ... | false | 0.038434 | 0.039474 | 0.973659 | [
"s229872967",
"s501903224"
] |
u808427016 | p03222 | python | s095961042 | s373648150 | 33 | 20 | 3,064 | 3,064 | Accepted | Accepted | 39.39 | H, W, K = [int(_) for _ in input().split()]
MOD = 1000000007
P = [""]
for i in range(W - 1):
Q = []
for p in P:
Q.append(p + "0")
if len(p) == 0 or p[-1] == "0":
Q.append(p + "1")
P = Q
rs = [1] + [0] * (W - 1)
for j in range(H):
nrs = [0] * W
for p i... | H, W, K = [int(_) for _ in input().split()]
MOD = 1000000007
pats = [[0]]
for i in range(1, W):
pats = [p + [i] for p in pats] + [p[:-1] + [i, i - 1] for p in pats if p[-1] == i - 1]
rs = [1] + [0] * (W - 1)
for j in range(H):
rs = [sum(rs[p[i]] for p in pats) % MOD for i in range(W)]
print(... | 27 | 15 | 572 | 331 | H, W, K = [int(_) for _ in input().split()]
MOD = 1000000007
P = [""]
for i in range(W - 1):
Q = []
for p in P:
Q.append(p + "0")
if len(p) == 0 or p[-1] == "0":
Q.append(p + "1")
P = Q
rs = [1] + [0] * (W - 1)
for j in range(H):
nrs = [0] * W
for p in P:
drs = rs... | H, W, K = [int(_) for _ in input().split()]
MOD = 1000000007
pats = [[0]]
for i in range(1, W):
pats = [p + [i] for p in pats] + [
p[:-1] + [i, i - 1] for p in pats if p[-1] == i - 1
]
rs = [1] + [0] * (W - 1)
for j in range(H):
rs = [sum(rs[p[i]] for p in pats) % MOD for i in range(W)]
print((rs[K ... | false | 44.444444 | [
"-P = [\"\"]",
"-for i in range(W - 1):",
"- Q = []",
"- for p in P:",
"- Q.append(p + \"0\")",
"- if len(p) == 0 or p[-1] == \"0\":",
"- Q.append(p + \"1\")",
"- P = Q",
"+pats = [[0]]",
"+for i in range(1, W):",
"+ pats = [p + [i] for p in pats] + [",
"+ ... | false | 0.077447 | 0.084819 | 0.91309 | [
"s095961042",
"s373648150"
] |
u896741788 | p03162 | python | s279395079 | s845571127 | 940 | 732 | 47,188 | 22,804 | Accepted | Accepted | 22.13 | n=int(eval(input()))
al=[0]+[list(map(int,input().split())) for _ in range(n)]
dp=[[0,0,0] for _ in range(n+1)]
for day in range(1,n+1):
for i in range(3):
for j in range(3):
if i==j:continue
dp[day][i]=max(dp[day-1][j]+al[day][i],dp[day][i])
print((max(dp[-1]))) | import sys
input=sys.stdin.readline
n=int(eval(input()))
l=[[float("INF")]*3 for i in range(n)]
l[0]=list(map(int,input().split()))
for day in range(1,n):
f=list(map(int,input().split()))
for choice in range(3):
l[day][choice]=max(l[day-1][j]+f[choice] for j in range(3) if j!=choice)
print((max... | 9 | 10 | 281 | 321 | n = int(eval(input()))
al = [0] + [list(map(int, input().split())) for _ in range(n)]
dp = [[0, 0, 0] for _ in range(n + 1)]
for day in range(1, n + 1):
for i in range(3):
for j in range(3):
if i == j:
continue
dp[day][i] = max(dp[day - 1][j] + al[day][i], dp[day][i])... | import sys
input = sys.stdin.readline
n = int(eval(input()))
l = [[float("INF")] * 3 for i in range(n)]
l[0] = list(map(int, input().split()))
for day in range(1, n):
f = list(map(int, input().split()))
for choice in range(3):
l[day][choice] = max(l[day - 1][j] + f[choice] for j in range(3) if j != cho... | false | 10 | [
"+import sys",
"+",
"+input = sys.stdin.readline",
"-al = [0] + [list(map(int, input().split())) for _ in range(n)]",
"-dp = [[0, 0, 0] for _ in range(n + 1)]",
"-for day in range(1, n + 1):",
"- for i in range(3):",
"- for j in range(3):",
"- if i == j:",
"- co... | false | 0.035089 | 0.032173 | 1.090636 | [
"s279395079",
"s845571127"
] |
u597455618 | p02899 | python | s981534447 | s083626007 | 122 | 98 | 14,008 | 18,376 | Accepted | Accepted | 19.67 | n = int(eval(input()))
h = tuple(map(int, input().split()))
ans = [0]*n
for i in range(n):
ans[h[i]-1] = i+1
print((*ans)) | n = int(eval(input()))
h = tuple(map(int, input().split()))
ans = [0]*n
for i in range(n):
ans[h[i]-1] = i+1
print((" ".join(map(str, ans)))) | 6 | 6 | 121 | 140 | n = int(eval(input()))
h = tuple(map(int, input().split()))
ans = [0] * n
for i in range(n):
ans[h[i] - 1] = i + 1
print((*ans))
| n = int(eval(input()))
h = tuple(map(int, input().split()))
ans = [0] * n
for i in range(n):
ans[h[i] - 1] = i + 1
print((" ".join(map(str, ans))))
| false | 0 | [
"-print((*ans))",
"+print((\" \".join(map(str, ans))))"
] | false | 0.04356 | 0.043026 | 1.012418 | [
"s981534447",
"s083626007"
] |
u440985596 | p03014 | python | s280312095 | s499827076 | 926 | 826 | 183,684 | 182,792 | Accepted | Accepted | 10.8 | def main():
h, w = list(map(int, input().split()))
ss = [eval(input()) for _ in range(h)]
matl = [[0 for _ in range(w)] for _ in range(h)]
matr = [[0 for _ in range(w)] for _ in range(h)]
matu = [[0 for _ in range(w)] for _ in range(h)]
matd = [[0 for _ in range(w)] for _ in range(h)]
... | import sys
def input():
return sys.stdin.readline()[:-1]
def main():
h, w = list(map(int, input().split()))
ss = [eval(input()) for _ in range(h)]
matl = [[0 for _ in range(w)] for _ in range(h)]
matr = [[0 for _ in range(w)] for _ in range(h)]
matu = [[0 for _ in range(w)] for _ in ... | 49 | 53 | 1,458 | 1,524 | def main():
h, w = list(map(int, input().split()))
ss = [eval(input()) for _ in range(h)]
matl = [[0 for _ in range(w)] for _ in range(h)]
matr = [[0 for _ in range(w)] for _ in range(h)]
matu = [[0 for _ in range(w)] for _ in range(h)]
matd = [[0 for _ in range(w)] for _ in range(h)]
for j ... | import sys
def input():
return sys.stdin.readline()[:-1]
def main():
h, w = list(map(int, input().split()))
ss = [eval(input()) for _ in range(h)]
matl = [[0 for _ in range(w)] for _ in range(h)]
matr = [[0 for _ in range(w)] for _ in range(h)]
matu = [[0 for _ in range(w)] for _ in range(h)... | false | 7.54717 | [
"+import sys",
"+",
"+",
"+def input():",
"+ return sys.stdin.readline()[:-1]",
"+",
"+"
] | false | 0.03427 | 0.038176 | 0.89768 | [
"s280312095",
"s499827076"
] |
u292810930 | p03088 | python | s427102395 | s227263817 | 133 | 117 | 3,872 | 3,896 | Accepted | Accepted | 12.03 | N, MOD = int(eval(input())), 10**9+7
memo = [{} for i in range(N+1)]
def ok(last4):
for i in range(4):
t = list(last4)
if i >= 1:
t[i-1], t[i] = t[i], t[i-1]
if ''.join(t).count('AGC') >= 1:
return False
return True
def dfs(cur, last3):
#メモ化
... | #貰うDP
import itertools
N, MOD = int(eval(input())), 10**9+7
memo = [{'AGC':0, 'ACG':0, 'GAC':0} for i in range(N + 1)]
C = list('ACGT')
for c in itertools.product(C, C, C):
c = ''.join(c)
if c in memo[3]:
continue
else:
memo[3][c] = 1
def ok(last4):
for i in range(4):
... | 28 | 40 | 630 | 944 | N, MOD = int(eval(input())), 10**9 + 7
memo = [{} for i in range(N + 1)]
def ok(last4):
for i in range(4):
t = list(last4)
if i >= 1:
t[i - 1], t[i] = t[i], t[i - 1]
if "".join(t).count("AGC") >= 1:
return False
return True
def dfs(cur, last3):
# メモ化
i... | # 貰うDP
import itertools
N, MOD = int(eval(input())), 10**9 + 7
memo = [{"AGC": 0, "ACG": 0, "GAC": 0} for i in range(N + 1)]
C = list("ACGT")
for c in itertools.product(C, C, C):
c = "".join(c)
if c in memo[3]:
continue
else:
memo[3][c] = 1
def ok(last4):
for i in range(4):
t ... | false | 30 | [
"+# 貰うDP",
"+import itertools",
"+",
"-memo = [{} for i in range(N + 1)]",
"+memo = [{\"AGC\": 0, \"ACG\": 0, \"GAC\": 0} for i in range(N + 1)]",
"+C = list(\"ACGT\")",
"+for c in itertools.product(C, C, C):",
"+ c = \"\".join(c)",
"+ if c in memo[3]:",
"+ continue",
"+ else:",
... | false | 0.11105 | 0.08253 | 1.345575 | [
"s427102395",
"s227263817"
] |
u546285759 | p00218 | python | s449914539 | s609606461 | 80 | 70 | 7,716 | 7,720 | Accepted | Accepted | 12.5 | while True:
n = int(eval(input()))
if n == 0:
break
for _ in range(n):
p = list(map(int, input().split()))
if 100 in p:
print("A")
elif (p[0] + p[1]) // 2 >= 90:
print("A")
elif sum(p) // 3 >= 80:
print("A")
elif... | while True:
n = int(eval(input()))
if n == 0:
break
for _ in range(n):
p = list(map(int, input().split()))
x = sum(p) // 3
if 100 in p:
print("A")
elif (p[0] + p[1]) // 2 >= 90:
print("A")
elif x >= 80:
print("A"... | 18 | 19 | 484 | 479 | while True:
n = int(eval(input()))
if n == 0:
break
for _ in range(n):
p = list(map(int, input().split()))
if 100 in p:
print("A")
elif (p[0] + p[1]) // 2 >= 90:
print("A")
elif sum(p) // 3 >= 80:
print("A")
elif sum(p) // 3... | while True:
n = int(eval(input()))
if n == 0:
break
for _ in range(n):
p = list(map(int, input().split()))
x = sum(p) // 3
if 100 in p:
print("A")
elif (p[0] + p[1]) // 2 >= 90:
print("A")
elif x >= 80:
print("A")
el... | false | 5.263158 | [
"+ x = sum(p) // 3",
"- elif sum(p) // 3 >= 80:",
"+ elif x >= 80:",
"- elif sum(p) // 3 >= 70:",
"+ elif x >= 70:",
"- elif sum(p) // 3 >= 50 and (p[0] >= 80 or p[1] >= 80):",
"+ elif x >= 50 and (p[0] >= 80 or p[1] >= 80):"
] | false | 0.083675 | 0.077253 | 1.083129 | [
"s449914539",
"s609606461"
] |
u094999522 | p02720 | python | s419439455 | s765204499 | 248 | 83 | 16,392 | 18,668 | Accepted | Accepted | 66.53 | #!/usr/bin/env python3
from heapq import *
a = [*list(range(1, 10))]
heapify(a)
i = 0
k = int(eval(input()))
c = 0
while True:
t = str(heappop(a))
i += 1
if i == k:
break
if t[-1] != "0":
heappush(a, int(t + str(int(t[-1]) - 1)))
heappush(a, int(t + t[-1]))
if t[... | # !/usr/bin/env python3
# from heapq import *
#
# a = [*range(1, 10)]
# heapify(a)
# i = 0
# k = int(input())
# c = 0
# while True:
# t = str(heappop(a))
# i += 1
# if i == k:
# break
# if t[-1] != "0":
# heappush(a, int(t + str(int(t[-1]) - 1)))
# heappush(a, int(t + t[-1]))... | 19 | 33 | 381 | 669 | #!/usr/bin/env python3
from heapq import *
a = [*list(range(1, 10))]
heapify(a)
i = 0
k = int(eval(input()))
c = 0
while True:
t = str(heappop(a))
i += 1
if i == k:
break
if t[-1] != "0":
heappush(a, int(t + str(int(t[-1]) - 1)))
heappush(a, int(t + t[-1]))
if t[-1] != "9":
... | # !/usr/bin/env python3
# from heapq import *
#
# a = [*range(1, 10)]
# heapify(a)
# i = 0
# k = int(input())
# c = 0
# while True:
# t = str(heappop(a))
# i += 1
# if i == k:
# break
# if t[-1] != "0":
# heappush(a, int(t + str(int(t[-1]) - 1)))
# heappush(a, int(t + t[-1]))
# if t[-1] ... | false | 42.424242 | [
"-#!/usr/bin/env python3",
"-from heapq import *",
"+# !/usr/bin/env python3",
"+# from heapq import *",
"+#",
"+# a = [*range(1, 10)]",
"+# heapify(a)",
"+# i = 0",
"+# k = int(input())",
"+# c = 0",
"+# while True:",
"+# t = str(heappop(a))",
"+# i += 1",
"+# if i == k:",
"+# ... | false | 0.062596 | 0.134877 | 0.464094 | [
"s419439455",
"s765204499"
] |
u673361376 | p03127 | python | s544325461 | s714005840 | 372 | 78 | 91,028 | 16,368 | Accepted | Accepted | 79.03 | from fractions import gcd
from functools import reduce
import copy
N = int(eval(input()))
alist = list(map(int, input().split()))
while len(alist) > 1:
min_a = min(alist)
alist.remove(min_a)
new_alist = [min_a]
for a in alist:
if int(a%min_a) != 0:
new_alist.append(int(a%min_a))
alis... | import fractions
import functools
_ = int(eval(input()))
print((functools.reduce(fractions.gcd, list(map(int, input().split()))))) | 17 | 4 | 365 | 125 | from fractions import gcd
from functools import reduce
import copy
N = int(eval(input()))
alist = list(map(int, input().split()))
while len(alist) > 1:
min_a = min(alist)
alist.remove(min_a)
new_alist = [min_a]
for a in alist:
if int(a % min_a) != 0:
new_alist.append(int(a % min_a))... | import fractions
import functools
_ = int(eval(input()))
print((functools.reduce(fractions.gcd, list(map(int, input().split())))))
| false | 76.470588 | [
"-from fractions import gcd",
"-from functools import reduce",
"-import copy",
"+import fractions",
"+import functools",
"-N = int(eval(input()))",
"-alist = list(map(int, input().split()))",
"-while len(alist) > 1:",
"- min_a = min(alist)",
"- alist.remove(min_a)",
"- new_alist = [min_... | false | 0.042266 | 0.042484 | 0.994859 | [
"s544325461",
"s714005840"
] |
u085329544 | p02687 | python | s002369822 | s612693214 | 24 | 20 | 8,920 | 9,064 | Accepted | Accepted | 16.67 | s = eval(input())
if s[1] == 'B':
ss = s.replace('B','R')
else:
ss = s.replace('R','B')
print(ss) | s = eval(input())
if s == 'ABC':
print('ARC')
else:
print('ABC') | 8 | 6 | 104 | 68 | s = eval(input())
if s[1] == "B":
ss = s.replace("B", "R")
else:
ss = s.replace("R", "B")
print(ss)
| s = eval(input())
if s == "ABC":
print("ARC")
else:
print("ABC")
| false | 25 | [
"-if s[1] == \"B\":",
"- ss = s.replace(\"B\", \"R\")",
"+if s == \"ABC\":",
"+ print(\"ARC\")",
"- ss = s.replace(\"R\", \"B\")",
"-print(ss)",
"+ print(\"ABC\")"
] | false | 0.042886 | 0.043347 | 0.989363 | [
"s002369822",
"s612693214"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.