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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
u981767024 | p02785 | python | s660488725 | s671089222 | 166 | 134 | 26,024 | 31,492 | Accepted | Accepted | 19.28 | # 2020/01/26
# AtCoder Beginner Contest 153 - C
# Input
n, k = list(map(int,input().split()))
h = list(map(int,input().split()))
# Sort Desc.
h.sort()
h.reverse()
if k >= n:
ans = 0
else:
sum = 0
for i in range(k, n):
sum = sum + h[i]
ans = sum
# Output
print(ans)
| # 2020/07/26
# AtCoder Beginner Contest 153 - C
# Input
n, k = list(map(int,input().split()))
h = list(map(int,input().split()))
# 降順にソート
h.sort()
h.reverse()
ans = 0
for i in range(n):
# K回まで必殺技を使う
if i < k:
continue
else:
ans = ans + h[i]
# Output
print(ans)
| 22 | 21 | 313 | 307 | # 2020/01/26
# AtCoder Beginner Contest 153 - C
# Input
n, k = list(map(int, input().split()))
h = list(map(int, input().split()))
# Sort Desc.
h.sort()
h.reverse()
if k >= n:
ans = 0
else:
sum = 0
for i in range(k, n):
sum = sum + h[i]
ans = sum
# Output
print(ans)
| # 2020/07/26
# AtCoder Beginner Contest 153 - C
# Input
n, k = list(map(int, input().split()))
h = list(map(int, input().split()))
# 降順にソート
h.sort()
h.reverse()
ans = 0
for i in range(n):
# K回まで必殺技を使う
if i < k:
continue
else:
ans = ans + h[i]
# Output
print(ans)
| false | 4.545455 | [
"-# 2020/01/26",
"+# 2020/07/26",
"-# Sort Desc.",
"+# 降順にソート",
"-if k >= n:",
"- ans = 0",
"-else:",
"- sum = 0",
"- for i in range(k, n):",
"- sum = sum + h[i]",
"- ans = sum",
"+ans = 0",
"+for i in range(n):",
"+ # K回まで必殺技を使う",
"+ if i < k:",
"+ cont... | false | 0.044663 | 0.043552 | 1.025495 | [
"s660488725",
"s671089222"
] |
u126232616 | p03013 | python | s336902007 | s845500954 | 464 | 194 | 460,056 | 7,064 | Accepted | Accepted | 58.19 | n,m = list(map(int,input().split()))
dp = [0 for i in range(n+1)]
for i in range(m):
j = int(eval(input()))
dp[j] = -1
dp[0] = 1
dp[1] = 1 if dp[1] != -1 else 0
for i in range(2,n+1):
if dp[i] == -1:
dp[i] = 0
continue
dp[i] = dp[i-1] + dp[i-2]
print((dp[n]%1000000007)) | n,m = list(map(int,input().split()))
dp = [0 for i in range(n+1)]
for i in range(m):
j = int(eval(input()))
dp[j] = -1
dp[0] = 1
dp[1] = 1 if dp[1] != -1 else 0
for i in range(2,n+1):
if dp[i] == -1:
dp[i] = 0
continue
dp[i] = (dp[i-1] + dp[i-2])%1000000007
print((dp[n])) | 13 | 13 | 300 | 302 | n, m = list(map(int, input().split()))
dp = [0 for i in range(n + 1)]
for i in range(m):
j = int(eval(input()))
dp[j] = -1
dp[0] = 1
dp[1] = 1 if dp[1] != -1 else 0
for i in range(2, n + 1):
if dp[i] == -1:
dp[i] = 0
continue
dp[i] = dp[i - 1] + dp[i - 2]
print((dp[n] % 1000000007))
| n, m = list(map(int, input().split()))
dp = [0 for i in range(n + 1)]
for i in range(m):
j = int(eval(input()))
dp[j] = -1
dp[0] = 1
dp[1] = 1 if dp[1] != -1 else 0
for i in range(2, n + 1):
if dp[i] == -1:
dp[i] = 0
continue
dp[i] = (dp[i - 1] + dp[i - 2]) % 1000000007
print((dp[n]))
| false | 0 | [
"- dp[i] = dp[i - 1] + dp[i - 2]",
"-print((dp[n] % 1000000007))",
"+ dp[i] = (dp[i - 1] + dp[i - 2]) % 1000000007",
"+print((dp[n]))"
] | false | 0.047058 | 0.036314 | 1.295882 | [
"s336902007",
"s845500954"
] |
u256678932 | p02379 | python | s653819402 | s215075217 | 30 | 20 | 7,476 | 5,660 | Accepted | Accepted | 33.33 | import math
x1, y1, x2, y2 = list(map(float, input().split(' ')))
print(('{:.5f}'.format(math.sqrt((x2-x1)**2+(y2-y1)**2)))) | import math
def main():
x1, y1, x2, y2 = [float(n) for n in input().split()]
d = math.sqrt((x2 - x1)**2 + (y2 - y1)**2)
print(("{:.5f}".format(d)));
if __name__ == '__main__':
main()
| 5 | 11 | 122 | 211 | import math
x1, y1, x2, y2 = list(map(float, input().split(" ")))
print(("{:.5f}".format(math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2))))
| import math
def main():
x1, y1, x2, y2 = [float(n) for n in input().split()]
d = math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)
print(("{:.5f}".format(d)))
if __name__ == "__main__":
main()
| false | 54.545455 | [
"-x1, y1, x2, y2 = list(map(float, input().split(\" \")))",
"-print((\"{:.5f}\".format(math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2))))",
"+",
"+def main():",
"+ x1, y1, x2, y2 = [float(n) for n in input().split()]",
"+ d = math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)",
"+ print((\"{:.5f}\".format(d... | false | 0.034896 | 0.033848 | 1.030962 | [
"s653819402",
"s215075217"
] |
u312025627 | p03574 | python | s591406352 | s536046974 | 33 | 24 | 3,572 | 3,188 | Accepted | Accepted | 27.27 | h, w = (int(i) for i in input().split())
s = [[j for j in input()] for i in range(h)]
for i in range(h):
for j in range(w):
cnt = 0
if s[i][j] == "#":
continue
for k in range(-1,2):
for l in range(-1,2):
if 0 <= i+k <= h-1 and 0 <= j+l <= w-1 ... | def main():
H, W = (int(i) for i in input().split())
A = [eval(input()) for i in range(H)]
dxy = ((-1, 1), (0, 1), (1, 1), (1, 0),
(1, -1), (0, -1), (-1, -1), (-1, 0))
c = [["0"]*W for h in range(H)]
for h in range(H):
for w in range(W):
if A[h][w] == "#":
... | 15 | 24 | 438 | 739 | h, w = (int(i) for i in input().split())
s = [[j for j in input()] for i in range(h)]
for i in range(h):
for j in range(w):
cnt = 0
if s[i][j] == "#":
continue
for k in range(-1, 2):
for l in range(-1, 2):
if (
0 <= i + k <= h - 1
... | def main():
H, W = (int(i) for i in input().split())
A = [eval(input()) for i in range(H)]
dxy = ((-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1), (-1, 0))
c = [["0"] * W for h in range(H)]
for h in range(H):
for w in range(W):
if A[h][w] == "#":
c[h][... | false | 37.5 | [
"-h, w = (int(i) for i in input().split())",
"-s = [[j for j in input()] for i in range(h)]",
"-for i in range(h):",
"- for j in range(w):",
"- cnt = 0",
"- if s[i][j] == \"#\":",
"- continue",
"- for k in range(-1, 2):",
"- for l in range(-1, 2):",
"-... | false | 0.036812 | 0.061424 | 0.599319 | [
"s591406352",
"s536046974"
] |
u800058906 | p02887 | python | s970510338 | s603368624 | 211 | 49 | 9,856 | 9,824 | Accepted | Accepted | 76.78 | n=int(eval(input()))
s=eval(input())
s=list(s)
for i in reversed(list(range(1,n))):
if s[i-1]==s[i]:
s.pop(i)
print((len(s))) | import sys
n=int(eval(input()))
a=eval(input())
a=list(a)
a.reverse()
if n==1:
print('1')
sys.exit()
c=1
for i in range(n-1):
if a[i]!=a[i+1]:
c+=1
if c==0:
c+=1
print(c) | 9 | 21 | 127 | 216 | n = int(eval(input()))
s = eval(input())
s = list(s)
for i in reversed(list(range(1, n))):
if s[i - 1] == s[i]:
s.pop(i)
print((len(s)))
| import sys
n = int(eval(input()))
a = eval(input())
a = list(a)
a.reverse()
if n == 1:
print("1")
sys.exit()
c = 1
for i in range(n - 1):
if a[i] != a[i + 1]:
c += 1
if c == 0:
c += 1
print(c)
| false | 57.142857 | [
"+import sys",
"+",
"-s = eval(input())",
"-s = list(s)",
"-for i in reversed(list(range(1, n))):",
"- if s[i - 1] == s[i]:",
"- s.pop(i)",
"-print((len(s)))",
"+a = eval(input())",
"+a = list(a)",
"+a.reverse()",
"+if n == 1:",
"+ print(\"1\")",
"+ sys.exit()",
"+c = 1",... | false | 0.036622 | 0.035494 | 1.031771 | [
"s970510338",
"s603368624"
] |
u391819434 | p02862 | python | s688970368 | s774808690 | 1,105 | 162 | 127,936 | 35,296 | Accepted | Accepted | 85.34 | X,Y=list(map(int,input().split()))
def cmb(n, r, p):
if (r < 0) or (n < r):
return 0
r = min(r, n - r)
return fact[n] * factinv[r] * factinv[n-r] % p
p = 10 ** 9 + 7
N = 10 ** 6
fact = [1, 1]
factinv = [1, 1]
inv = [0, 1]
for i in range(2, N + 1):
fact.append((fact[-1] * i) % p)... | def com(n,r,m):
f=[1,1]
for i in range(2,n+1):
f.append(f[i-1]*i%m)
return f[n]*pow(f[r]*f[n-r]%m,m-2,m)%m
mod=10**9+7
x,y=list(map(int,input().split()))
z=(x+y)//3
if (x+y)%3 or abs(x-y)>z:
ans=0
else:
ans=com(z,x-z,mod)
print(ans) | 28 | 14 | 557 | 251 | X, Y = list(map(int, input().split()))
def cmb(n, r, p):
if (r < 0) or (n < r):
return 0
r = min(r, n - r)
return fact[n] * factinv[r] * factinv[n - r] % p
p = 10**9 + 7
N = 10**6
fact = [1, 1]
factinv = [1, 1]
inv = [0, 1]
for i in range(2, N + 1):
fact.append((fact[-1] * i) % p)
inv.ap... | def com(n, r, m):
f = [1, 1]
for i in range(2, n + 1):
f.append(f[i - 1] * i % m)
return f[n] * pow(f[r] * f[n - r] % m, m - 2, m) % m
mod = 10**9 + 7
x, y = list(map(int, input().split()))
z = (x + y) // 3
if (x + y) % 3 or abs(x - y) > z:
ans = 0
else:
ans = com(z, x - z, mod)
print(ans)... | false | 50 | [
"-X, Y = list(map(int, input().split()))",
"+def com(n, r, m):",
"+ f = [1, 1]",
"+ for i in range(2, n + 1):",
"+ f.append(f[i - 1] * i % m)",
"+ return f[n] * pow(f[r] * f[n - r] % m, m - 2, m) % m",
"-def cmb(n, r, p):",
"- if (r < 0) or (n < r):",
"- return 0",
"- ... | false | 3.848777 | 0.068581 | 56.12005 | [
"s688970368",
"s774808690"
] |
u418826171 | p03433 | python | s185279841 | s626173094 | 30 | 25 | 9,056 | 9,112 | Accepted | Accepted | 16.67 | N = int(eval(input()))
A = int(eval(input()))
if N%500 <= A:
print('Yes')
else:
print('No') | n = int(eval(input()))
a = int(eval(input()))
if n%500 <= a:
print('Yes')
else:
print('No') | 6 | 6 | 92 | 92 | N = int(eval(input()))
A = int(eval(input()))
if N % 500 <= A:
print("Yes")
else:
print("No")
| n = int(eval(input()))
a = int(eval(input()))
if n % 500 <= a:
print("Yes")
else:
print("No")
| false | 0 | [
"-N = int(eval(input()))",
"-A = int(eval(input()))",
"-if N % 500 <= A:",
"+n = int(eval(input()))",
"+a = int(eval(input()))",
"+if n % 500 <= a:"
] | false | 0.040619 | 0.036173 | 1.122916 | [
"s185279841",
"s626173094"
] |
u341533698 | p02277 | python | s773780136 | s348380566 | 1,850 | 1,200 | 85,452 | 84,984 | Accepted | Accepted | 35.14 | n = int(input())
stable = 1
class Card():
__slots__ = ('suit', 'value')
#mergeSort
A = [Card() for _ in range(n)]
#quickSort
B = [Card() for _ in range(n)]
for i in range(n):
a = input().split()
A[i].suit = a[0]
B[i].suit = a[0]
A[i].value = int(a[1])
B[i].value = int(a[1])
... | n = int(input())
#stable = 1
class Card():
__slots__ = ('suit', 'value')
#mergeSort
A = [Card() for _ in range(n)]
#quickSort
B = [Card() for _ in range(n)]
s = set()
for i in range(n):
a = input().split()
A[i].suit = a[0]
B[i].suit = a[0]
A[i].value = int(a[1])
B[i].value = ... | 87 | 90 | 1,815 | 1,958 | n = int(input())
stable = 1
class Card:
__slots__ = ("suit", "value")
# mergeSort
A = [Card() for _ in range(n)]
# quickSort
B = [Card() for _ in range(n)]
for i in range(n):
a = input().split()
A[i].suit = a[0]
B[i].suit = a[0]
A[i].value = int(a[1])
B[i].value = int(a[1])
def merge(A, le... | n = int(input())
# stable = 1
class Card:
__slots__ = ("suit", "value")
# mergeSort
A = [Card() for _ in range(n)]
# quickSort
B = [Card() for _ in range(n)]
s = set()
for i in range(n):
a = input().split()
A[i].suit = a[0]
B[i].suit = a[0]
A[i].value = int(a[1])
B[i].value = int(a[1])
s.a... | false | 3.333333 | [
"-stable = 1",
"-",
"-",
"+# stable = 1",
"+s = set()",
"-",
"-",
"+ s.add(int(a[1]))",
"+\"\"\"",
"- L = [0] * (n1 + 1)",
"- R = [0] * (n2 + 1)",
"+ L = [0] * (n1+1)",
"+ R = [0] * (n2+1)",
"- # for i in xrange(n1):",
"+ #for i in xrange(n1):",
"- # for i in xr... | false | 0.12598 | 0.051476 | 2.447365 | [
"s773780136",
"s348380566"
] |
u141610915 | p02734 | python | s675057165 | s876211717 | 697 | 371 | 113,372 | 42,092 | Accepted | Accepted | 46.77 | import sys
input = sys.stdin.readline
N, S = list(map(int, input().split()))
a = list(map(int, input().split()))
mod = 998244353
dp = [[0] * (S + 1) for _ in range(N + 1)]
dp[0][0] = 1
for i in range(N):
dp[i][0] = i + 1
for j in range(S + 1):
if j + a[i] < S:
dp[i + 1][j + a[i]] += dp[i][j]
... | import sys
input = sys.stdin.readline
N, S = list(map(int, input().split()))
a = list(map(int, input().split()))
mod = 998244353
dp = [0] * (S + 1)
for l in range(N):
r = N - l
x = a[l]
if x > S: continue
for i in range(S, 0, -1):
if i + x > S: continue
if i + x == S:
dp[S] += dp[i] *... | 20 | 26 | 530 | 531 | import sys
input = sys.stdin.readline
N, S = list(map(int, input().split()))
a = list(map(int, input().split()))
mod = 998244353
dp = [[0] * (S + 1) for _ in range(N + 1)]
dp[0][0] = 1
for i in range(N):
dp[i][0] = i + 1
for j in range(S + 1):
if j + a[i] < S:
dp[i + 1][j + a[i]] += dp[i][j... | import sys
input = sys.stdin.readline
N, S = list(map(int, input().split()))
a = list(map(int, input().split()))
mod = 998244353
dp = [0] * (S + 1)
for l in range(N):
r = N - l
x = a[l]
if x > S:
continue
for i in range(S, 0, -1):
if i + x > S:
continue
if i + x == S... | false | 23.076923 | [
"-dp = [[0] * (S + 1) for _ in range(N + 1)]",
"-dp[0][0] = 1",
"-for i in range(N):",
"- dp[i][0] = i + 1",
"- for j in range(S + 1):",
"- if j + a[i] < S:",
"- dp[i + 1][j + a[i]] += dp[i][j]",
"- dp[i + 1][j + a[i]] %= mod",
"- elif j + a[i] == S:",
"- ... | false | 0.039483 | 0.046728 | 0.844949 | [
"s675057165",
"s876211717"
] |
u996672406 | p03069 | python | s470750459 | s684501967 | 128 | 114 | 4,840 | 4,840 | Accepted | Accepted | 10.94 | n = int(eval(input()))
s = list(eval(input()))
rd = 0
for e in s:
if e == ".":
rd += 1
ls = 0
res = rd
for e in s:
if e == ".":
rd -= 1
else:
ls += 1
res = min(res, rd + ls)
print(res)
| n = int(eval(input()))
s = list(eval(input()))
rd = 0
for e in s:
if e == ".":
rd += 1
res = rd
for e in s:
if e == ".":
rd -= 1
else:
rd += 1
res = min(res, rd)
print(res)
| 18 | 17 | 233 | 220 | n = int(eval(input()))
s = list(eval(input()))
rd = 0
for e in s:
if e == ".":
rd += 1
ls = 0
res = rd
for e in s:
if e == ".":
rd -= 1
else:
ls += 1
res = min(res, rd + ls)
print(res)
| n = int(eval(input()))
s = list(eval(input()))
rd = 0
for e in s:
if e == ".":
rd += 1
res = rd
for e in s:
if e == ".":
rd -= 1
else:
rd += 1
res = min(res, rd)
print(res)
| false | 5.555556 | [
"-ls = 0",
"- ls += 1",
"- res = min(res, rd + ls)",
"+ rd += 1",
"+ res = min(res, rd)"
] | false | 0.044372 | 0.114469 | 0.387631 | [
"s470750459",
"s684501967"
] |
u141610915 | p03329 | python | s271114877 | s834816641 | 1,405 | 296 | 3,828 | 48,976 | Accepted | Accepted | 78.93 | N = int(eval(input()))
inf = 10 ** 6
dp = [inf] * (N + 1)
dp[0] = 0
for i in range(N):
if i + 1 <= N:
dp[i + 1] = min(dp[i] + 1, dp[i + 1])
for j in range(1, 8):
if i + 6 ** j <= N:
dp[i + 6 ** j] = min(dp[i] + 1, dp[i + 6 ** j])
for j in range(1, 7):
if i + 9 ** j <= N:
dp[i +... | import sys
input = sys.stdin.readline
N = int(eval(input()))
dp = [float("inf")] * (N + 1)
dp[0] = 0
for i in range(N):
dp[i + 1] = min(dp[i + 1], dp[i] + 1)
for j in range(1, 8):
if i + pow(6, j) <= N: dp[i + pow(6, j)] = min(dp[i + pow(6, j)], dp[i] + 1)
if i + pow(9, j) <= N: dp[i + pow(9, j)] =... | 14 | 11 | 369 | 363 | N = int(eval(input()))
inf = 10**6
dp = [inf] * (N + 1)
dp[0] = 0
for i in range(N):
if i + 1 <= N:
dp[i + 1] = min(dp[i] + 1, dp[i + 1])
for j in range(1, 8):
if i + 6**j <= N:
dp[i + 6**j] = min(dp[i] + 1, dp[i + 6**j])
for j in range(1, 7):
if i + 9**j <= N:
... | import sys
input = sys.stdin.readline
N = int(eval(input()))
dp = [float("inf")] * (N + 1)
dp[0] = 0
for i in range(N):
dp[i + 1] = min(dp[i + 1], dp[i] + 1)
for j in range(1, 8):
if i + pow(6, j) <= N:
dp[i + pow(6, j)] = min(dp[i + pow(6, j)], dp[i] + 1)
if i + pow(9, j) <= N:
... | false | 21.428571 | [
"+import sys",
"+",
"+input = sys.stdin.readline",
"-inf = 10**6",
"-dp = [inf] * (N + 1)",
"+dp = [float(\"inf\")] * (N + 1)",
"- if i + 1 <= N:",
"- dp[i + 1] = min(dp[i] + 1, dp[i + 1])",
"+ dp[i + 1] = min(dp[i + 1], dp[i] + 1)",
"- if i + 6**j <= N:",
"- dp[i ... | false | 0.572688 | 0.296151 | 1.933774 | [
"s271114877",
"s834816641"
] |
u569742427 | p03221 | python | s474152454 | s999905465 | 1,685 | 738 | 20,316 | 24,492 | Accepted | Accepted | 56.2 | import numpy as np
N, M = list(map(int, input().split()))
data = np.zeros((4, M))
for i in range(M):
data[0, i] = i+1
data[1:3, i] = list(map(int, input().split()))
city = [0 for i in range(N)]
data = data[:, np.argsort(data[2, :])]
for i in range(M):
city[int(data[1, i]-1)] += 1
data[3,... | N,M=list(map(int,input().split()))
city=[]
for i in range(M):
p,y=list(map(int,input().split()))
city.append([i,p,y])
city.sort(key = lambda t:t[2])
city.sort(key = lambda t:t[1])
id=1
old_city=0
for city_id in city:
if city_id[1]!=old_city:
id=1
city_id[2]=id
id+=1
old... | 18 | 23 | 495 | 439 | import numpy as np
N, M = list(map(int, input().split()))
data = np.zeros((4, M))
for i in range(M):
data[0, i] = i + 1
data[1:3, i] = list(map(int, input().split()))
city = [0 for i in range(N)]
data = data[:, np.argsort(data[2, :])]
for i in range(M):
city[int(data[1, i] - 1)] += 1
data[3, i] = city[... | N, M = list(map(int, input().split()))
city = []
for i in range(M):
p, y = list(map(int, input().split()))
city.append([i, p, y])
city.sort(key=lambda t: t[2])
city.sort(key=lambda t: t[1])
id = 1
old_city = 0
for city_id in city:
if city_id[1] != old_city:
id = 1
city_id[2] = id
id += 1
... | false | 21.73913 | [
"-import numpy as np",
"-",
"-data = np.zeros((4, M))",
"+city = []",
"- data[0, i] = i + 1",
"- data[1:3, i] = list(map(int, input().split()))",
"-city = [0 for i in range(N)]",
"-data = data[:, np.argsort(data[2, :])]",
"-for i in range(M):",
"- city[int(data[1, i] - 1)] += 1",
"- ... | false | 0.472493 | 0.079224 | 5.964048 | [
"s474152454",
"s999905465"
] |
u004423772 | p03775 | python | s685879709 | s242294454 | 31 | 27 | 3,064 | 3,064 | Accepted | Accepted | 12.9 | def make_divisors(n):
divisors = []
for i in range(1, int(n**0.5)+1):
if n % i == 0:
divisors.append(i)
divisors.append(n//i)
return divisors
N = int(eval(input()))
divisors = make_divisors(N)
ans = 12
for i in range(0, len(divisors), 2):
a, b = divisors[i], ... | import sys
input = sys.stdin.readline
import math
def make_divisors(n):
divisors = []
for i in range(1, int(n**0.5)+1):
if n % i == 0:
divisors.append(i)
divisors.append(n//i)
return divisors
N = int(eval(input()))
divisors = make_divisors(N)
ans = 11
for i i... | 24 | 20 | 569 | 472 | def make_divisors(n):
divisors = []
for i in range(1, int(n**0.5) + 1):
if n % i == 0:
divisors.append(i)
divisors.append(n // i)
return divisors
N = int(eval(input()))
divisors = make_divisors(N)
ans = 12
for i in range(0, len(divisors), 2):
a, b = divisors[i], divisor... | import sys
input = sys.stdin.readline
import math
def make_divisors(n):
divisors = []
for i in range(1, int(n**0.5) + 1):
if n % i == 0:
divisors.append(i)
divisors.append(n // i)
return divisors
N = int(eval(input()))
divisors = make_divisors(N)
ans = 11
for i in range(... | false | 16.666667 | [
"+import sys",
"+",
"+input = sys.stdin.readline",
"+import math",
"+",
"+",
"-ans = 12",
"+ans = 11",
"- a, b = divisors[i], divisors[i + 1]",
"- m, n = 0, 0",
"- for x in range(1, 12):",
"- if a < 10**x:",
"- m = x",
"- break",
"- for x in range... | false | 0.049261 | 0.141675 | 0.347706 | [
"s685879709",
"s242294454"
] |
u141574039 | p03160 | python | s099301131 | s658571883 | 158 | 129 | 13,928 | 13,980 | Accepted | Accepted | 18.35 | N=int(eval(input()))
H=list(map(int,input().split()))
cost=0
t1,t2=0,0
A=[0]*(N)
i=1
while i<N:
if i==1:
A[i]=abs(H[i]-H[i-1])
#print(i,A[i])
elif i==2:
t1=abs(H[i]-H[i-2])
t2=abs(H[i]-H[i-1])+abs(H[i-2]-H[i-1])
A[i]=min(t1,t2)
#print(i,A[i],t1,t2)
else:
t1=abs(H[i]-H[i... | N=int(eval(input()))
H=list(map(int,input().split()))
DP=[0]*N
DP[0]=0
DP[1]=abs(H[1]-H[0])
for i in range(2,N):
DP[i]=min((abs(H[i]-H[i-1])+DP[i-1]),(abs(H[i]-H[i-2])+DP[i-2]))
print((DP[N-1])) | 23 | 8 | 439 | 195 | N = int(eval(input()))
H = list(map(int, input().split()))
cost = 0
t1, t2 = 0, 0
A = [0] * (N)
i = 1
while i < N:
if i == 1:
A[i] = abs(H[i] - H[i - 1])
# print(i,A[i])
elif i == 2:
t1 = abs(H[i] - H[i - 2])
t2 = abs(H[i] - H[i - 1]) + abs(H[i - 2] - H[i - 1])
A[i] = min... | N = int(eval(input()))
H = list(map(int, input().split()))
DP = [0] * N
DP[0] = 0
DP[1] = abs(H[1] - H[0])
for i in range(2, N):
DP[i] = min((abs(H[i] - H[i - 1]) + DP[i - 1]), (abs(H[i] - H[i - 2]) + DP[i - 2]))
print((DP[N - 1]))
| false | 65.217391 | [
"-cost = 0",
"-t1, t2 = 0, 0",
"-A = [0] * (N)",
"-i = 1",
"-while i < N:",
"- if i == 1:",
"- A[i] = abs(H[i] - H[i - 1])",
"- # print(i,A[i])",
"- elif i == 2:",
"- t1 = abs(H[i] - H[i - 2])",
"- t2 = abs(H[i] - H[i - 1]) + abs(H[i - 2] - H[i - 1])",
"- ... | false | 0.072728 | 0.072225 | 1.006971 | [
"s099301131",
"s658571883"
] |
u282228874 | p03371 | python | s658242383 | s298505263 | 19 | 17 | 3,060 | 3,060 | Accepted | Accepted | 10.53 | a,b,c,x,y = list(map(int,input().split()))
res = 0
res += min(a+b,2*c)*min(x,y)
if x >= y:
res += min(2*c*(x-y),a*(x-y))
else:
res += min(2*c*(y-x),b*(y-x))
print(res) | A,B,C,X,Y = list(map(int,input().split()))
res = min(A+B,2*C)*min(X,Y)
if X >= Y:
res += min(A,2*C)*(X-Y)
else:
res += min(B,2*C)*(Y-X)
print(res) | 10 | 7 | 180 | 154 | a, b, c, x, y = list(map(int, input().split()))
res = 0
res += min(a + b, 2 * c) * min(x, y)
if x >= y:
res += min(2 * c * (x - y), a * (x - y))
else:
res += min(2 * c * (y - x), b * (y - x))
print(res)
| A, B, C, X, Y = list(map(int, input().split()))
res = min(A + B, 2 * C) * min(X, Y)
if X >= Y:
res += min(A, 2 * C) * (X - Y)
else:
res += min(B, 2 * C) * (Y - X)
print(res)
| false | 30 | [
"-a, b, c, x, y = list(map(int, input().split()))",
"-res = 0",
"-res += min(a + b, 2 * c) * min(x, y)",
"-if x >= y:",
"- res += min(2 * c * (x - y), a * (x - y))",
"+A, B, C, X, Y = list(map(int, input().split()))",
"+res = min(A + B, 2 * C) * min(X, Y)",
"+if X >= Y:",
"+ res += min(A, 2 * ... | false | 0.110529 | 0.113046 | 0.977733 | [
"s658242383",
"s298505263"
] |
u173374079 | p03126 | python | s247497089 | s108463176 | 21 | 18 | 3,316 | 3,060 | Accepted | Accepted | 14.29 | #!/usr/bin/python
# coding: UTF-8
n,m = list(map(int,input().split()))
res = [0 for _ in range(m)]
for i in range(n):
for j in list(map(int,input().split()))[1:]:
res[j-1] += 1
print((res.count(n))) | #!/usr/bin/python
# coding: UTF-8
n,m = list(map(int,input().split()))
res = [0 for _ in range(m)]
for i in range(n):
for j in list(map(int,input().split()))[1:]:
res[j-1] += 1
print((sum([res[i]==n for i in range(m)]))) | 11 | 11 | 209 | 231 | #!/usr/bin/python
# coding: UTF-8
n, m = list(map(int, input().split()))
res = [0 for _ in range(m)]
for i in range(n):
for j in list(map(int, input().split()))[1:]:
res[j - 1] += 1
print((res.count(n)))
| #!/usr/bin/python
# coding: UTF-8
n, m = list(map(int, input().split()))
res = [0 for _ in range(m)]
for i in range(n):
for j in list(map(int, input().split()))[1:]:
res[j - 1] += 1
print((sum([res[i] == n for i in range(m)])))
| false | 0 | [
"-print((res.count(n)))",
"+print((sum([res[i] == n for i in range(m)])))"
] | false | 0.044894 | 0.047836 | 0.938511 | [
"s247497089",
"s108463176"
] |
u039065404 | p02694 | python | s769823249 | s377358199 | 31 | 23 | 10,040 | 9,160 | Accepted | Accepted | 25.81 | import decimal
X = int(eval(input()))
i = 0
K = 100
while K < X:
i = i + 1
K_ = decimal.Decimal(str(K*1.01))
K = int(K_.quantize(decimal.Decimal('0'), rounding=decimal.ROUND_FLOOR))
print(i) | X = int(eval(input()))
i = 0
K = 100
while K < X:
i = i + 1
K = int(K*1.01)
print(i) | 11 | 9 | 204 | 95 | import decimal
X = int(eval(input()))
i = 0
K = 100
while K < X:
i = i + 1
K_ = decimal.Decimal(str(K * 1.01))
K = int(K_.quantize(decimal.Decimal("0"), rounding=decimal.ROUND_FLOOR))
print(i)
| X = int(eval(input()))
i = 0
K = 100
while K < X:
i = i + 1
K = int(K * 1.01)
print(i)
| false | 18.181818 | [
"-import decimal",
"-",
"- K_ = decimal.Decimal(str(K * 1.01))",
"- K = int(K_.quantize(decimal.Decimal(\"0\"), rounding=decimal.ROUND_FLOOR))",
"+ K = int(K * 1.01)"
] | false | 0.149233 | 0.076442 | 1.952238 | [
"s769823249",
"s377358199"
] |
u352394527 | p00099 | python | s928585670 | s585740380 | 2,270 | 1,820 | 158,064 | 158,060 | Accepted | Accepted | 19.82 | """
セグメント木
"""
INF = 10 ** 20
def main():
n, q = list(map(int, input().split()))
size = 1
while size < n:
size *= 2
size = size * 2 - 1
seg_tree = [(INF, 0) for _ in range(size)]
def update(a, v):
ind = (size - 1) // 2 + a
prea, prev = seg_tree[ind]
seg_tree[ind... | """
セグメント木
"""
INF = 10 ** 20
def main():
n, q = list(map(int, input().split()))
size = 1
while size < n:
size *= 2
size = size * 2 - 1
seg_tree = [(INF, 0) for _ in range(size)]
def update(a, v):
ind = (size - 1) // 2 + a
prea, prev = seg_tree[ind]
seg_tree[ind... | 37 | 40 | 722 | 818 | """
セグメント木
"""
INF = 10**20
def main():
n, q = list(map(int, input().split()))
size = 1
while size < n:
size *= 2
size = size * 2 - 1
seg_tree = [(INF, 0) for _ in range(size)]
def update(a, v):
ind = (size - 1) // 2 + a
prea, prev = seg_tree[ind]
seg_tree[ind]... | """
セグメント木
"""
INF = 10**20
def main():
n, q = list(map(int, input().split()))
size = 1
while size < n:
size *= 2
size = size * 2 - 1
seg_tree = [(INF, 0) for _ in range(size)]
def update(a, v):
ind = (size - 1) // 2 + a
prea, prev = seg_tree[ind]
seg_tree[ind]... | false | 7.5 | [
"+ if seg_tree[ind] == (ca1, cv1):",
"+ break",
"+ if seg_tree[ind] == (ca2, cv2):",
"+ break"
] | false | 0.050457 | 0.051168 | 0.986098 | [
"s928585670",
"s585740380"
] |
u715107458 | p03162 | python | s573060652 | s074592109 | 442 | 274 | 3,064 | 3,064 | Accepted | Accepted | 38.01 | days = int(eval(input()))
prev = [0, 0, 0]
while days:
nxt = [0, 0, 0]
a, b, c = list(map(int, input().split()))
nxt[0] = a + max(prev[1], prev[2])
nxt[1] = b + max(prev[0], prev[2])
nxt[2] = c + max(prev[0], prev[1])
prev = nxt
days -= 1
print((max(prev))) | import sys
# read = sys.stdin.read
input = sys.stdin.readline
# readlines = sys.stdin.readlines
days = int(eval(input()))
prev = [0, 0, 0]
while days:
nxt = [0, 0, 0]
a, b, c = list(map(int, input().split()))
nxt[0] = a + max(prev[1], prev[2])
nxt[1] = b + max(prev[0], prev[2])
nxt[2] =... | 13 | 17 | 285 | 385 | days = int(eval(input()))
prev = [0, 0, 0]
while days:
nxt = [0, 0, 0]
a, b, c = list(map(int, input().split()))
nxt[0] = a + max(prev[1], prev[2])
nxt[1] = b + max(prev[0], prev[2])
nxt[2] = c + max(prev[0], prev[1])
prev = nxt
days -= 1
print((max(prev)))
| import sys
# read = sys.stdin.read
input = sys.stdin.readline
# readlines = sys.stdin.readlines
days = int(eval(input()))
prev = [0, 0, 0]
while days:
nxt = [0, 0, 0]
a, b, c = list(map(int, input().split()))
nxt[0] = a + max(prev[1], prev[2])
nxt[1] = b + max(prev[0], prev[2])
nxt[2] = c + max(pre... | false | 23.529412 | [
"+import sys",
"+",
"+# read = sys.stdin.read",
"+input = sys.stdin.readline",
"+# readlines = sys.stdin.readlines"
] | false | 0.061725 | 0.062451 | 0.988364 | [
"s573060652",
"s074592109"
] |
u531436689 | p02900 | python | s624719685 | s784524491 | 470 | 144 | 13,508 | 83,668 | Accepted | Accepted | 69.36 | import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque
sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7
DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): r... | import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque
sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7
DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): r... | 55 | 50 | 1,463 | 1,285 | import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools
from collections import deque
sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7
DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]
def LI():
return [int(x) for x in sys.stdin.readline().split()]
def ... | import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools
from collections import deque
sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7
DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]
def LI():
return [int(x) for x in sys.stdin.readline().split()]
def ... | false | 9.090909 | [
"-prime = [True] * (10**6 + 2)",
"-prime[1] = False",
"-max_range = int(math.sqrt(10**6)) + 1",
"-for i in range(2, 10**6 + 1):",
"- if not prime[i]:",
"- continue",
"- if prime[i]:",
"- num = i + i",
"- while num < max_range:",
"- prime[num] = False",
"- ... | false | 0.623461 | 0.037494 | 16.628262 | [
"s624719685",
"s784524491"
] |
u488127128 | p03543 | python | s827216231 | s012692645 | 25 | 17 | 2,940 | 2,940 | Accepted | Accepted | 32 | a,b,c,d = eval(input())
if a==b and b==c:
print('Yes')
elif b==c and c==d:
print('Yes')
else:
print('No') | a,b,c,d = eval(input())
print(('Yes' if a==b==c or b==c==d else 'No')) | 7 | 2 | 117 | 63 | a, b, c, d = eval(input())
if a == b and b == c:
print("Yes")
elif b == c and c == d:
print("Yes")
else:
print("No")
| a, b, c, d = eval(input())
print(("Yes" if a == b == c or b == c == d else "No"))
| false | 71.428571 | [
"-if a == b and b == c:",
"- print(\"Yes\")",
"-elif b == c and c == d:",
"- print(\"Yes\")",
"-else:",
"- print(\"No\")",
"+print((\"Yes\" if a == b == c or b == c == d else \"No\"))"
] | false | 0.181462 | 0.037574 | 4.829435 | [
"s827216231",
"s012692645"
] |
u872271866 | p02684 | python | s926779444 | s280437703 | 216 | 141 | 37,304 | 33,820 | Accepted | Accepted | 34.72 | from collections import defaultdict
def main():
n, k = list(map(int, input().split(" ")))
a = list([int(i)-1 for i in input().split(" ")])
s = [0]
d = defaultdict(lambda:0)
x = a[0]
for i in range(n):
s.append(x)
x = a[x]
bb=None
for i in range(n):
d... | from collections import defaultdict
def main():
n, k = list(map(int, input().split(" ")))
a = list(map(int, input().split(" ")))
s = []
ord = [-1]*(n+1)
u = 1
while ord[u] == -1:
ord[u] = len(s)
s.append(u)
u = a[u-1]
l = len(s) - ord[u]
if k < ord[u]:... | 32 | 49 | 666 | 1,026 | from collections import defaultdict
def main():
n, k = list(map(int, input().split(" ")))
a = list([int(i) - 1 for i in input().split(" ")])
s = [0]
d = defaultdict(lambda: 0)
x = a[0]
for i in range(n):
s.append(x)
x = a[x]
bb = None
for i in range(n):
d[s[i]] ... | from collections import defaultdict
def main():
n, k = list(map(int, input().split(" ")))
a = list(map(int, input().split(" ")))
s = []
ord = [-1] * (n + 1)
u = 1
while ord[u] == -1:
ord[u] = len(s)
s.append(u)
u = a[u - 1]
l = len(s) - ord[u]
if k < ord[u]:
... | false | 34.693878 | [
"- a = list([int(i) - 1 for i in input().split(\" \")])",
"+ a = list(map(int, input().split(\" \")))",
"+ s = []",
"+ ord = [-1] * (n + 1)",
"+ u = 1",
"+ while ord[u] == -1:",
"+ ord[u] = len(s)",
"+ s.append(u)",
"+ u = a[u - 1]",
"+ l = len(s) - ord[u]... | false | 0.046166 | 0.045917 | 1.005431 | [
"s926779444",
"s280437703"
] |
u699089116 | p03644 | python | s373937246 | s873066627 | 180 | 27 | 38,384 | 9,076 | Accepted | Accepted | 85 | n = int(eval(input()))
mx = [0, 0]
for i in range(1, n+1):
j = i
cnt = 0
while j % 2 == 0:
cnt += 1
j = j // 2
if mx[0] < cnt:
mx[0] = cnt
mx[1] = i
print((mx[1] if mx[0] != 0 else 1)) | N = int(eval(input()))
L = [0] * 101
for i in range(1, 101):
cnt = 0
tmp = i
while tmp % 2 == 0:
cnt += 1
tmp //= 2
L[i] = cnt
print((L.index(max(L[1:N+1])) if N !=1 else 1)) | 14 | 12 | 239 | 211 | n = int(eval(input()))
mx = [0, 0]
for i in range(1, n + 1):
j = i
cnt = 0
while j % 2 == 0:
cnt += 1
j = j // 2
if mx[0] < cnt:
mx[0] = cnt
mx[1] = i
print((mx[1] if mx[0] != 0 else 1))
| N = int(eval(input()))
L = [0] * 101
for i in range(1, 101):
cnt = 0
tmp = i
while tmp % 2 == 0:
cnt += 1
tmp //= 2
L[i] = cnt
print((L.index(max(L[1 : N + 1])) if N != 1 else 1))
| false | 14.285714 | [
"-n = int(eval(input()))",
"-mx = [0, 0]",
"-for i in range(1, n + 1):",
"- j = i",
"+N = int(eval(input()))",
"+L = [0] * 101",
"+for i in range(1, 101):",
"- while j % 2 == 0:",
"+ tmp = i",
"+ while tmp % 2 == 0:",
"- j = j // 2",
"- if mx[0] < cnt:",
"- mx[0]... | false | 0.051477 | 0.053606 | 0.960277 | [
"s373937246",
"s873066627"
] |
u989345508 | p03106 | python | s457296824 | s223110110 | 19 | 17 | 3,060 | 2,940 | Accepted | Accepted | 10.53 | a,b,k=input().split()
a,b,k=int(a),int(b),int(k)
c=0
for i in range(min(a,b)):
if a%(min(a,b)-i)==0 and b%(min(a,b)-i)==0:
#print(i+1)
c+=1
if c==k:
print((min(a,b)-i))
break
| a,b,k=list(map(int,input().split()))
check=0
m=min(a,b)
for i in range(m,0,-1):
if a%i==0 and b%i==0:
check+=1
if check==k:
print(i)
break
| 10 | 9 | 222 | 185 | a, b, k = input().split()
a, b, k = int(a), int(b), int(k)
c = 0
for i in range(min(a, b)):
if a % (min(a, b) - i) == 0 and b % (min(a, b) - i) == 0:
# print(i+1)
c += 1
if c == k:
print((min(a, b) - i))
break
| a, b, k = list(map(int, input().split()))
check = 0
m = min(a, b)
for i in range(m, 0, -1):
if a % i == 0 and b % i == 0:
check += 1
if check == k:
print(i)
break
| false | 10 | [
"-a, b, k = input().split()",
"-a, b, k = int(a), int(b), int(k)",
"-c = 0",
"-for i in range(min(a, b)):",
"- if a % (min(a, b) - i) == 0 and b % (min(a, b) - i) == 0:",
"- # print(i+1)",
"- c += 1",
"- if c == k:",
"- print((min(a, b) - i))",
"- break",
"+a, b... | false | 0.050392 | 0.068651 | 0.734034 | [
"s457296824",
"s223110110"
] |
u062147869 | p03363 | python | s154281178 | s777265427 | 306 | 147 | 113,104 | 39,416 | Accepted | Accepted | 51.96 | from collections import Counter
from itertools import accumulate
eval(input());print((sum( (s*(s-1))//2 for s in list(Counter((i for i in accumulate([0]+[int(i) for i in input().split()]))).values()))))
| import collections,itertools;eval(input());print((sum( (s*(s-1))//2 for s in list(collections.Counter((i for i in itertools.accumulate([0]+[int(i) for i in input().split()]))).values())))) | 3 | 1 | 193 | 176 | from collections import Counter
from itertools import accumulate
eval(input())
print(
(
sum(
(s * (s - 1)) // 2
for s in list(
Counter(
(i for i in accumulate([0] + [int(i) for i in input().split()]))
).values()
)
... | import collections, itertools
eval(input())
print(
(
sum(
(s * (s - 1)) // 2
for s in list(
collections.Counter(
(
i
for i in itertools.accumulate(
[0] + [int(i) for i in ... | false | 66.666667 | [
"-from collections import Counter",
"-from itertools import accumulate",
"+import collections, itertools",
"- Counter(",
"- (i for i in accumulate([0] + [int(i) for i in input().split()]))",
"+ collections.Counter(",
"+ (",
"+ ... | false | 0.042507 | 0.039543 | 1.074958 | [
"s154281178",
"s777265427"
] |
u884982181 | p03013 | python | s589143302 | s997157938 | 244 | 73 | 50,140 | 13,552 | Accepted | Accepted | 70.08 | import sys
from collections import deque
from collections import defaultdict
import math
sys.setrecursionlimit(20000000)
input = sys.stdin.readline
n,m = list(map(int,input().split()))
a = [int(eval(input())) for i in range(m)]
a = set(a)
mod = 10**9+7
dp = [0]*(n+5)
dp[0] = 1
for i in range(1,n+1):
... | import sys
from collections import deque
from collections import defaultdict
import math
sys.setrecursionlimit(20000000)
input = sys.stdin.readline
n,m = list(map(int,input().split()))
a = [int(eval(input())) for i in range(m)]
a = set(a)
mod = 10**9+7
dp = [0]*(n+1)
dp[0] = 1
for i in range(1,n+1):
... | 21 | 21 | 494 | 494 | import sys
from collections import deque
from collections import defaultdict
import math
sys.setrecursionlimit(20000000)
input = sys.stdin.readline
n, m = list(map(int, input().split()))
a = [int(eval(input())) for i in range(m)]
a = set(a)
mod = 10**9 + 7
dp = [0] * (n + 5)
dp[0] = 1
for i in range(1, n + 1):
if ... | import sys
from collections import deque
from collections import defaultdict
import math
sys.setrecursionlimit(20000000)
input = sys.stdin.readline
n, m = list(map(int, input().split()))
a = [int(eval(input())) for i in range(m)]
a = set(a)
mod = 10**9 + 7
dp = [0] * (n + 1)
dp[0] = 1
for i in range(1, n + 1):
if ... | false | 0 | [
"-dp = [0] * (n + 5)",
"+dp = [0] * (n + 1)"
] | false | 0.038621 | 0.038005 | 1.016214 | [
"s589143302",
"s997157938"
] |
u131984977 | p02390 | python | s615717768 | s780430378 | 30 | 20 | 6,736 | 7,640 | Accepted | Accepted | 33.33 | S = int(input())
h = int(S / 3600)
m = int(S % 3600 / 60)
s = S % 60
print(h, m, s, sep=':')
| S = int(eval(input()))
s = S % 60
m = S // 60 % 60
h = S // 60 // 60
print(("{0}:{1}:{2}".format(h,m,s))) | 5 | 7 | 96 | 105 | S = int(input())
h = int(S / 3600)
m = int(S % 3600 / 60)
s = S % 60
print(h, m, s, sep=":")
| S = int(eval(input()))
s = S % 60
m = S // 60 % 60
h = S // 60 // 60
print(("{0}:{1}:{2}".format(h, m, s)))
| false | 28.571429 | [
"-S = int(input())",
"-h = int(S / 3600)",
"-m = int(S % 3600 / 60)",
"+S = int(eval(input()))",
"-print(h, m, s, sep=\":\")",
"+m = S // 60 % 60",
"+h = S // 60 // 60",
"+print((\"{0}:{1}:{2}\".format(h, m, s)))"
] | false | 0.038128 | 0.036991 | 1.030737 | [
"s615717768",
"s780430378"
] |
u628597699 | p02552 | python | s674071975 | s024654893 | 27 | 24 | 9,060 | 8,804 | Accepted | Accepted | 11.11 | a = int(eval(input()))
print((int(not a))) | print((int(not int(eval(input()))))) | 2 | 1 | 35 | 28 | a = int(eval(input()))
print((int(not a)))
| print((int(not int(eval(input())))))
| false | 50 | [
"-a = int(eval(input()))",
"-print((int(not a)))",
"+print((int(not int(eval(input())))))"
] | false | 0.116019 | 0.061668 | 1.881341 | [
"s674071975",
"s024654893"
] |
u585482323 | p02814 | python | s980366376 | s018848135 | 357 | 285 | 118,636 | 63,332 | Accepted | Accepted | 20.17 | #!usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from itertools import permutations
import sys
import math
import bisect
import random
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [l... | #!usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from itertools import permutations
import sys
import math
import bisect
import random
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [l... | 73 | 50 | 1,606 | 1,168 | #!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations
import sys
import math
import bisect
import random
def LI():
return [int(x) for x in sys.stdin.readline().split()]
def I():
return int(sys.stdin.readline())
def LS():
... | #!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations
import sys
import math
import bisect
import random
def LI():
return [int(x) for x in sys.stdin.readline().split()]
def I():
return int(sys.stdin.readline())
def LS():
... | false | 31.506849 | [
"- b = [i >> 1 for i in a]",
"- c = [i & 1 for i in b]",
"- c.sort()",
"- while 1:",
"- if c[0] == 1:",
"- break",
"- if c[0] == 0 and c[-1] == 1:",
"- print((0))",
"- return",
"- b = [i >> 1 for i in b]",
"- c = [i & 1 for... | false | 0.048729 | 0.047452 | 1.026912 | [
"s980366376",
"s018848135"
] |
u560867850 | p03038 | python | s697149628 | s004145290 | 510 | 363 | 25,720 | 25,372 | Accepted | Accepted | 28.82 | import heapq
def readlines(n):
for _ in range(n):
b, c = list(map(int, input().split()))
yield b, c
def main():
_, M = list(map(int, input().split()))
A = list(map(int, input().split()))
total = sum(A)
heapq.heapify(A)
for b, c in sorted(readlines(M), key=lambda x... | import heapq
import sys
input = sys.stdin.readline
def readlines(n):
for _ in range(n):
b, c = list(map(int, input().split()))
yield b, c
def main():
_, M = list(map(int, input().split()))
A = list(map(int, input().split()))
total = sum(A)
heapq.heapify(A)
for b... | 24 | 26 | 525 | 565 | import heapq
def readlines(n):
for _ in range(n):
b, c = list(map(int, input().split()))
yield b, c
def main():
_, M = list(map(int, input().split()))
A = list(map(int, input().split()))
total = sum(A)
heapq.heapify(A)
for b, c in sorted(readlines(M), key=lambda x: -x[1]):
... | import heapq
import sys
input = sys.stdin.readline
def readlines(n):
for _ in range(n):
b, c = list(map(int, input().split()))
yield b, c
def main():
_, M = list(map(int, input().split()))
A = list(map(int, input().split()))
total = sum(A)
heapq.heapify(A)
for b, c in sorted... | false | 7.692308 | [
"+import sys",
"+",
"+input = sys.stdin.readline"
] | false | 0.033655 | 0.040661 | 0.827693 | [
"s697149628",
"s004145290"
] |
u772029934 | p02781 | python | s033486058 | s753953209 | 710 | 179 | 63,192 | 38,384 | Accepted | Accepted | 74.79 | import functools
N = int(eval(input()))
K = int(eval(input()))
@functools.lru_cache()
def func(num,counter):
remain = num%10
quotient = num//10
if counter == 0:
return 1
if num<10:
if counter ==1:
return num
else:
return 0
... | import functools
N = int(eval(input()))
K = int(eval(input()))
@functools.lru_cache(None)
def func(num,counter):
remain = num%10
quotient = num//10
if counter == 0:
return 1
if num<10:
if counter ==1:
return num
else:
retur... | 22 | 22 | 438 | 442 | import functools
N = int(eval(input()))
K = int(eval(input()))
@functools.lru_cache()
def func(num, counter):
remain = num % 10
quotient = num // 10
if counter == 0:
return 1
if num < 10:
if counter == 1:
return num
else:
return 0
return (
f... | import functools
N = int(eval(input()))
K = int(eval(input()))
@functools.lru_cache(None)
def func(num, counter):
remain = num % 10
quotient = num // 10
if counter == 0:
return 1
if num < 10:
if counter == 1:
return num
else:
return 0
return (
... | false | 0 | [
"-@functools.lru_cache()",
"+@functools.lru_cache(None)"
] | false | 0.037037 | 0.036632 | 1.011061 | [
"s033486058",
"s753953209"
] |
u690536347 | p02856 | python | s376441541 | s685492175 | 763 | 591 | 10,020 | 3,060 | Accepted | Accepted | 22.54 | M = int(eval(input()))
ans = 0
c1 = []
for _ in range(M):
d, c = list(map(int, input().split()))
v1 = ((d*c)//9)-((d*c)%9==0 and d*c>0)
v2 = c-1
ans += v1+v2
c1.append(d*c-9*v1)
ans += M-1
s = sum(c1)
ans += (s//9)-(s%9==0 and s>0)
print(ans)
| M = int(eval(input()))
ans, s = 0, 0
for _ in range(M):
d, c = list(map(int, input().split()))
s += d*c
ans += c
ans += (s-1)//9 - 1
print(ans)
| 15 | 10 | 267 | 155 | M = int(eval(input()))
ans = 0
c1 = []
for _ in range(M):
d, c = list(map(int, input().split()))
v1 = ((d * c) // 9) - ((d * c) % 9 == 0 and d * c > 0)
v2 = c - 1
ans += v1 + v2
c1.append(d * c - 9 * v1)
ans += M - 1
s = sum(c1)
ans += (s // 9) - (s % 9 == 0 and s > 0)
print(ans)
| M = int(eval(input()))
ans, s = 0, 0
for _ in range(M):
d, c = list(map(int, input().split()))
s += d * c
ans += c
ans += (s - 1) // 9 - 1
print(ans)
| false | 33.333333 | [
"-ans = 0",
"-c1 = []",
"+ans, s = 0, 0",
"- v1 = ((d * c) // 9) - ((d * c) % 9 == 0 and d * c > 0)",
"- v2 = c - 1",
"- ans += v1 + v2",
"- c1.append(d * c - 9 * v1)",
"-ans += M - 1",
"-s = sum(c1)",
"-ans += (s // 9) - (s % 9 == 0 and s > 0)",
"+ s += d * c",
"+ ans += c",... | false | 0.046238 | 0.14979 | 0.308688 | [
"s376441541",
"s685492175"
] |
u943057856 | p03557 | python | s230639139 | s801009350 | 1,349 | 336 | 24,180 | 23,092 | Accepted | Accepted | 75.09 | n=int(eval(input()))
a=sorted(list(map(int,input().split())))
b=sorted(list(map(int,input().split())))
c=sorted(list(map(int,input().split())))
ans=0
for i in b:
he=-1
ta=n
while ta-he>1:
mid=(he+ta)//2
if i>a[mid]:
he=mid
else:
ta=mid
x=he+1... | import bisect
n=int(eval(input()))
a=sorted(list(map(int,input().split())))
b=sorted(list(map(int,input().split())))
c=sorted(list(map(int,input().split())))
ans=0
for i in b:
x=bisect.bisect_left(a,i)
y=n-bisect.bisect_right(c,i)
ans+=x*y
print(ans) | 27 | 11 | 510 | 266 | n = int(eval(input()))
a = sorted(list(map(int, input().split())))
b = sorted(list(map(int, input().split())))
c = sorted(list(map(int, input().split())))
ans = 0
for i in b:
he = -1
ta = n
while ta - he > 1:
mid = (he + ta) // 2
if i > a[mid]:
he = mid
else:
... | import bisect
n = int(eval(input()))
a = sorted(list(map(int, input().split())))
b = sorted(list(map(int, input().split())))
c = sorted(list(map(int, input().split())))
ans = 0
for i in b:
x = bisect.bisect_left(a, i)
y = n - bisect.bisect_right(c, i)
ans += x * y
print(ans)
| false | 59.259259 | [
"+import bisect",
"+",
"- he = -1",
"- ta = n",
"- while ta - he > 1:",
"- mid = (he + ta) // 2",
"- if i > a[mid]:",
"- he = mid",
"- else:",
"- ta = mid",
"- x = he + 1",
"- he_ = -1",
"- ta_ = n",
"- while ta_ - he_ > 1:",
... | false | 0.098175 | 0.087001 | 1.128447 | [
"s230639139",
"s801009350"
] |
u071269360 | p03448 | python | s358492591 | s801016178 | 41 | 32 | 9,092 | 9,228 | Accepted | Accepted | 21.95 | import sys
a = int(eval(input()))
b = int(eval(input()))
c = int(eval(input()))
x = int(eval(input()))
cnt = 0
a_min = min( int(x/500) ,a)
for ai in range(a_min+1):
rem_a = x - (ai * 500)
if rem_a == 0:
cnt+=1
break
b_min = min( int(rem_a/100) ,b)
for bi in range(b_min+1... | a = int(eval(input()))
b = int(eval(input()))
c = int(eval(input()))
x = int(eval(input()))
cnt = 0
a_min = min( int(x/500) ,a)
for ai in range(a_min+1):
rem_a = x - (ai * 500)
if rem_a == 0:
cnt+=1
break
b_min = min( int(rem_a/100) ,b)
for bi in range(b_min+1):
re... | 28 | 26 | 600 | 586 | import sys
a = int(eval(input()))
b = int(eval(input()))
c = int(eval(input()))
x = int(eval(input()))
cnt = 0
a_min = min(int(x / 500), a)
for ai in range(a_min + 1):
rem_a = x - (ai * 500)
if rem_a == 0:
cnt += 1
break
b_min = min(int(rem_a / 100), b)
for bi in range(b_min + 1):
... | a = int(eval(input()))
b = int(eval(input()))
c = int(eval(input()))
x = int(eval(input()))
cnt = 0
a_min = min(int(x / 500), a)
for ai in range(a_min + 1):
rem_a = x - (ai * 500)
if rem_a == 0:
cnt += 1
break
b_min = min(int(rem_a / 100), b)
for bi in range(b_min + 1):
rem_b = r... | false | 7.142857 | [
"-import sys",
"-"
] | false | 0.038846 | 0.113089 | 0.343501 | [
"s358492591",
"s801016178"
] |
u553070631 | p02994 | python | s553900759 | s259854794 | 22 | 17 | 3,060 | 3,060 | Accepted | Accepted | 22.73 | n,l=list(map(int,input().split()))
pi=0
a=[]
abs_a=[]
for i in range(1,n+1):
pi+=l+i-1
for i in range(1,n+1):
a.append(l+i-1)
for i in range(n):
abs_a.append(abs(a[i]))
if max(a)<0:
p=pi+min(abs_a)
else:
p=pi-min(abs_a)
print(p) | n,l=list(map(int,input().split()))
pi=0
a=[]
abs_a=[]
for i in range(1,n+1):
pi+=l+i-1
a.append(l+i-1)
for i in range(n):
abs_a.append(abs(a[i]))
if max(a)<0:
p=pi+min(abs_a)
else:
p=pi-min(abs_a)
print(p) | 19 | 17 | 272 | 246 | n, l = list(map(int, input().split()))
pi = 0
a = []
abs_a = []
for i in range(1, n + 1):
pi += l + i - 1
for i in range(1, n + 1):
a.append(l + i - 1)
for i in range(n):
abs_a.append(abs(a[i]))
if max(a) < 0:
p = pi + min(abs_a)
else:
p = pi - min(abs_a)
print(p)
| n, l = list(map(int, input().split()))
pi = 0
a = []
abs_a = []
for i in range(1, n + 1):
pi += l + i - 1
a.append(l + i - 1)
for i in range(n):
abs_a.append(abs(a[i]))
if max(a) < 0:
p = pi + min(abs_a)
else:
p = pi - min(abs_a)
print(p)
| false | 10.526316 | [
"-for i in range(1, n + 1):"
] | false | 0.0355 | 0.035808 | 0.991393 | [
"s553900759",
"s259854794"
] |
u971091945 | p02779 | python | s747925651 | s643170179 | 182 | 91 | 26,808 | 26,808 | Accepted | Accepted | 50 | n = int(eval(input()))
a = list(map(int, input().split()))
a.sort()
for i in range(n-1):
if a[i] == a[i+1]:
print("NO")
exit(0)
print("YES") | n = int(eval(input()))
a = list(map(int, input().split()))
a_set = set(a)
if len(a) == len(a_set):
print("YES")
else:
print("NO") | 11 | 8 | 167 | 139 | n = int(eval(input()))
a = list(map(int, input().split()))
a.sort()
for i in range(n - 1):
if a[i] == a[i + 1]:
print("NO")
exit(0)
print("YES")
| n = int(eval(input()))
a = list(map(int, input().split()))
a_set = set(a)
if len(a) == len(a_set):
print("YES")
else:
print("NO")
| false | 27.272727 | [
"-a.sort()",
"-for i in range(n - 1):",
"- if a[i] == a[i + 1]:",
"- print(\"NO\")",
"- exit(0)",
"-print(\"YES\")",
"+a_set = set(a)",
"+if len(a) == len(a_set):",
"+ print(\"YES\")",
"+else:",
"+ print(\"NO\")"
] | false | 0.046779 | 0.048176 | 0.971001 | [
"s747925651",
"s643170179"
] |
u439396449 | p03608 | python | s250805368 | s566011407 | 773 | 371 | 31,720 | 9,548 | Accepted | Accepted | 52.01 | from itertools import permutations, product
from scipy.sparse.csgraph import floyd_warshall
from scipy.sparse import csr_matrix
N, M, R = list(map(int, input().split()))
r = [int(x) for x in input().split()]
abc = [[int(x) for x in input().split()] for _ in range(M)]
dist = [[float('inf') for _ in range(N)] f... | from itertools import permutations, product
from collections import defaultdict
from heapq import heappop, heappush
N, M, R = list(map(int, input().split()))
r = [int(x) for x in input().split()]
abc = [[int(x) for x in input().split()] for _ in range(M)]
class Graph(object):
def __init__(self):
... | 28 | 75 | 771 | 1,887 | from itertools import permutations, product
from scipy.sparse.csgraph import floyd_warshall
from scipy.sparse import csr_matrix
N, M, R = list(map(int, input().split()))
r = [int(x) for x in input().split()]
abc = [[int(x) for x in input().split()] for _ in range(M)]
dist = [[float("inf") for _ in range(N)] for _ in r... | from itertools import permutations, product
from collections import defaultdict
from heapq import heappop, heappush
N, M, R = list(map(int, input().split()))
r = [int(x) for x in input().split()]
abc = [[int(x) for x in input().split()] for _ in range(M)]
class Graph(object):
def __init__(self):
self.gra... | false | 62.666667 | [
"-from scipy.sparse.csgraph import floyd_warshall",
"-from scipy.sparse import csr_matrix",
"+from collections import defaultdict",
"+from heapq import heappop, heappush",
"-dist = [[float(\"inf\") for _ in range(N)] for _ in range(N)]",
"-A, B, C = [0] * M, [0] * M, [0] * M",
"-for i in range(M):",
"... | false | 0.472782 | 0.007691 | 61.471107 | [
"s250805368",
"s566011407"
] |
u197968862 | p03371 | python | s025524900 | s084764216 | 129 | 110 | 3,060 | 3,060 | Accepted | Accepted | 14.73 | a, b, c, x, y = list(map(int,input().split()))
price = a * x + b * y
for i in range(max(x,y)+1):
new_price = c * 2 * i + max(a * (x - i),0) + max(b * (y - i),0)
price = min(price,new_price)
print(price) | a, b, c, x, y = list(map(int,input().split()))
price = a * x + b * y
for i in range(max(x,y)+1):
price = min(price,c * 2 * i + max(a * (x - i),0) + max(b * (y - i),0))
print(price) | 8 | 7 | 213 | 186 | a, b, c, x, y = list(map(int, input().split()))
price = a * x + b * y
for i in range(max(x, y) + 1):
new_price = c * 2 * i + max(a * (x - i), 0) + max(b * (y - i), 0)
price = min(price, new_price)
print(price)
| a, b, c, x, y = list(map(int, input().split()))
price = a * x + b * y
for i in range(max(x, y) + 1):
price = min(price, c * 2 * i + max(a * (x - i), 0) + max(b * (y - i), 0))
print(price)
| false | 12.5 | [
"- new_price = c * 2 * i + max(a * (x - i), 0) + max(b * (y - i), 0)",
"- price = min(price, new_price)",
"+ price = min(price, c * 2 * i + max(a * (x - i), 0) + max(b * (y - i), 0))"
] | false | 0.06463 | 0.158943 | 0.406624 | [
"s025524900",
"s084764216"
] |
u348805958 | p02632 | python | s365397598 | s347447632 | 232 | 210 | 103,744 | 103,208 | Accepted | Accepted | 9.48 | #!python3
import sys
iim = lambda: list(map(int, sys.stdin.readline().rstrip().split()))
def _cmb(N, mod):
N1 = N + 1
fact = [1] * N1
inv = [1] * N1
for i in range(2, N1):
fact[i] = fact[i-1] * i % mod
inv[N] = pow(fact[N], mod-2, mod)
for i in range(N-1, 1, -1):
... | #!python3
import sys
iim = lambda: list(map(int, sys.stdin.readline().rstrip().split()))
def _cmb(N, mod):
N1 = N + 1
fact = [1] * N1
inv = [1] * N1
for i in range(2, N1):
fact[i] = fact[i-1] * i % mod
inv[N] = pow(fact[N], mod-2, mod)
for i in range(N-1, 1, -1):
... | 41 | 39 | 885 | 828 | #!python3
import sys
iim = lambda: list(map(int, sys.stdin.readline().rstrip().split()))
def _cmb(N, mod):
N1 = N + 1
fact = [1] * N1
inv = [1] * N1
for i in range(2, N1):
fact[i] = fact[i - 1] * i % mod
inv[N] = pow(fact[N], mod - 2, mod)
for i in range(N - 1, 1, -1):
inv[i] ... | #!python3
import sys
iim = lambda: list(map(int, sys.stdin.readline().rstrip().split()))
def _cmb(N, mod):
N1 = N + 1
fact = [1] * N1
inv = [1] * N1
for i in range(2, N1):
fact[i] = fact[i - 1] * i % mod
inv[N] = pow(fact[N], mod - 2, mod)
for i in range(N - 1, 1, -1):
inv[i] ... | false | 4.878049 | [
"- p25 = 1",
"- p26 = pow(26, K, mod)",
"- p26inv = 576923081 # pow(26, mod-2, mod)",
"+ pp = 1 * pow(26, K, mod) % mod",
"+ px = 25 * pow(26, mod - 2, mod) % mod",
"- ans = (ans + cmb(ls + i, i) * p25 % mod * p26 % mod) % mod",
"- p25 = p25 * 25 % mod",
"- p26 = ... | false | 0.048772 | 0.140071 | 0.348195 | [
"s365397598",
"s347447632"
] |
u327310087 | p03775 | python | s278630892 | s671211800 | 275 | 43 | 3,188 | 3,060 | Accepted | Accepted | 84.36 | def f(a, b):
tmpA, tmpB = a, b
countA = 0
while tmpA:
tmpA //= 10
countA += 1
digitA = countA
countB = 0
while tmpB:
tmpB //= 10
countB += 1
digitB = countB
return max(digitA, digitB)
n = int(eval(input()))
ans = 11
for a in range(1,... | def f(a, b):
return max(len(str(a)), len(str(b)))
n = int(eval(input()))
ans = 11
for a in range(1, int(n ** 0.5) + 1):
b = n // a
if n % a == 0 and f(a, b) < ans:
ans = f(a, b)
print(ans) | 25 | 12 | 425 | 217 | def f(a, b):
tmpA, tmpB = a, b
countA = 0
while tmpA:
tmpA //= 10
countA += 1
digitA = countA
countB = 0
while tmpB:
tmpB //= 10
countB += 1
digitB = countB
return max(digitA, digitB)
n = int(eval(input()))
ans = 11
for a in range(1, int(n**0.5) + 1):
... | def f(a, b):
return max(len(str(a)), len(str(b)))
n = int(eval(input()))
ans = 11
for a in range(1, int(n**0.5) + 1):
b = n // a
if n % a == 0 and f(a, b) < ans:
ans = f(a, b)
print(ans)
| false | 52 | [
"- tmpA, tmpB = a, b",
"- countA = 0",
"- while tmpA:",
"- tmpA //= 10",
"- countA += 1",
"- digitA = countA",
"- countB = 0",
"- while tmpB:",
"- tmpB //= 10",
"- countB += 1",
"- digitB = countB",
"- return max(digitA, digitB)",
"+ ret... | false | 0.172471 | 0.041777 | 4.128351 | [
"s278630892",
"s671211800"
] |
u197955752 | p03262 | python | s975318084 | s637497574 | 140 | 111 | 16,276 | 16,280 | Accepted | Accepted | 20.71 | from fractions import gcd
N, X = [int(a) for a in input().split()]
x = [int(a) for a in input().split()]
x.sort()
if X < x[0]:
d = x[0] - X
elif X > x[N - 1]:
d = X - x[N - 1]
else: # x[i] <= Xである最大のiを求める
ok = 0 # x[0] <= Xを満たす
ng = N - 1 # x[N - 1] > X
while ng - ok > 1:
... | from fractions import gcd
N, X = [int(a) for a in input().split()]
x = [int(a) for a in input().split()]
d = abs(X - x[0])
for i in range(1, N):
d = gcd(d, abs(x[i] - x[i - 1]))
print(d)
| 26 | 10 | 541 | 203 | from fractions import gcd
N, X = [int(a) for a in input().split()]
x = [int(a) for a in input().split()]
x.sort()
if X < x[0]:
d = x[0] - X
elif X > x[N - 1]:
d = X - x[N - 1]
else: # x[i] <= Xである最大のiを求める
ok = 0 # x[0] <= Xを満たす
ng = N - 1 # x[N - 1] > X
while ng - ok > 1:
mid = (ok + ng)... | from fractions import gcd
N, X = [int(a) for a in input().split()]
x = [int(a) for a in input().split()]
d = abs(X - x[0])
for i in range(1, N):
d = gcd(d, abs(x[i] - x[i - 1]))
print(d)
| false | 61.538462 | [
"-x.sort()",
"-if X < x[0]:",
"- d = x[0] - X",
"-elif X > x[N - 1]:",
"- d = X - x[N - 1]",
"-else: # x[i] <= Xである最大のiを求める",
"- ok = 0 # x[0] <= Xを満たす",
"- ng = N - 1 # x[N - 1] > X",
"- while ng - ok > 1:",
"- mid = (ok + ng) // 2",
"- if x[mid] <= X:",
"- ... | false | 0.04738 | 0.053721 | 0.88196 | [
"s975318084",
"s637497574"
] |
u701318346 | p03361 | python | s918427830 | s224710931 | 176 | 20 | 3,064 | 3,064 | Accepted | Accepted | 88.64 | H, W = list(map(int, input().split()))
T=0
if H==1 & W==1:
print("No")
T=1
D=0
Numlist = []
for i in range(H):
D+=100
I=0
RawList = []
RawList = list(eval(input()))
for j in range(W):
CheckNum = RawList[j]
I+=1
if CheckNum == "#":
Numlist.append(D+I)
N=0
for k in range(len(... | H, W = list(map(int, input().split()))
S = [list(eval(input())) for _ in range(H)]
S_eval = [[1] * W for _ in range(H)]
# 横
for i in range(H):
for j in range(W - 1):
if S[i][j] == '.':
S_eval[i][j] = 0
if S[i][j + 1] == '.':
S_eval[i][j + 1] = 0
if S[i][j]... | 49 | 28 | 600 | 668 | H, W = list(map(int, input().split()))
T = 0
if H == 1 & W == 1:
print("No")
T = 1
D = 0
Numlist = []
for i in range(H):
D += 100
I = 0
RawList = []
RawList = list(eval(input()))
for j in range(W):
CheckNum = RawList[j]
I += 1
if CheckNum == "#":
Numlist.a... | H, W = list(map(int, input().split()))
S = [list(eval(input())) for _ in range(H)]
S_eval = [[1] * W for _ in range(H)]
# 横
for i in range(H):
for j in range(W - 1):
if S[i][j] == ".":
S_eval[i][j] = 0
if S[i][j + 1] == ".":
S_eval[i][j + 1] = 0
if S[i][j] == S[i][j +... | false | 42.857143 | [
"-T = 0",
"-if H == 1 & W == 1:",
"- print(\"No\")",
"- T = 1",
"-D = 0",
"-Numlist = []",
"+S = [list(eval(input())) for _ in range(H)]",
"+S_eval = [[1] * W for _ in range(H)]",
"+# 横",
"- D += 100",
"- I = 0",
"- RawList = []",
"- RawList = list(eval(input()))",
"+ ... | false | 0.064578 | 0.035555 | 1.816298 | [
"s918427830",
"s224710931"
] |
u741495664 | p02924 | python | s183721503 | s777232745 | 36 | 17 | 5,076 | 2,940 | Accepted | Accepted | 52.78 | from decimal import *
N = int(eval(input()))
print((int((Decimal(N-1)*Decimal(N))/Decimal(2)))) | N = int(eval(input()))
print((((N-1)*N)//2)) | 3 | 2 | 89 | 37 | from decimal import *
N = int(eval(input()))
print((int((Decimal(N - 1) * Decimal(N)) / Decimal(2))))
| N = int(eval(input()))
print((((N - 1) * N) // 2))
| false | 33.333333 | [
"-from decimal import *",
"-",
"-print((int((Decimal(N - 1) * Decimal(N)) / Decimal(2))))",
"+print((((N - 1) * N) // 2))"
] | false | 0.041137 | 0.038467 | 1.069419 | [
"s183721503",
"s777232745"
] |
u670180528 | p03096 | python | s402400379 | s697517678 | 344 | 264 | 38,144 | 38,148 | Accepted | Accepted | 23.26 | n, *cs = list(map(int, open(0)))
fwd = [0] * n
mod = 10 ** 9 + 7
d = {}
for i, c in enumerate(cs[::-1], start=1):
f = d.get(c, 0)
if f:
fwd[n - i] = f
d[c] = n - i
dp = [0] * (n + 1)
dp[0] = 1
for i in range(1, n + 1):
dp[i] += dp[i - 1]
dp[i] %= mod
# 隣だったら無視
if fwd[i - 1] > i:
dp[fwd[i - 1]... | def main():
n, *cs = list(map(int, open(0)))
fwd = [0] * n
mod = 10 ** 9 + 7
d = {}
for i, c in enumerate(cs[::-1], start=1):
f = d.get(c, 0)
if f:
fwd[n - i] = f
d[c] = n - i
dp = [0] * (n + 1)
dp[0] = 1
for i, fwd in enumerate(fwd, start=1):
dp[i] += dp[i - 1] % mod
if fwd > i:
... | 18 | 20 | 343 | 399 | n, *cs = list(map(int, open(0)))
fwd = [0] * n
mod = 10**9 + 7
d = {}
for i, c in enumerate(cs[::-1], start=1):
f = d.get(c, 0)
if f:
fwd[n - i] = f
d[c] = n - i
dp = [0] * (n + 1)
dp[0] = 1
for i in range(1, n + 1):
dp[i] += dp[i - 1]
dp[i] %= mod
# 隣だったら無視
if fwd[i - 1] > i:
... | def main():
n, *cs = list(map(int, open(0)))
fwd = [0] * n
mod = 10**9 + 7
d = {}
for i, c in enumerate(cs[::-1], start=1):
f = d.get(c, 0)
if f:
fwd[n - i] = f
d[c] = n - i
dp = [0] * (n + 1)
dp[0] = 1
for i, fwd in enumerate(fwd, start=1):
dp... | false | 10 | [
"-n, *cs = list(map(int, open(0)))",
"-fwd = [0] * n",
"-mod = 10**9 + 7",
"-d = {}",
"-for i, c in enumerate(cs[::-1], start=1):",
"- f = d.get(c, 0)",
"- if f:",
"- fwd[n - i] = f",
"- d[c] = n - i",
"-dp = [0] * (n + 1)",
"-dp[0] = 1",
"-for i in range(1, n + 1):",
"- d... | false | 0.040579 | 0.0466 | 0.870792 | [
"s402400379",
"s697517678"
] |
u135389999 | p02923 | python | s958041446 | s460135723 | 87 | 74 | 14,224 | 15,020 | Accepted | Accepted | 14.94 | full_num = int(eval(input()))
A = list(map(int, input().split()))
move = 0
A_result = ""
for i in range(full_num-1):
if A[i] >= A[i+1]:
A_result =A_result+"1"
else:
A_result =A_result+"0"
B = list(A_result.split("0"))
C = []
for i in B:
C.append(len(i))
print((max(C))) | n = int(eval(input()))
h = list(map(int, input().split()))
cnt =0
m =[]
if n !=1:
for i in range(n - 1):
if h[i] >= h[i + 1]:
cnt += 1
if i == n - 2:
m.append(cnt)
else:
m.append(cnt)
cnt = 0
else:
m.append(0)
print((max(m))) | 14 | 17 | 306 | 280 | full_num = int(eval(input()))
A = list(map(int, input().split()))
move = 0
A_result = ""
for i in range(full_num - 1):
if A[i] >= A[i + 1]:
A_result = A_result + "1"
else:
A_result = A_result + "0"
B = list(A_result.split("0"))
C = []
for i in B:
C.append(len(i))
print((max(C)))
| n = int(eval(input()))
h = list(map(int, input().split()))
cnt = 0
m = []
if n != 1:
for i in range(n - 1):
if h[i] >= h[i + 1]:
cnt += 1
if i == n - 2:
m.append(cnt)
else:
m.append(cnt)
cnt = 0
else:
m.append(0)
print((max(m)))
| false | 17.647059 | [
"-full_num = int(eval(input()))",
"-A = list(map(int, input().split()))",
"-move = 0",
"-A_result = \"\"",
"-for i in range(full_num - 1):",
"- if A[i] >= A[i + 1]:",
"- A_result = A_result + \"1\"",
"- else:",
"- A_result = A_result + \"0\"",
"-B = list(A_result.split(\"0\"))"... | false | 0.04934 | 0.039598 | 1.246026 | [
"s958041446",
"s460135723"
] |
u780475861 | p03061 | python | s327118928 | s841342604 | 205 | 51 | 14,652 | 14,652 | Accepted | Accepted | 75.12 | import sys
from functools import lru_cache
sys.setrecursionlimit(1000000)
@lru_cache(maxsize=None)
def main():
def gcd(a, b):
if b == 0:
return a
if a % b == 0:
return b
else:
return gcd(b, a % b)
N, *A = list(map(int, sys.stdin.read(... | import sys
from functools import lru_cache
sys.setrecursionlimit(1000000)
@lru_cache(maxsize=None)
def main():
def gcd(a,b):
if b>a:
a,b=b,a
while b:
a,b=b, a%b
return a
def cul(n,x):
l=len(x)
b=[x[i] for i in range(l)]
... | 26 | 35 | 584 | 646 | import sys
from functools import lru_cache
sys.setrecursionlimit(1000000)
@lru_cache(maxsize=None)
def main():
def gcd(a, b):
if b == 0:
return a
if a % b == 0:
return b
else:
return gcd(b, a % b)
N, *A = list(map(int, sys.stdin.read().split()))
... | import sys
from functools import lru_cache
sys.setrecursionlimit(1000000)
@lru_cache(maxsize=None)
def main():
def gcd(a, b):
if b > a:
a, b = b, a
while b:
a, b = b, a % b
return a
def cul(n, x):
l = len(x)
b = [x[i] for i in range(l)]
... | false | 25.714286 | [
"- if b == 0:",
"- return a",
"- if a % b == 0:",
"- return b",
"- else:",
"- return gcd(b, a % b)",
"+ if b > a:",
"+ a, b = b, a",
"+ while b:",
"+ a, b = b, a % b",
"+ return a",
"- N, *A = l... | false | 0.039425 | 0.048198 | 0.817979 | [
"s327118928",
"s841342604"
] |
u644907318 | p03329 | python | s923851244 | s217446131 | 935 | 168 | 34,824 | 38,384 | Accepted | Accepted | 82.03 | N = int(eval(input()))
A = [1]
for k in range(1,7):
A.append(6**k)
for k in range(1,6):
A.append(9**k)
dp = [[0 for _ in range(len(A))] for _ in range(N+1)]
for i in range(N+1):
dp[i][0] = i
for j in range(len(A)):
dp[1][j] = 1
for i in range(2,N+1):
for j in range(1,len(A)):
if... | memo = {}
def f(x):
if 0<=x<=5:
return x
if x in memo:
return memo[x]
k = 0
while 9**k<=x:
k += 1
m = 0
while 6**m<=x:
m += 1
memo[x] = min(f(x-9**(k-1))+1,f(x-6**(m-1))+1)
return memo[x]
print((f(int(eval(input()))))) | 18 | 15 | 453 | 292 | N = int(eval(input()))
A = [1]
for k in range(1, 7):
A.append(6**k)
for k in range(1, 6):
A.append(9**k)
dp = [[0 for _ in range(len(A))] for _ in range(N + 1)]
for i in range(N + 1):
dp[i][0] = i
for j in range(len(A)):
dp[1][j] = 1
for i in range(2, N + 1):
for j in range(1, len(A)):
if i ... | memo = {}
def f(x):
if 0 <= x <= 5:
return x
if x in memo:
return memo[x]
k = 0
while 9**k <= x:
k += 1
m = 0
while 6**m <= x:
m += 1
memo[x] = min(f(x - 9 ** (k - 1)) + 1, f(x - 6 ** (m - 1)) + 1)
return memo[x]
print((f(int(eval(input())))))
| false | 16.666667 | [
"-N = int(eval(input()))",
"-A = [1]",
"-for k in range(1, 7):",
"- A.append(6**k)",
"-for k in range(1, 6):",
"- A.append(9**k)",
"-dp = [[0 for _ in range(len(A))] for _ in range(N + 1)]",
"-for i in range(N + 1):",
"- dp[i][0] = i",
"-for j in range(len(A)):",
"- dp[1][j] = 1",
... | false | 0.189057 | 0.036337 | 5.202958 | [
"s923851244",
"s217446131"
] |
u296783581 | p03137 | python | s670921923 | s025338416 | 1,526 | 102 | 13,968 | 13,960 | Accepted | Accepted | 93.32 | N,M = list(map(int,(input().split())))
X = list(map(int,(input().split())))
X.sort()
if M > N:
dist = [X[i+1]-X[i] for i in range(M - 1)]
dist.sort(reverse = True)
for i in range(N - 1):
del dist[0]
print((sum(dist)))
else:
print((0)) | N,M = list(map(int,(input().split())))
X = list(map(int,(input().split())))
X.sort()
if M > N:
dist = [X[i+1]-X[i] for i in range(M - 1)]
dist.sort(reverse = True)
del dist[0:N-1]
print((sum(dist)))
else:
print((0)) | 11 | 10 | 259 | 231 | N, M = list(map(int, (input().split())))
X = list(map(int, (input().split())))
X.sort()
if M > N:
dist = [X[i + 1] - X[i] for i in range(M - 1)]
dist.sort(reverse=True)
for i in range(N - 1):
del dist[0]
print((sum(dist)))
else:
print((0))
| N, M = list(map(int, (input().split())))
X = list(map(int, (input().split())))
X.sort()
if M > N:
dist = [X[i + 1] - X[i] for i in range(M - 1)]
dist.sort(reverse=True)
del dist[0 : N - 1]
print((sum(dist)))
else:
print((0))
| false | 9.090909 | [
"- for i in range(N - 1):",
"- del dist[0]",
"+ del dist[0 : N - 1]"
] | false | 0.103171 | 0.034837 | 2.961551 | [
"s670921923",
"s025338416"
] |
u699296734 | p02754 | python | s169674825 | s917668223 | 169 | 17 | 38,384 | 3,060 | Accepted | Accepted | 89.94 | n,a,b=list(map(int,input().split()))
x=n//(a+b)
y=n%(a+b)
print((a*x+min(y,a)))
# if a==0:
# print(0)
# else:
# x=n//(a+b)
# y=n%(a+b)
# print(a*x+min(y,a)) | n,a,b=list(map(int,input().split()))
# x=n//(a+b)
# y=n%(a+b)
# print(a*x+min(y,a))
if a==0:
print((0))
else:
x=n//(a+b)
y=n%(a+b)
print((a*x+min(y,a))) | 10 | 10 | 173 | 167 | n, a, b = list(map(int, input().split()))
x = n // (a + b)
y = n % (a + b)
print((a * x + min(y, a)))
# if a==0:
# print(0)
# else:
# x=n//(a+b)
# y=n%(a+b)
# print(a*x+min(y,a))
| n, a, b = list(map(int, input().split()))
# x=n//(a+b)
# y=n%(a+b)
# print(a*x+min(y,a))
if a == 0:
print((0))
else:
x = n // (a + b)
y = n % (a + b)
print((a * x + min(y, a)))
| false | 0 | [
"-x = n // (a + b)",
"-y = n % (a + b)",
"-print((a * x + min(y, a)))",
"-# if a==0:",
"-# print(0)",
"-# else:",
"+if a == 0:",
"+ print((0))",
"+else:",
"+ x = n // (a + b)",
"+ y = n % (a + b)",
"+ print((a * x + min(y, a)))"
] | false | 0.042688 | 0.042364 | 1.007656 | [
"s169674825",
"s917668223"
] |
u193264896 | p03557 | python | s076583619 | s634544587 | 335 | 253 | 21,580 | 27,444 | Accepted | Accepted | 24.48 | import sys
from bisect import bisect_right, bisect_left
from functools import reduce
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7
def lcm_base(x, y):
return (x * y) // gcd(x, y)
def lcm_list(numbers):
return reduce(lcm_base, numbers, 1)
... | import sys
read = sys.stdin.read
readline = sys.stdin.buffer.readline
from bisect import bisect_right, bisect_left
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7
def main():
N = int(readline())
A = list(map(int, readline().split()))
B = list(map(int, readline().split()))
... | 30 | 29 | 741 | 574 | import sys
from bisect import bisect_right, bisect_left
from functools import reduce
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10**8)
INF = float("inf")
MOD = 10**9 + 7
def lcm_base(x, y):
return (x * y) // gcd(x, y)
def lcm_list(numbers):
return reduce(lcm_base, numbers, 1)
def main():
... | import sys
read = sys.stdin.read
readline = sys.stdin.buffer.readline
from bisect import bisect_right, bisect_left
sys.setrecursionlimit(10**8)
INF = float("inf")
MOD = 10**9 + 7
def main():
N = int(readline())
A = list(map(int, readline().split()))
B = list(map(int, readline().split()))
C = list(ma... | false | 3.333333 | [
"+",
"+read = sys.stdin.read",
"+readline = sys.stdin.buffer.readline",
"-from functools import reduce",
"-readline = sys.stdin.buffer.readline",
"-",
"-",
"-def lcm_base(x, y):",
"- return (x * y) // gcd(x, y)",
"-",
"-",
"-def lcm_list(numbers):",
"- return reduce(lcm_base, numbers, ... | false | 0.058602 | 0.042 | 1.395297 | [
"s076583619",
"s634544587"
] |
u562935282 | p02842 | python | s514776528 | s921693406 | 199 | 17 | 39,408 | 2,940 | Accepted | Accepted | 91.46 | n = int(eval(input()))
for x in range(n + 1):
if int(x * 1.08) == n:
print(x)
exit()
print(':(')
| from math import ceil
n = int(eval(input()))
x = ceil(n / 1.08)
print((x if int(x * 1.08) == n else ':('))
# n=floor(x*1.08)
# n<=x*1.08<n+1
# n/1.08<=x<(n+1)/1.08
# xの必要条件は、
# n/1.08<=x<(n+1)/1.08
# xは整数
# xは整数とn/1.08<=xから、
# ceil(n/1.08)である必要があるので、これがnに一致すれば、
# n/1.08<=x<(n+1)/1.08
# この範囲に整数がある
| 7 | 18 | 118 | 311 | n = int(eval(input()))
for x in range(n + 1):
if int(x * 1.08) == n:
print(x)
exit()
print(":(")
| from math import ceil
n = int(eval(input()))
x = ceil(n / 1.08)
print((x if int(x * 1.08) == n else ":("))
# n=floor(x*1.08)
# n<=x*1.08<n+1
# n/1.08<=x<(n+1)/1.08
# xの必要条件は、
# n/1.08<=x<(n+1)/1.08
# xは整数
# xは整数とn/1.08<=xから、
# ceil(n/1.08)である必要があるので、これがnに一致すれば、
# n/1.08<=x<(n+1)/1.08
# この範囲に整数がある
| false | 61.111111 | [
"+from math import ceil",
"+",
"-for x in range(n + 1):",
"- if int(x * 1.08) == n:",
"- print(x)",
"- exit()",
"-print(\":(\")",
"+x = ceil(n / 1.08)",
"+print((x if int(x * 1.08) == n else \":(\"))",
"+# n=floor(x*1.08)",
"+# n<=x*1.08<n+1",
"+# n/1.08<=x<(n+1)/1.08",
"+# ... | false | 0.082106 | 0.057414 | 1.430066 | [
"s514776528",
"s921693406"
] |
u460386402 | p02785 | python | s342488364 | s730224810 | 173 | 119 | 26,764 | 31,672 | Accepted | Accepted | 31.21 | n,k=list(map(int,input().split()))
h=list(map(int,input().split()))
h=sorted(h)
if n<=k:
print('0')
exit()
for i in range(k):
h[-i-1]=0
print((sum(h))) | n,k=list(map(int,input().split()))
h=list(map(int,input().split()))
h.sort(reverse=True)
if n<=k:
print((0))
exit()
for i in range(k):
h[i]=0
print((sum(h))) | 10 | 10 | 155 | 165 | n, k = list(map(int, input().split()))
h = list(map(int, input().split()))
h = sorted(h)
if n <= k:
print("0")
exit()
for i in range(k):
h[-i - 1] = 0
print((sum(h)))
| n, k = list(map(int, input().split()))
h = list(map(int, input().split()))
h.sort(reverse=True)
if n <= k:
print((0))
exit()
for i in range(k):
h[i] = 0
print((sum(h)))
| false | 0 | [
"-h = sorted(h)",
"+h.sort(reverse=True)",
"- print(\"0\")",
"+ print((0))",
"- h[-i - 1] = 0",
"+ h[i] = 0"
] | false | 0.035892 | 0.034945 | 1.027093 | [
"s342488364",
"s730224810"
] |
u970133396 | p02684 | python | s087102162 | s987292464 | 211 | 180 | 32,384 | 32,372 | Accepted | Accepted | 14.69 | n, k = list(map(int, input().strip().split()))
L = list(map(int, input().strip().split()))
L = [v - 1 for v in L]
seen = set()
cur = 0
untillBackToIntersec = 0
while cur not in seen:
seen.add(cur)
untillBackToIntersec += 1
cur = L[cur]
intersec = cur
cur = 0
beforeLoop = 0
while cur != ... | n, k = list(map(int, input().strip().split()))
L = list(map(int, input().strip().split()))
L = [v - 1 for v in L]
seen = set()
intersec = 0
route=[]
while intersec not in seen:
seen.add(intersec)
route.append(intersec)
intersec = L[intersec]
intersecInd = route.index(intersec)
if k<=inters... | 31 | 21 | 582 | 468 | n, k = list(map(int, input().strip().split()))
L = list(map(int, input().strip().split()))
L = [v - 1 for v in L]
seen = set()
cur = 0
untillBackToIntersec = 0
while cur not in seen:
seen.add(cur)
untillBackToIntersec += 1
cur = L[cur]
intersec = cur
cur = 0
beforeLoop = 0
while cur != intersec:
cur = L... | n, k = list(map(int, input().strip().split()))
L = list(map(int, input().strip().split()))
L = [v - 1 for v in L]
seen = set()
intersec = 0
route = []
while intersec not in seen:
seen.add(intersec)
route.append(intersec)
intersec = L[intersec]
intersecInd = route.index(intersec)
if k <= intersecInd:
ans... | false | 32.258065 | [
"-cur = 0",
"-untillBackToIntersec = 0",
"-while cur not in seen:",
"- seen.add(cur)",
"- untillBackToIntersec += 1",
"- cur = L[cur]",
"-intersec = cur",
"-cur = 0",
"-beforeLoop = 0",
"-while cur != intersec:",
"- cur = L[cur]",
"- beforeLoop += 1",
"-if k <= beforeLoop:",
... | false | 0.036886 | 0.038486 | 0.958432 | [
"s087102162",
"s987292464"
] |
u852690916 | p02714 | python | s906265380 | s500836082 | 165 | 140 | 68,504 | 74,284 | Accepted | Accepted | 15.15 | N=int(eval(input()))
S=eval(input())
M=[0 if s=='R' else 1 if s=='G' else 2 for s in S]
C = [[0] * (N+1) for _ in range(3)]
for i in range(N-1,-1,-1):
for j in range(3):
C[j][i] = C[j][i+1]+1 if M[i]==j else C[j][i+1]
ans=0
for i in range(N):
for j in range(i+1,N):
if M[i]==M[j]: c... | N=int(eval(input()))
S=eval(input())
from collections import Counter
C=Counter(S)
ans=C['R']*C['G']*C['B']
for i in range(N):
for j in range(i+1,N):
if j+(j-i) >= N: break
if S[i] != S[j] and S[j] != S[j+(j-i)] and S[i] != S[j+(j-i)]:
ans-=1
print(ans) | 17 | 11 | 425 | 282 | N = int(eval(input()))
S = eval(input())
M = [0 if s == "R" else 1 if s == "G" else 2 for s in S]
C = [[0] * (N + 1) for _ in range(3)]
for i in range(N - 1, -1, -1):
for j in range(3):
C[j][i] = C[j][i + 1] + 1 if M[i] == j else C[j][i + 1]
ans = 0
for i in range(N):
for j in range(i + 1, N):
i... | N = int(eval(input()))
S = eval(input())
from collections import Counter
C = Counter(S)
ans = C["R"] * C["G"] * C["B"]
for i in range(N):
for j in range(i + 1, N):
if j + (j - i) >= N:
break
if S[i] != S[j] and S[j] != S[j + (j - i)] and S[i] != S[j + (j - i)]:
ans -= 1
prin... | false | 35.294118 | [
"-M = [0 if s == \"R\" else 1 if s == \"G\" else 2 for s in S]",
"-C = [[0] * (N + 1) for _ in range(3)]",
"-for i in range(N - 1, -1, -1):",
"- for j in range(3):",
"- C[j][i] = C[j][i + 1] + 1 if M[i] == j else C[j][i + 1]",
"-ans = 0",
"+from collections import Counter",
"+",
"+C = Coun... | false | 0.0433 | 0.105158 | 0.41176 | [
"s906265380",
"s500836082"
] |
u199588618 | p02712 | python | s179239933 | s857714065 | 202 | 172 | 9,168 | 9,004 | Accepted | Accepted | 14.85 | N=int(eval(input()))
count=0
for i in range(N+1):
if i %15==0:
i="FizzBuzz"
elif i%3==0:
i="Fizz"
elif i%5==0:
i="Buzz"
else:
count+=i
print(count) | N=int(eval(input()))
sum=0
for i in range(N+1):
if i%3==0 or i%5==0:
sum+=0
else:
sum+=i
print(sum) | 13 | 8 | 202 | 124 | N = int(eval(input()))
count = 0
for i in range(N + 1):
if i % 15 == 0:
i = "FizzBuzz"
elif i % 3 == 0:
i = "Fizz"
elif i % 5 == 0:
i = "Buzz"
else:
count += i
print(count)
| N = int(eval(input()))
sum = 0
for i in range(N + 1):
if i % 3 == 0 or i % 5 == 0:
sum += 0
else:
sum += i
print(sum)
| false | 38.461538 | [
"-count = 0",
"+sum = 0",
"- if i % 15 == 0:",
"- i = \"FizzBuzz\"",
"- elif i % 3 == 0:",
"- i = \"Fizz\"",
"- elif i % 5 == 0:",
"- i = \"Buzz\"",
"+ if i % 3 == 0 or i % 5 == 0:",
"+ sum += 0",
"- count += i",
"-print(count)",
"+ sum +... | false | 0.377432 | 0.465937 | 0.810049 | [
"s179239933",
"s857714065"
] |
u628707847 | p02712 | python | s947214465 | s180295432 | 199 | 134 | 9,168 | 9,136 | Accepted | Accepted | 32.66 | n = int(eval(input()))
sum = 0
for i in range(1,n+1):
if not(i%15==0 or i%5==0 or i%3==0):
sum += i
print(sum) | n = int(eval(input()))
print((sum(i for i in range(1,n+1) if i%5!=0 and i%3!=0 if i%15 != 0))) | 6 | 2 | 121 | 87 | n = int(eval(input()))
sum = 0
for i in range(1, n + 1):
if not (i % 15 == 0 or i % 5 == 0 or i % 3 == 0):
sum += i
print(sum)
| n = int(eval(input()))
print((sum(i for i in range(1, n + 1) if i % 5 != 0 and i % 3 != 0 if i % 15 != 0)))
| false | 66.666667 | [
"-sum = 0",
"-for i in range(1, n + 1):",
"- if not (i % 15 == 0 or i % 5 == 0 or i % 3 == 0):",
"- sum += i",
"-print(sum)",
"+print((sum(i for i in range(1, n + 1) if i % 5 != 0 and i % 3 != 0 if i % 15 != 0)))"
] | false | 0.301243 | 0.223139 | 1.350024 | [
"s947214465",
"s180295432"
] |
u623231048 | p02971 | python | s423885193 | s514392174 | 521 | 265 | 12,508 | 12,508 | Accepted | Accepted | 49.14 | n = int(eval(input()))
li = [0]*n
for i in range(n):
li[i] = int(eval(input()))
a = 0
b = 0
for i in li:
if i > a:
b = a
a = i
elif i > b:
b = i
for i in li:
if i == a:
print(b)
else:
print(a)
| import sys
input = sys.stdin.readline
n = int(eval(input()))
li = [0]*n
for i in range(n):
li[i] = int(eval(input()))
a = 0
b = 0
for i in li:
if i > a:
b = a
a = i
elif i > b:
b = i
for i in li:
if i == a:
print(b)
else:
print(a)
| 19 | 22 | 261 | 303 | n = int(eval(input()))
li = [0] * n
for i in range(n):
li[i] = int(eval(input()))
a = 0
b = 0
for i in li:
if i > a:
b = a
a = i
elif i > b:
b = i
for i in li:
if i == a:
print(b)
else:
print(a)
| import sys
input = sys.stdin.readline
n = int(eval(input()))
li = [0] * n
for i in range(n):
li[i] = int(eval(input()))
a = 0
b = 0
for i in li:
if i > a:
b = a
a = i
elif i > b:
b = i
for i in li:
if i == a:
print(b)
else:
print(a)
| false | 13.636364 | [
"+import sys",
"+",
"+input = sys.stdin.readline"
] | false | 0.085189 | 0.084101 | 1.012929 | [
"s423885193",
"s514392174"
] |
u734548018 | p03013 | python | s462970920 | s170791069 | 501 | 192 | 46,572 | 8,184 | Accepted | Accepted | 61.68 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
MOD = 1000000007
N,M = list(map(int, input().split()))
dp = [1 for _ in range(N+1)]
for _ in range(M):
dp[int(eval(input()))] = 0
for i in range(2,N+1):
if dp[i] > 0:
dp[i] = (dp[i-1]+dp[i-2]) % MOD
print((dp[-1])) | #!/usr/bin/python3
# -*- coding: utf-8 -*-
from collections import deque
MOD = 1000000007
N,M = list(map(int, input().split()))
An = [int(eval(input())) for _ in range(M)]
dp = [1 for _ in range(N+1)]
for a in An:
dp[a] = 0
for i in range(2,N+1):
if dp[i] > 0:
dp[i] = (dp[i-1]+dp[i-2])... | 16 | 20 | 271 | 328 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
MOD = 1000000007
N, M = list(map(int, input().split()))
dp = [1 for _ in range(N + 1)]
for _ in range(M):
dp[int(eval(input()))] = 0
for i in range(2, N + 1):
if dp[i] > 0:
dp[i] = (dp[i - 1] + dp[i - 2]) % MOD
print((dp[-1]))
| #!/usr/bin/python3
# -*- coding: utf-8 -*-
from collections import deque
MOD = 1000000007
N, M = list(map(int, input().split()))
An = [int(eval(input())) for _ in range(M)]
dp = [1 for _ in range(N + 1)]
for a in An:
dp[a] = 0
for i in range(2, N + 1):
if dp[i] > 0:
dp[i] = (dp[i - 1] + dp[i - 2]) % MO... | false | 20 | [
"+from collections import deque",
"+",
"+An = [int(eval(input())) for _ in range(M)]",
"-for _ in range(M):",
"- dp[int(eval(input()))] = 0",
"+for a in An:",
"+ dp[a] = 0",
"-print((dp[-1]))",
"+print((dp[N]))"
] | false | 0.036414 | 0.034879 | 1.044014 | [
"s462970920",
"s170791069"
] |
u252828980 | p03127 | python | s828550685 | s470492646 | 80 | 64 | 16,240 | 19,936 | Accepted | Accepted | 20 | from fractions import gcd
from functools import reduce
n = int(eval(input()))
li = list(map(int,input().split()))
print((reduce(gcd,li))) | n = int(eval(input()))
L = list(map(int,input().split()))
def gcd(x,y):
if y > x:
x,y = y,x
if x%y == 0:
return y
else:
return gcd(y,x%y)
from functools import reduce
ans = reduce(gcd,L)
print(ans) | 5 | 14 | 133 | 250 | from fractions import gcd
from functools import reduce
n = int(eval(input()))
li = list(map(int, input().split()))
print((reduce(gcd, li)))
| n = int(eval(input()))
L = list(map(int, input().split()))
def gcd(x, y):
if y > x:
x, y = y, x
if x % y == 0:
return y
else:
return gcd(y, x % y)
from functools import reduce
ans = reduce(gcd, L)
print(ans)
| false | 64.285714 | [
"-from fractions import gcd",
"+n = int(eval(input()))",
"+L = list(map(int, input().split()))",
"+",
"+",
"+def gcd(x, y):",
"+ if y > x:",
"+ x, y = y, x",
"+ if x % y == 0:",
"+ return y",
"+ else:",
"+ return gcd(y, x % y)",
"+",
"+",
"-n = int(eval(inpu... | false | 0.053238 | 0.047035 | 1.131882 | [
"s828550685",
"s470492646"
] |
u610385881 | p03436 | python | s057624592 | s796434717 | 314 | 29 | 4,208 | 3,064 | Accepted | Accepted | 90.76 | import queue
INF = 1 << 30
H , W= list(map(int, input().split()))
que = [(0, 0)]
S = [eval(input()) for i in range(H)]
flag = [[INF for i in range(W)] for j in range(H)]
flag[0][0] = 1
cnt = sum(row.count('.') for row in S)
while que:
y, x = que[0]
que.pop(0)
for ny, nx in [1, 0], [-1, 0], [0, 1], [0, -1]... | H , W= list(map(int, input().split()))
que = [(0, 0)]
S = [eval(input()) for i in range(H)]
flag = [[1<<30 for i in range(W)] for j in range(H)]
flag[0][0] = 1
cnt = sum(row.count('.') for row in S)
while que:
y, x = que.pop(0)
for ny, nx in [1, 0], [-1, 0], [0, 1], [0, -1]:
nx += x
ny += y
if ny >= ... | 21 | 18 | 583 | 547 | import queue
INF = 1 << 30
H, W = list(map(int, input().split()))
que = [(0, 0)]
S = [eval(input()) for i in range(H)]
flag = [[INF for i in range(W)] for j in range(H)]
flag[0][0] = 1
cnt = sum(row.count(".") for row in S)
while que:
y, x = que[0]
que.pop(0)
for ny, nx in [1, 0], [-1, 0], [0, 1], [0, -1]:... | H, W = list(map(int, input().split()))
que = [(0, 0)]
S = [eval(input()) for i in range(H)]
flag = [[1 << 30 for i in range(W)] for j in range(H)]
flag[0][0] = 1
cnt = sum(row.count(".") for row in S)
while que:
y, x = que.pop(0)
for ny, nx in [1, 0], [-1, 0], [0, 1], [0, -1]:
nx += x
ny += y
... | false | 14.285714 | [
"-import queue",
"-",
"-INF = 1 << 30",
"-flag = [[INF for i in range(W)] for j in range(H)]",
"+flag = [[1 << 30 for i in range(W)] for j in range(H)]",
"- y, x = que[0]",
"- que.pop(0)",
"+ y, x = que.pop(0)"
] | false | 0.038572 | 0.038187 | 1.010068 | [
"s057624592",
"s796434717"
] |
u380524497 | p03634 | python | s202450677 | s356034083 | 1,998 | 699 | 52,896 | 90,928 | Accepted | Accepted | 65.02 | n = int(eval(input()))
edges = [[] for _ in range(n)]
for _ in range(n-1):
_from, to, dist = list(map(int, input().split()))
edges[_from-1].append([to-1, dist])
edges[to-1].append([_from-1, dist])
q, k = list(map(int, input().split()))
k -= 1
distance_from_k_to = [10**7] * n
distance_from_k_t... | import sys
input = sys.stdin.readline
n = int(eval(input()))
edges = [[] for _ in range(n)]
for _ in range(n-1):
_from, to, dist = list(map(int, input().split()))
edges[_from-1].append([to-1, dist])
edges[to-1].append([_from-1, dist])
q, k = list(map(int, input().split()))
k -= 1
distanc... | 34 | 38 | 860 | 904 | n = int(eval(input()))
edges = [[] for _ in range(n)]
for _ in range(n - 1):
_from, to, dist = list(map(int, input().split()))
edges[_from - 1].append([to - 1, dist])
edges[to - 1].append([_from - 1, dist])
q, k = list(map(int, input().split()))
k -= 1
distance_from_k_to = [10**7] * n
distance_from_k_to[k] ... | import sys
input = sys.stdin.readline
n = int(eval(input()))
edges = [[] for _ in range(n)]
for _ in range(n - 1):
_from, to, dist = list(map(int, input().split()))
edges[_from - 1].append([to - 1, dist])
edges[to - 1].append([_from - 1, dist])
q, k = list(map(int, input().split()))
k -= 1
distance_from_k_... | false | 10.526316 | [
"+import sys",
"+",
"+input = sys.stdin.readline"
] | false | 0.034809 | 0.106067 | 0.328183 | [
"s202450677",
"s356034083"
] |
u017415492 | p03779 | python | s532415853 | s494573903 | 45 | 17 | 2,940 | 3,064 | Accepted | Accepted | 62.22 | x=int(eval(input()))
n=1
while 1/2*(n**2+n)<x:
n+=1
print(n) | x=int(eval(input()))
#n=1
#while 1/2*(n**2+n)<x:
# n+=1
#print(n)
left=0
right=x
while right-left>1:
mid=(left+right)//2
if (mid**2+mid)/2==x:
right=mid
break
if (mid**2+mid)/2<x:
left=mid
else:
right=mid
print(right) | 5 | 18 | 60 | 254 | x = int(eval(input()))
n = 1
while 1 / 2 * (n**2 + n) < x:
n += 1
print(n)
| x = int(eval(input()))
# n=1
# while 1/2*(n**2+n)<x:
# n+=1
# print(n)
left = 0
right = x
while right - left > 1:
mid = (left + right) // 2
if (mid**2 + mid) / 2 == x:
right = mid
break
if (mid**2 + mid) / 2 < x:
left = mid
else:
right = mid
print(right)
| false | 72.222222 | [
"-n = 1",
"-while 1 / 2 * (n**2 + n) < x:",
"- n += 1",
"-print(n)",
"+# n=1",
"+# while 1/2*(n**2+n)<x:",
"+# n+=1",
"+# print(n)",
"+left = 0",
"+right = x",
"+while right - left > 1:",
"+ mid = (left + right) // 2",
"+ if (mid**2 + mid) / 2 == x:",
"+ right = mid",
"+... | false | 0.083731 | 0.080483 | 1.040349 | [
"s532415853",
"s494573903"
] |
u690536347 | p03241 | python | s201207891 | s897430133 | 1,770 | 21 | 2,940 | 3,060 | Accepted | Accepted | 98.81 | def f():
n,m=list(map(int,input().split()))
for i in range(m//n+1)[::-1]:
if m%i==0:return i
print((f())) | N, M = list(map(int, input().split()))
l = []
for i in range(1, int(M**0.5)+1):
if M%i==0:
l.append(M//i)
if M//i != i:
l.append(i)
l.sort(reverse=True)
for i in l:
a = M//i
if a >= N:
print(i)
break | 5 | 15 | 109 | 265 | def f():
n, m = list(map(int, input().split()))
for i in range(m // n + 1)[::-1]:
if m % i == 0:
return i
print((f()))
| N, M = list(map(int, input().split()))
l = []
for i in range(1, int(M**0.5) + 1):
if M % i == 0:
l.append(M // i)
if M // i != i:
l.append(i)
l.sort(reverse=True)
for i in l:
a = M // i
if a >= N:
print(i)
break
| false | 66.666667 | [
"-def f():",
"- n, m = list(map(int, input().split()))",
"- for i in range(m // n + 1)[::-1]:",
"- if m % i == 0:",
"- return i",
"-",
"-",
"-print((f()))",
"+N, M = list(map(int, input().split()))",
"+l = []",
"+for i in range(1, int(M**0.5) + 1):",
"+ if M % i == 0... | false | 0.068714 | 0.049704 | 1.38247 | [
"s201207891",
"s897430133"
] |
u977389981 | p03221 | python | s228758702 | s061633155 | 808 | 671 | 44,236 | 44,484 | Accepted | Accepted | 16.96 | n, m = list(map(int, input().split()))
ipy = []
for i in range(m):
p, y = list(map(int, input().split()))
ipy.append([i, p, y])
ipy.sort(key=lambda x:x[2])
count = {}
order = {}
for i in range(m):
i, p, y = ipy[i]
if not p in count:
count[p] = 0
count[p] += 1
order[i, ... | n, m = list(map(int, input().split()))
ipy = []
for i in range(m):
p, y = list(map(int, input().split()))
ipy.append([i, p, y])
counter = {}
order = {}
for i, p, y in sorted(ipy, key = lambda x: x[2]):
counter[p] = counter.get(p, 0) + 1
order[i, p] = counter[p]
for i, p, y in ipy:
... | 22 | 16 | 432 | 355 | n, m = list(map(int, input().split()))
ipy = []
for i in range(m):
p, y = list(map(int, input().split()))
ipy.append([i, p, y])
ipy.sort(key=lambda x: x[2])
count = {}
order = {}
for i in range(m):
i, p, y = ipy[i]
if not p in count:
count[p] = 0
count[p] += 1
order[i, p] = count[p]
ipy.... | n, m = list(map(int, input().split()))
ipy = []
for i in range(m):
p, y = list(map(int, input().split()))
ipy.append([i, p, y])
counter = {}
order = {}
for i, p, y in sorted(ipy, key=lambda x: x[2]):
counter[p] = counter.get(p, 0) + 1
order[i, p] = counter[p]
for i, p, y in ipy:
print(("{:06}{:06}".... | false | 27.272727 | [
"-ipy.sort(key=lambda x: x[2])",
"-count = {}",
"+counter = {}",
"-for i in range(m):",
"- i, p, y = ipy[i]",
"- if not p in count:",
"- count[p] = 0",
"- count[p] += 1",
"- order[i, p] = count[p]",
"-ipy.sort(key=lambda x: x[0])",
"+for i, p, y in sorted(ipy, key=lambda x: x[... | false | 0.091151 | 0.066376 | 1.373256 | [
"s228758702",
"s061633155"
] |
u390727364 | p02885 | python | s125702138 | s277748205 | 187 | 164 | 38,256 | 38,256 | Accepted | Accepted | 12.3 | from sys import stdin, setrecursionlimit
def main():
input = stdin.buffer.readline
a, b = list(map(int, input().split()))
print((max(0, a - 2 * b)))
if __name__ == "__main__":
setrecursionlimit(10000)
main()
| from sys import stdin, setrecursionlimit
def main():
input = stdin.buffer.readline
a, b = list(map(int, input().split()))
if a - 2 * b >= 0:
print((a - 2 * b))
else:
print((0))
if __name__ == "__main__":
setrecursionlimit(10000)
main()
| 12 | 15 | 235 | 284 | from sys import stdin, setrecursionlimit
def main():
input = stdin.buffer.readline
a, b = list(map(int, input().split()))
print((max(0, a - 2 * b)))
if __name__ == "__main__":
setrecursionlimit(10000)
main()
| from sys import stdin, setrecursionlimit
def main():
input = stdin.buffer.readline
a, b = list(map(int, input().split()))
if a - 2 * b >= 0:
print((a - 2 * b))
else:
print((0))
if __name__ == "__main__":
setrecursionlimit(10000)
main()
| false | 20 | [
"- print((max(0, a - 2 * b)))",
"+ if a - 2 * b >= 0:",
"+ print((a - 2 * b))",
"+ else:",
"+ print((0))"
] | false | 0.044415 | 0.047781 | 0.929562 | [
"s125702138",
"s277748205"
] |
u631277801 | p03160 | python | s678823043 | s178225145 | 182 | 142 | 13,712 | 14,016 | Accepted | Accepted | 21.98 | import sys
stdin = sys.stdin
sys.setrecursionlimit(10**5)
def li(): return list(map(int, stdin.readline().split()))
def li_(): return [int(x)-1 for x in stdin.readline().split()]
def lf(): return list(map(float, stdin.readline().split()))
def ls(): return stdin.readline().split()
def ns(): return stdin.re... | import sys
stdin = sys.stdin
sys.setrecursionlimit(10**5)
def li(): return list(map(int, stdin.readline().split()))
def li_(): return [int(x)-1 for x in stdin.readline().split()]
def lf(): return list(map(float, stdin.readline().split()))
def ls(): return stdin.readline().split()
def ns(): return stdin.re... | 33 | 24 | 878 | 646 | import sys
stdin = sys.stdin
sys.setrecursionlimit(10**5)
def li():
return list(map(int, stdin.readline().split()))
def li_():
return [int(x) - 1 for x in stdin.readline().split()]
def lf():
return list(map(float, stdin.readline().split()))
def ls():
return stdin.readline().split()
def ns():
... | import sys
stdin = sys.stdin
sys.setrecursionlimit(10**5)
def li():
return list(map(int, stdin.readline().split()))
def li_():
return [int(x) - 1 for x in stdin.readline().split()]
def lf():
return list(map(float, stdin.readline().split()))
def ls():
return stdin.readline().split()
def ns():
... | false | 27.272727 | [
"-cost = [float(\"inf\")] * (n)",
"-cost[0] = 0",
"-for i in range(n - 1):",
"- if i == n - 2:",
"- cost[i + 1] = min(cost[i + 1], cost[i] + abs(h[i + 1] - h[i]))",
"- else:",
"- cost[i + 1] = min(cost[i + 1], cost[i] + abs(h[i + 1] - h[i]))",
"- cost[i + 2] = min(cost[i + 2... | false | 0.138352 | 0.077057 | 1.79545 | [
"s678823043",
"s178225145"
] |
u802963389 | p02755 | python | s653546596 | s721175562 | 51 | 32 | 3,064 | 9,176 | Accepted | Accepted | 37.25 | # C - Tax Increase
# https://atcoder.jp/contests/abc158/tasks/abc158_c
a, b = list(map(int, input().split()))
for x in range(1, 100000):
if int(x * 0.08) == a and int(x * 0.1) == b:
print(x)
exit()
print((-1)) | a, b = list(map(int, input().split()))
for i in range(10001):
if int(i * 0.08) == a and int(i * 0.1) == b:
print(i)
exit()
print((-1)) | 11 | 8 | 224 | 149 | # C - Tax Increase
# https://atcoder.jp/contests/abc158/tasks/abc158_c
a, b = list(map(int, input().split()))
for x in range(1, 100000):
if int(x * 0.08) == a and int(x * 0.1) == b:
print(x)
exit()
print((-1))
| a, b = list(map(int, input().split()))
for i in range(10001):
if int(i * 0.08) == a and int(i * 0.1) == b:
print(i)
exit()
print((-1))
| false | 27.272727 | [
"-# C - Tax Increase",
"-# https://atcoder.jp/contests/abc158/tasks/abc158_c",
"-for x in range(1, 100000):",
"- if int(x * 0.08) == a and int(x * 0.1) == b:",
"- print(x)",
"+for i in range(10001):",
"+ if int(i * 0.08) == a and int(i * 0.1) == b:",
"+ print(i)"
] | false | 0.049721 | 0.048778 | 1.019342 | [
"s653546596",
"s721175562"
] |
u367130284 | p03252 | python | s384847917 | s884446365 | 268 | 123 | 59,068 | 23,472 | Accepted | Accepted | 54.1 | import collections as c
s=eval(input())
t=eval(input())
d=c.defaultdict(list)
d2=c.defaultdict(list)
for k,v in enumerate(s):
d[v].append(k)
for k,v in enumerate(t):
d2[v].append(k)
a=set(tuple(i) for i in list(d.values()))
b=set(tuple(i) for i in list(d2.values()))
if a==b:
print("Yes")
else:
... | from collections import*
s=enumerate(eval(input()))
t=enumerate(eval(input()))
d1=defaultdict(list)
d2=defaultdict(list)
for k,v in s:
d1[v].append(k)
for k,v in t:
d2[v].append(k)
print((["No","Yes"][set(tuple(i)for i in list(d1.values()))==set(tuple(i)for i in list(d2.values()))])) | 15 | 10 | 312 | 275 | import collections as c
s = eval(input())
t = eval(input())
d = c.defaultdict(list)
d2 = c.defaultdict(list)
for k, v in enumerate(s):
d[v].append(k)
for k, v in enumerate(t):
d2[v].append(k)
a = set(tuple(i) for i in list(d.values()))
b = set(tuple(i) for i in list(d2.values()))
if a == b:
print("Yes")
el... | from collections import *
s = enumerate(eval(input()))
t = enumerate(eval(input()))
d1 = defaultdict(list)
d2 = defaultdict(list)
for k, v in s:
d1[v].append(k)
for k, v in t:
d2[v].append(k)
print(
(
["No", "Yes"][
set(tuple(i) for i in list(d1.values()))
== set(tuple(i) fo... | false | 33.333333 | [
"-import collections as c",
"+from collections import *",
"-s = eval(input())",
"-t = eval(input())",
"-d = c.defaultdict(list)",
"-d2 = c.defaultdict(list)",
"-for k, v in enumerate(s):",
"- d[v].append(k)",
"-for k, v in enumerate(t):",
"+s = enumerate(eval(input()))",
"+t = enumerate(eval(... | false | 0.037148 | 0.084766 | 0.438247 | [
"s384847917",
"s884446365"
] |
u216015528 | p03436 | python | s841096715 | s523475791 | 38 | 33 | 9,428 | 9,440 | Accepted | Accepted | 13.16 | from collections import deque
def resolve():
H, W = list(map(int, input().split()))
maze = []
cnt = 0
for i in range(H):
maze.append(list(eval(input())))
cnt += maze[-1].count('#')
d = [[float('inf')] * W for _ in range(H)]
dy = [1, 0, -1, 0]
dx = [0, 1, 0... | #!/usr/bin/env python3
def main():
from collections import deque
H, W = list(map(int, input().split()))
S = []
num_path = 0
for _ in range(H):
s = eval(input())
num_path += s.count('.')
S.append(s)
move = ((0, 1), (0, -1), (1, 0), (-1, 0))
distance = [[... | 40 | 37 | 994 | 990 | from collections import deque
def resolve():
H, W = list(map(int, input().split()))
maze = []
cnt = 0
for i in range(H):
maze.append(list(eval(input())))
cnt += maze[-1].count("#")
d = [[float("inf")] * W for _ in range(H)]
dy = [1, 0, -1, 0]
dx = [0, 1, 0, -1]
q = dequ... | #!/usr/bin/env python3
def main():
from collections import deque
H, W = list(map(int, input().split()))
S = []
num_path = 0
for _ in range(H):
s = eval(input())
num_path += s.count(".")
S.append(s)
move = ((0, 1), (0, -1), (1, 0), (-1, 0))
distance = [[1] * W for _ i... | false | 7.5 | [
"-from collections import deque",
"+#!/usr/bin/env python3",
"+def main():",
"+ from collections import deque",
"-",
"-def resolve():",
"- maze = []",
"- cnt = 0",
"- for i in range(H):",
"- maze.append(list(eval(input())))",
"- cnt += maze[-1].count(\"#\")",
"- d ... | false | 0.031392 | 0.037823 | 0.829978 | [
"s841096715",
"s523475791"
] |
u981931040 | p02969 | python | s589942013 | s307006588 | 21 | 17 | 3,316 | 2,940 | Accepted | Accepted | 19.05 | r = int(eval(input()))
print((3 * r ** 2)) | r = int(eval(input()))
print((3 * (r ** 2))) | 2 | 2 | 35 | 37 | r = int(eval(input()))
print((3 * r**2))
| r = int(eval(input()))
print((3 * (r**2)))
| false | 0 | [
"-print((3 * r**2))",
"+print((3 * (r**2)))"
] | false | 0.046931 | 0.045697 | 1.027007 | [
"s589942013",
"s307006588"
] |
u332793228 | p03416 | python | s916350629 | s592873817 | 62 | 57 | 2,940 | 2,940 | Accepted | Accepted | 8.06 | a,b=list(map(int,input().split()))
count=0
for i in range(a,b+1):
if str(i)==str(i)[::-1]:
count+=1
print(count) | a,b=list(map(int,input().split()))
print((sum(i==i[::-1]for i in map(str,list(range(a,b+1)))))) | 6 | 2 | 123 | 82 | a, b = list(map(int, input().split()))
count = 0
for i in range(a, b + 1):
if str(i) == str(i)[::-1]:
count += 1
print(count)
| a, b = list(map(int, input().split()))
print((sum(i == i[::-1] for i in map(str, list(range(a, b + 1))))))
| false | 66.666667 | [
"-count = 0",
"-for i in range(a, b + 1):",
"- if str(i) == str(i)[::-1]:",
"- count += 1",
"-print(count)",
"+print((sum(i == i[::-1] for i in map(str, list(range(a, b + 1))))))"
] | false | 0.066723 | 0.060255 | 1.10735 | [
"s916350629",
"s592873817"
] |
u150984829 | p00042 | python | s125988987 | s716924762 | 340 | 200 | 5,624 | 5,628 | Accepted | Accepted | 41.18 | c=0
for W in iter(input,'0'):
c+=1
W=int(W)
d=[0]*-~W
for _ in[0]*int(eval(input())):
v,w=list(map(int,input().split(',')))
for i in range(W,w-1,-1):
if d[i]<d[i-w]+v:d[i]=d[i-w]+v
print(f'Case {c}:\n{d[W]}\n{d.index(d[W])}')
| def f():
c=0
for W in iter(input,'0'):
c+=1
W=int(W)
d=[0]*-~W
for _ in[0]*int(eval(input())):
v,w=list(map(int,input().split(',')))
for i in range(W,w-1,-1):
if d[i]<d[i-w]+v:d[i]=d[i-w]+v
print(f'Case {c}:\n{d[W]}\n{d.index(d[W])}')
if'__main__'==__name__:f()
| 10 | 12 | 235 | 283 | c = 0
for W in iter(input, "0"):
c += 1
W = int(W)
d = [0] * -~W
for _ in [0] * int(eval(input())):
v, w = list(map(int, input().split(",")))
for i in range(W, w - 1, -1):
if d[i] < d[i - w] + v:
d[i] = d[i - w] + v
print(f"Case {c}:\n{d[W]}\n{d.index(d[W]... | def f():
c = 0
for W in iter(input, "0"):
c += 1
W = int(W)
d = [0] * -~W
for _ in [0] * int(eval(input())):
v, w = list(map(int, input().split(",")))
for i in range(W, w - 1, -1):
if d[i] < d[i - w] + v:
d[i] = d[i - w]... | false | 16.666667 | [
"-c = 0",
"-for W in iter(input, \"0\"):",
"- c += 1",
"- W = int(W)",
"- d = [0] * -~W",
"- for _ in [0] * int(eval(input())):",
"- v, w = list(map(int, input().split(\",\")))",
"- for i in range(W, w - 1, -1):",
"- if d[i] < d[i - w] + v:",
"- ... | false | 0.037919 | 0.037588 | 1.008806 | [
"s125988987",
"s716924762"
] |
u392319141 | p02769 | python | s911530751 | s436984654 | 1,027 | 692 | 53,616 | 30,388 | Accepted | Accepted | 32.62 | class Combination:
def __init__(self, size, mod=10**9 + 7):
self.size = size + 2
self.mod = mod
self.fact = [1, 1] + [0] * size
self.factInv = [1, 1] + [0] * size
self.inv = [0, 1] + [0] * size
for i in range(2, self.size):
self.fact[i] = self.fa... | class Combination:
def __init__(self, size, mod=10**9 + 7):
self.size = size + 2
self.mod = mod
self.fact = [1, 1] + [0] * size
self.factInv = [1, 1] + [0] * size
self.inv = [0, 1] + [0] * size
for i in range(2, self.size):
self.fact[i] = self.fa... | 44 | 42 | 1,241 | 1,217 | class Combination:
def __init__(self, size, mod=10**9 + 7):
self.size = size + 2
self.mod = mod
self.fact = [1, 1] + [0] * size
self.factInv = [1, 1] + [0] * size
self.inv = [0, 1] + [0] * size
for i in range(2, self.size):
self.fact[i] = self.fact[i - 1] ... | class Combination:
def __init__(self, size, mod=10**9 + 7):
self.size = size + 2
self.mod = mod
self.fact = [1, 1] + [0] * size
self.factInv = [1, 1] + [0] * size
self.inv = [0, 1] + [0] * size
for i in range(2, self.size):
self.fact[i] = self.fact[i - 1] ... | false | 4.545455 | [
"- def nhr(self, n, r):",
"+ def nhr(self, n, r): # 重複組合せ",
"+K = min(K, N)",
"-comb = Combination(N * 2)",
"-L = max(1, N - K)",
"+comb = Combination(N + 100)",
"-for l in range(L, N + 1):",
"- zero = N - l",
"- ans += comb.ncr(N, zero) * comb.nhr(N - zero, zero)",
"+for k in range(K... | false | 0.336869 | 0.244995 | 1.375003 | [
"s911530751",
"s436984654"
] |
u777283665 | p03548 | python | s957077538 | s493477061 | 31 | 28 | 2,940 | 2,940 | Accepted | Accepted | 9.68 | x, y, z = list(map(int, input().split()))
n = 1
while True:
if y * n + z * (n+1) <= x:
n += 1
else:
print((n-1))
break | x, y, z = list(map(int, input().split()))
s = z
cnt = 0
while True:
s += y + z
if s > x:
break
cnt += 1
print(cnt)
| 10 | 11 | 153 | 141 | x, y, z = list(map(int, input().split()))
n = 1
while True:
if y * n + z * (n + 1) <= x:
n += 1
else:
print((n - 1))
break
| x, y, z = list(map(int, input().split()))
s = z
cnt = 0
while True:
s += y + z
if s > x:
break
cnt += 1
print(cnt)
| false | 9.090909 | [
"-n = 1",
"+s = z",
"+cnt = 0",
"- if y * n + z * (n + 1) <= x:",
"- n += 1",
"- else:",
"- print((n - 1))",
"+ s += y + z",
"+ if s > x:",
"+ cnt += 1",
"+print(cnt)"
] | false | 0.052875 | 0.051406 | 1.02858 | [
"s957077538",
"s493477061"
] |
u912237403 | p00014 | python | s705205078 | s535469350 | 20 | 10 | 4,216 | 4,188 | Accepted | Accepted | 50 | import sys
for n in map(int,sys.stdin):
s=sum([i*i for i in range(n,600,n)])*n
print(s) | import sys
for n in map(int,sys.stdin):
s=0
for i in range(n,600,n): s+=i*i
print(s*n) | 4 | 5 | 93 | 95 | import sys
for n in map(int, sys.stdin):
s = sum([i * i for i in range(n, 600, n)]) * n
print(s)
| import sys
for n in map(int, sys.stdin):
s = 0
for i in range(n, 600, n):
s += i * i
print(s * n)
| false | 20 | [
"- s = sum([i * i for i in range(n, 600, n)]) * n",
"- print(s)",
"+ s = 0",
"+ for i in range(n, 600, n):",
"+ s += i * i",
"+ print(s * n)"
] | false | 0.114265 | 0.044652 | 2.558998 | [
"s705205078",
"s535469350"
] |
u072053884 | p02343 | python | s905525880 | s461360106 | 13,920 | 11,810 | 12,464 | 8,780 | Accepted | Accepted | 15.16 | import sys
f_i = sys.stdin
n, q = list(map(int, f_i.readline().split()))
S = set(frozenset([i]) for i in range(n))
def unite(sets, v1, v2):
s1 = None
s2 = None
for s in sets:
if v1 in s and v2 in s:
return None
elif v1 in s:
s1 = s
elif... | import sys
f_i = sys.stdin
n, q = list(map(int, f_i.readline().split()))
class DisjointSets:
def __init__(self, size):
self.size = size
self.representatives = list(range(size))
def _find(self, x):
return self.representatives[x]
def union(self, x, y):
x1 ... | 40 | 38 | 798 | 853 | import sys
f_i = sys.stdin
n, q = list(map(int, f_i.readline().split()))
S = set(frozenset([i]) for i in range(n))
def unite(sets, v1, v2):
s1 = None
s2 = None
for s in sets:
if v1 in s and v2 in s:
return None
elif v1 in s:
s1 = s
elif v2 in s:
... | import sys
f_i = sys.stdin
n, q = list(map(int, f_i.readline().split()))
class DisjointSets:
def __init__(self, size):
self.size = size
self.representatives = list(range(size))
def _find(self, x):
return self.representatives[x]
def union(self, x, y):
x1 = self._find(x)
... | false | 5 | [
"-S = set(frozenset([i]) for i in range(n))",
"-def unite(sets, v1, v2):",
"- s1 = None",
"- s2 = None",
"- for s in sets:",
"- if v1 in s and v2 in s:",
"+class DisjointSets:",
"+ def __init__(self, size):",
"+ self.size = size",
"+ self.representatives = list(ran... | false | 0.037525 | 0.055481 | 0.676362 | [
"s905525880",
"s461360106"
] |
u753803401 | p03472 | python | s225451107 | s745626926 | 684 | 318 | 60,380 | 57,308 | Accepted | Accepted | 53.51 | import sys
def solve():
input = sys.stdin.readline
mod = 10 ** 9 + 7
n, h = list(map(int, input().rstrip('\n').split()))
ab = [list(map(int, input().rstrip('\n').split())) for _ in range(n)]
ab.sort(reverse=True)
ma = ab[0][0]
ab.sort(key=lambda x: x[1], reverse=True)
cnt = ... | import sys
import collections
def solve():
input = sys.stdin.readline
mod = 10 ** 9 + 7
n, h = list(map(int, input().rstrip('\n').split()))
al = []
bl = []
for i in range(n):
a, b = list(map(int, input().rstrip('\n').split()))
al.append(a)
bl.append(b)
... | 23 | 36 | 543 | 813 | import sys
def solve():
input = sys.stdin.readline
mod = 10**9 + 7
n, h = list(map(int, input().rstrip("\n").split()))
ab = [list(map(int, input().rstrip("\n").split())) for _ in range(n)]
ab.sort(reverse=True)
ma = ab[0][0]
ab.sort(key=lambda x: x[1], reverse=True)
cnt = 0
for a, ... | import sys
import collections
def solve():
input = sys.stdin.readline
mod = 10**9 + 7
n, h = list(map(int, input().rstrip("\n").split()))
al = []
bl = []
for i in range(n):
a, b = list(map(int, input().rstrip("\n").split()))
al.append(a)
bl.append(b)
al.sort()
b... | false | 36.111111 | [
"+import collections",
"- ab = [list(map(int, input().rstrip(\"\\n\").split())) for _ in range(n)]",
"- ab.sort(reverse=True)",
"- ma = ab[0][0]",
"- ab.sort(key=lambda x: x[1], reverse=True)",
"+ al = []",
"+ bl = []",
"+ for i in range(n):",
"+ a, b = list(map(int, inpu... | false | 0.070101 | 0.03772 | 1.858453 | [
"s225451107",
"s745626926"
] |
u923668099 | p02389 | python | s227626288 | s220408674 | 30 | 20 | 7,612 | 7,616 | Accepted | Accepted | 33.33 | # coding: utf-8
# Here your code !
a,b = list(map(int, input().split()))
print((str(a * b) + " " + str(2 * (a + b)))) | a, b = list(map(int, input().split()))
print((a*b, 2*(a + b))) | 5 | 2 | 120 | 55 | # coding: utf-8
# Here your code !
a, b = list(map(int, input().split()))
print((str(a * b) + " " + str(2 * (a + b))))
| a, b = list(map(int, input().split()))
print((a * b, 2 * (a + b)))
| false | 60 | [
"-# coding: utf-8",
"-# Here your code !",
"-print((str(a * b) + \" \" + str(2 * (a + b))))",
"+print((a * b, 2 * (a + b)))"
] | false | 0.070083 | 0.066952 | 1.046766 | [
"s227626288",
"s220408674"
] |
u002459665 | p03161 | python | s347303637 | s732689526 | 526 | 415 | 52,448 | 54,880 | Accepted | Accepted | 21.1 | N, K = list(map(int, input().split()))
H = list(map(int, input().split()))
INF = 10**5
DP = [INF] * ((10**5)+10)
# DP = [None] * ((10**5)+10)
# DP = [None] * (N+1)
DP[0] = 0
for i in range(1, N):
a = []
for j in range(1, K+1):
if 0 <= i-j < N:
v = DP[i-j] + abs(H[i-j] - H[i]... | N, K = list(map(int, input().split()))
H = list(map(int, input().split()))
INF = 10**6
# DP = [INF] * N
# DP = [INF] * ((10**5)+10)
DP = [float('inf')] * N
DP[0] = 0
# for i in range(1, N):
# for j in range(1, K+1):
# if 0 <= i - j < N:
# DP[i] = min(DP[i], DP[i-j] + abs(H[i-j] -... | 21 | 24 | 399 | 548 | N, K = list(map(int, input().split()))
H = list(map(int, input().split()))
INF = 10**5
DP = [INF] * ((10**5) + 10)
# DP = [None] * ((10**5)+10)
# DP = [None] * (N+1)
DP[0] = 0
for i in range(1, N):
a = []
for j in range(1, K + 1):
if 0 <= i - j < N:
v = DP[i - j] + abs(H[i - j] - H[i])
... | N, K = list(map(int, input().split()))
H = list(map(int, input().split()))
INF = 10**6
# DP = [INF] * N
# DP = [INF] * ((10**5)+10)
DP = [float("inf")] * N
DP[0] = 0
# for i in range(1, N):
# for j in range(1, K+1):
# if 0 <= i - j < N:
# DP[i] = min(DP[i], DP[i-j] + abs(H[i-j] - H[i]))
for i in... | false | 12.5 | [
"-INF = 10**5",
"-DP = [INF] * ((10**5) + 10)",
"-# DP = [None] * ((10**5)+10)",
"-# DP = [None] * (N+1)",
"+INF = 10**6",
"+# DP = [INF] * N",
"+# DP = [INF] * ((10**5)+10)",
"+DP = [float(\"inf\")] * N",
"+# for i in range(1, N):",
"+# for j in range(1, K+1):",
"+# if 0 <= i - j < ... | false | 0.07811 | 0.042482 | 1.838665 | [
"s347303637",
"s732689526"
] |
u692453235 | p03148 | python | s316614132 | s919385790 | 424 | 379 | 34,996 | 35,092 | Accepted | Accepted | 10.61 | from collections import defaultdict
from heapq import heappop, heappush
N, K = list(map(int, input().split()))
TD = []
for _ in range(N):
TD.append(tuple(map(int, input().split())))
TD.sort(key = lambda x:x[1], reverse=True)
TD += [(TD[-1][0], 0)]
D = defaultdict(list)
T = [0]*N
H = []
ans = [0]
... | from collections import defaultdict
from heapq import heappop, heappush
N, K = list(map(int, input().split()))
TD = []
for _ in range(N):
TD.append(tuple(map(int, input().split())))
TD.sort(key = lambda x:x[1], reverse=True)
D = defaultdict(list)
T = [0]*(N+1)
H = []
ans = [0]
for i, td in enumer... | 47 | 42 | 879 | 760 | from collections import defaultdict
from heapq import heappop, heappush
N, K = list(map(int, input().split()))
TD = []
for _ in range(N):
TD.append(tuple(map(int, input().split())))
TD.sort(key=lambda x: x[1], reverse=True)
TD += [(TD[-1][0], 0)]
D = defaultdict(list)
T = [0] * N
H = []
ans = [0]
for i in range(K)... | from collections import defaultdict
from heapq import heappop, heappush
N, K = list(map(int, input().split()))
TD = []
for _ in range(N):
TD.append(tuple(map(int, input().split())))
TD.sort(key=lambda x: x[1], reverse=True)
D = defaultdict(list)
T = [0] * (N + 1)
H = []
ans = [0]
for i, td in enumerate(TD):
t,... | false | 10.638298 | [
"-TD += [(TD[-1][0], 0)]",
"-T = [0] * N",
"+T = [0] * (N + 1)",
"-for i in range(K):",
"- t, d = TD[i]",
"- T[t - 1] += 1",
"+for i, td in enumerate(TD):",
"+ t, d = td[0], td[1]",
"+ if i == K:",
"+ break",
"+ T[t] += 1",
"+ if T[t] >= 2:",
"+ heappush(H, (D... | false | 0.043415 | 0.047708 | 0.910006 | [
"s316614132",
"s919385790"
] |
u881557500 | p02900 | python | s907408737 | s146418167 | 221 | 204 | 5,048 | 5,048 | Accepted | Accepted | 7.69 | import fractions
def factor(x):
t = x
p = [1]
for i in range(2, -int(-x**0.5//1)+1):
if x % i == 0:
p += [i]
while x % i == 0:
x /= i
if x != 1:
p += [x]
if len(p) == 1 and t != 1:
p += [t]
return p
A, B = list(map(int, input().split()))
d = fractions.gcd(A... | import fractions
def factor(x):
t = x
p = [1]
for i in range(2, -int(-x**0.5//1)+1):
if x % i == 0:
p.append(i)
while x % i == 0:
x /= i
if x != 1:
p.append(x)
if len(p) == 1 and t != 1:
p.append(t)
return p
A, B = list(map(int, input().split()))
d = fracti... | 23 | 23 | 434 | 443 | import fractions
def factor(x):
t = x
p = [1]
for i in range(2, -int(-(x**0.5) // 1) + 1):
if x % i == 0:
p += [i]
while x % i == 0:
x /= i
if x != 1:
p += [x]
if len(p) == 1 and t != 1:
p += [t]
return p
A, B = list(map(int, in... | import fractions
def factor(x):
t = x
p = [1]
for i in range(2, -int(-(x**0.5) // 1) + 1):
if x % i == 0:
p.append(i)
while x % i == 0:
x /= i
if x != 1:
p.append(x)
if len(p) == 1 and t != 1:
p.append(t)
return p
A, B = list(ma... | false | 0 | [
"- p += [i]",
"+ p.append(i)",
"- p += [x]",
"+ p.append(x)",
"- p += [t]",
"+ p.append(t)"
] | false | 0.056917 | 0.045895 | 1.240155 | [
"s907408737",
"s146418167"
] |
u168906897 | p03997 | python | s625337704 | s315768234 | 19 | 17 | 2,940 | 2,940 | Accepted | Accepted | 10.53 | a = int(eval(input()))
b = int(eval(input()))
h = int(eval(input()))
print((int((a+b)*h/2))) | a = int(eval(input()))
b = int(eval(input()))
h = int(eval(input()))
s = int((a + b)*h/2)
print(s)
| 4 | 5 | 75 | 85 | a = int(eval(input()))
b = int(eval(input()))
h = int(eval(input()))
print((int((a + b) * h / 2)))
| a = int(eval(input()))
b = int(eval(input()))
h = int(eval(input()))
s = int((a + b) * h / 2)
print(s)
| false | 20 | [
"-print((int((a + b) * h / 2)))",
"+s = int((a + b) * h / 2)",
"+print(s)"
] | false | 0.077194 | 0.063855 | 1.20888 | [
"s625337704",
"s315768234"
] |
u094191970 | p02945 | python | s682802599 | s940048514 | 20 | 17 | 2,940 | 2,940 | Accepted | Accepted | 15 | a,b = list(map(int, input().split()))
print((max(a+b, a-b, a*b))) | a,b=list(map(int,input().split()))
print((max(a+b,max(a-b,a*b)))) | 2 | 2 | 58 | 58 | a, b = list(map(int, input().split()))
print((max(a + b, a - b, a * b)))
| a, b = list(map(int, input().split()))
print((max(a + b, max(a - b, a * b))))
| false | 0 | [
"-print((max(a + b, a - b, a * b)))",
"+print((max(a + b, max(a - b, a * b))))"
] | false | 0.04816 | 0.165362 | 0.291236 | [
"s682802599",
"s940048514"
] |
u392319141 | p03546 | python | s542555634 | s987099151 | 196 | 32 | 40,428 | 3,444 | Accepted | Accepted | 83.67 | H, W = list(map(int, input().split()))
C = [list(map(int, input().split())) for _ in range(10)]
for k in range(10):
for i in range(10):
for j in range(10):
d = C[i][k] + C[k][j]
if C[i][j] > d:
C[i][j] = d
cost = [C[j][1] for j in range(10)]
ans = 0
fo... | H, W = list(map(int, input().split()))
C = [list(map(int, input().split())) for _ in range(10)]
A = [list(map(int, input().split())) for _ in range(H)]
for k in range(10):
for i in range(10):
for j in range(10):
d = C[i][k] + C[k][j]
if C[i][j] > d:
C[i][j] ... | 19 | 20 | 450 | 477 | H, W = list(map(int, input().split()))
C = [list(map(int, input().split())) for _ in range(10)]
for k in range(10):
for i in range(10):
for j in range(10):
d = C[i][k] + C[k][j]
if C[i][j] > d:
C[i][j] = d
cost = [C[j][1] for j in range(10)]
ans = 0
for _ in range(H):... | H, W = list(map(int, input().split()))
C = [list(map(int, input().split())) for _ in range(10)]
A = [list(map(int, input().split())) for _ in range(H)]
for k in range(10):
for i in range(10):
for j in range(10):
d = C[i][k] + C[k][j]
if C[i][j] > d:
C[i][j] = d
cost =... | false | 5 | [
"+A = [list(map(int, input().split())) for _ in range(H)]",
"-cost = [C[j][1] for j in range(10)]",
"+cost = [C[d][1] for d in range(10)]",
"-for _ in range(H):",
"- for n in map(int, input().split()):",
"- if n == -1:",
"+for R in A:",
"+ for a in R:",
"+ if a == -1:",
"- ... | false | 0.08553 | 0.038785 | 2.205233 | [
"s542555634",
"s987099151"
] |
u111365362 | p02630 | python | s686313335 | s649700402 | 496 | 425 | 85,236 | 83,364 | Accepted | Accepted | 14.31 | n = int(eval(input()))
a = list(map(int,input().split()))
b = {}
for x in a:
try:
if b[x] != -1:
b[x] += 1
except:
b[x] = 1
q = int(eval(input()))
ans = sum(a)
for _ in range(q):
x,y = list(map(int,input().split()))
try:
if b[x] != -1:
bx = b[x]
b[x] = 0
except:
... | n = int(eval(input()))
a = list(map(int,input().split()))
b = [0 for _ in range(100001)]
for x in a:
b[x] += 1
ans = sum(a)
q = int(eval(input()))
for _ in range(q):
x,y = list(map(int,input().split()))
ans += (y-x) * b[x]
b[x],b[y] = 0,b[x]+b[y]
print(ans) | 27 | 12 | 438 | 260 | n = int(eval(input()))
a = list(map(int, input().split()))
b = {}
for x in a:
try:
if b[x] != -1:
b[x] += 1
except:
b[x] = 1
q = int(eval(input()))
ans = sum(a)
for _ in range(q):
x, y = list(map(int, input().split()))
try:
if b[x] != -1:
bx = b[x]
... | n = int(eval(input()))
a = list(map(int, input().split()))
b = [0 for _ in range(100001)]
for x in a:
b[x] += 1
ans = sum(a)
q = int(eval(input()))
for _ in range(q):
x, y = list(map(int, input().split()))
ans += (y - x) * b[x]
b[x], b[y] = 0, b[x] + b[y]
print(ans)
| false | 55.555556 | [
"-b = {}",
"+b = [0 for _ in range(100001)]",
"- try:",
"- if b[x] != -1:",
"- b[x] += 1",
"- except:",
"- b[x] = 1",
"+ b[x] += 1",
"+ans = sum(a)",
"-ans = sum(a)",
"- try:",
"- if b[x] != -1:",
"- bx = b[x]",
"- b[x] = 0"... | false | 0.045347 | 0.045314 | 1.000748 | [
"s686313335",
"s649700402"
] |
u101371735 | p02696 | python | s617126226 | s293428858 | 23 | 21 | 9,164 | 9,124 | Accepted | Accepted | 8.7 | """
- floor function
"""
a,b,n=list(map(int,input().split()))
x=min(n,b-1)
print(((a*x)//b-a*(x//b))) | """
- floor function
- xは(0<=x<=B-1 && x<=N)を満たす最大数
"""
a,b,n=list(map(int,input().split()))
x=min(n,b-1)
print(((a*x)//b-a*(x//b))) | 7 | 8 | 100 | 133 | """
- floor function
"""
a, b, n = list(map(int, input().split()))
x = min(n, b - 1)
print(((a * x) // b - a * (x // b)))
| """
- floor function
- xは(0<=x<=B-1 && x<=N)を満たす最大数
"""
a, b, n = list(map(int, input().split()))
x = min(n, b - 1)
print(((a * x) // b - a * (x // b)))
| false | 12.5 | [
"+- xは(0<=x<=B-1 && x<=N)を満たす最大数"
] | false | 0.033094 | 0.031967 | 1.03525 | [
"s617126226",
"s293428858"
] |
u906501980 | p03061 | python | s821764044 | s414826133 | 361 | 294 | 89,580 | 64,620 | Accepted | Accepted | 18.56 | from fractions import gcd
def main():
n = int(eval(input()))
a = list(map(int, input().split()))
ar = a[::-1]
lgcds = [1]*n
rgcds = [1]*n
lgcd, rgcd = a[0], ar[0]
lgcds[0] = rgcd
lgcds[1] = lgcd
rgcds[n-1] = lgcd
rgcds[n-2] = rgcd
for i in range(2, n):
lg... | def main():
n = int(eval(input()))
a = list(map(int, input().split()))
ar = a[::-1]
lgcds = [1]*n
rgcds = [1]*n
lgcd, rgcd = a[0], ar[0]
lgcds[0] = rgcd
lgcds[1] = lgcd
rgcds[n-1] = lgcd
rgcds[n-2] = rgcd
for i in range(2, n):
lgcd = gcd(lgcd, a[i-1])
... | 27 | 31 | 608 | 665 | from fractions import gcd
def main():
n = int(eval(input()))
a = list(map(int, input().split()))
ar = a[::-1]
lgcds = [1] * n
rgcds = [1] * n
lgcd, rgcd = a[0], ar[0]
lgcds[0] = rgcd
lgcds[1] = lgcd
rgcds[n - 1] = lgcd
rgcds[n - 2] = rgcd
for i in range(2, n):
lgcd ... | def main():
n = int(eval(input()))
a = list(map(int, input().split()))
ar = a[::-1]
lgcds = [1] * n
rgcds = [1] * n
lgcd, rgcd = a[0], ar[0]
lgcds[0] = rgcd
lgcds[1] = lgcd
rgcds[n - 1] = lgcd
rgcds[n - 2] = rgcd
for i in range(2, n):
lgcd = gcd(lgcd, a[i - 1])
... | false | 12.903226 | [
"-from fractions import gcd",
"-",
"-",
"+def gcd(x, y):",
"+ r = x % y",
"+ while r:",
"+ x, y, r = y, r, y % r",
"+ return y",
"+",
"+"
] | false | 0.062898 | 0.047555 | 1.322632 | [
"s821764044",
"s414826133"
] |
u189487046 | p03331 | python | s164843442 | s438353414 | 299 | 19 | 3,060 | 2,940 | Accepted | Accepted | 93.65 | n = int(eval(input()))
if n%10==0:
print((10))
exit(0)
ans = pow(10,10)
for a in range(n+1):
b = n-a
tmp_ans = 0
for sa in str(a):
tmp_ans += int(sa)
for sb in str(b):
tmp_ans += int(sb)
ans = min(ans, tmp_ans)
print(ans)
| n = list(map(int, list(eval(input()))))
if n[0] == 1 and sum(n) == 1:
print((10))
else:
print((sum(n)))
| 17 | 6 | 277 | 109 | n = int(eval(input()))
if n % 10 == 0:
print((10))
exit(0)
ans = pow(10, 10)
for a in range(n + 1):
b = n - a
tmp_ans = 0
for sa in str(a):
tmp_ans += int(sa)
for sb in str(b):
tmp_ans += int(sb)
ans = min(ans, tmp_ans)
print(ans)
| n = list(map(int, list(eval(input()))))
if n[0] == 1 and sum(n) == 1:
print((10))
else:
print((sum(n)))
| false | 64.705882 | [
"-n = int(eval(input()))",
"-if n % 10 == 0:",
"+n = list(map(int, list(eval(input()))))",
"+if n[0] == 1 and sum(n) == 1:",
"- exit(0)",
"-ans = pow(10, 10)",
"-for a in range(n + 1):",
"- b = n - a",
"- tmp_ans = 0",
"- for sa in str(a):",
"- tmp_ans += int(sa)",
"- for... | false | 0.13147 | 0.035224 | 3.732395 | [
"s164843442",
"s438353414"
] |
u046158516 | p03645 | python | s083292250 | s342702965 | 892 | 335 | 48,344 | 77,324 | Accepted | Accepted | 62.44 | n,m=list(map(int,input().split()))
a=[0]*n
b=[0]*n
for i in range(m):
c,d=list(map(int,input().split()))
if c==1:
a[d-1]=1
if d==n:
b[c-1]=1
success=0
for i in range(1,n):
if a[i]*b[i]==1:
success=1
if success==1:
print('POSSIBLE')
else:
print('IMPOSSIBLE') | n,m=list(map(int,input().split()))
a=[0]*(n+1)
b=[0]*(n+1)
for i in range(m):
x,y=list(map(int,input().split()))
if x==1:
a[y]=1
if y==n:
b[x]=1
ans=0
for i in range(n+1):
ans+=a[i]*b[i]
if ans==0:
print('IMPOSSIBLE')
else:
print('POSSIBLE') | 17 | 16 | 285 | 264 | n, m = list(map(int, input().split()))
a = [0] * n
b = [0] * n
for i in range(m):
c, d = list(map(int, input().split()))
if c == 1:
a[d - 1] = 1
if d == n:
b[c - 1] = 1
success = 0
for i in range(1, n):
if a[i] * b[i] == 1:
success = 1
if success == 1:
print("POSSIBLE")
else:... | n, m = list(map(int, input().split()))
a = [0] * (n + 1)
b = [0] * (n + 1)
for i in range(m):
x, y = list(map(int, input().split()))
if x == 1:
a[y] = 1
if y == n:
b[x] = 1
ans = 0
for i in range(n + 1):
ans += a[i] * b[i]
if ans == 0:
print("IMPOSSIBLE")
else:
print("POSSIBLE")
| false | 5.882353 | [
"-a = [0] * n",
"-b = [0] * n",
"+a = [0] * (n + 1)",
"+b = [0] * (n + 1)",
"- c, d = list(map(int, input().split()))",
"- if c == 1:",
"- a[d - 1] = 1",
"- if d == n:",
"- b[c - 1] = 1",
"-success = 0",
"-for i in range(1, n):",
"- if a[i] * b[i] == 1:",
"- ... | false | 0.041522 | 0.0973 | 0.426741 | [
"s083292250",
"s342702965"
] |
u905715926 | p02995 | python | s624640530 | s386715353 | 37 | 18 | 5,176 | 3,064 | Accepted | Accepted | 51.35 | from fractions import gcd
def lcm(a,b):
return a*b//gcd(a,b)
a,b,c,d = list(map(int,input().split()))
a-=1
print(((b-a)-(b//c+b//d-a//c-a//d-(b//lcm(c,d))+(a//lcm(c,d)))))
| import sys
import bisect
sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline
def gcd(a,b):
r = a%b;
while r > 0:
a = b
b = r
r = a%b
return b
def lcm(a,b):
return a*b//gcd(a,b)
def main():
a,b,c,d = list(map(int,read().split()))
acnum = (a-1)//c
... | 6 | 26 | 173 | 542 | from fractions import gcd
def lcm(a, b):
return a * b // gcd(a, b)
a, b, c, d = list(map(int, input().split()))
a -= 1
print(
(
(b - a)
- (b // c + b // d - a // c - a // d - (b // lcm(c, d)) + (a // lcm(c, d)))
)
)
| import sys
import bisect
sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline
def gcd(a, b):
r = a % b
while r > 0:
a = b
b = r
r = a % b
return b
def lcm(a, b):
return a * b // gcd(a, b)
def main():
a, b, c, d = list(map(int, read().split()))
acnum = (a - 1) /... | false | 76.923077 | [
"-from fractions import gcd",
"+import sys",
"+import bisect",
"+",
"+sys.setrecursionlimit(1 << 25)",
"+read = sys.stdin.readline",
"+",
"+",
"+def gcd(a, b):",
"+ r = a % b",
"+ while r > 0:",
"+ a = b",
"+ b = r",
"+ r = a % b",
"+ return b",
"-a, b, c,... | false | 0.058018 | 0.122867 | 0.472197 | [
"s624640530",
"s386715353"
] |
u831244171 | p02276 | python | s180997927 | s861897470 | 140 | 110 | 18,408 | 18,196 | Accepted | Accepted | 21.43 | def partition(A,p,r):
x = A[r]
i = p
j = p+1
while i < r:
if A[i] <= x:
i += 1
if i == j:
j += 1
else:
while j <= r:
if A[j] <= x:
if j == r:
temp = A[j]
... | def partition(A,p,r):
x = A[r]
i = p
for j in range(p,r):
if A[j] <= x:
A[j],A[i] = A[i],A[j]
i += 1
A[r],A[i] = A[i],A[r]
return i
n = int(eval(input()))
A = list(map(int,input().split()))
i = partition(A,0,n-1)
A[i] = "[{}]".format(A[i])
print((*A)) | 32 | 15 | 808 | 310 | def partition(A, p, r):
x = A[r]
i = p
j = p + 1
while i < r:
if A[i] <= x:
i += 1
if i == j:
j += 1
else:
while j <= r:
if A[j] <= x:
if j == r:
temp = A[j]
... | def partition(A, p, r):
x = A[r]
i = p
for j in range(p, r):
if A[j] <= x:
A[j], A[i] = A[i], A[j]
i += 1
A[r], A[i] = A[i], A[r]
return i
n = int(eval(input()))
A = list(map(int, input().split()))
i = partition(A, 0, n - 1)
A[i] = "[{}]".format(A[i])
print((*A))
| false | 53.125 | [
"- j = p + 1",
"- while i < r:",
"- if A[i] <= x:",
"+ for j in range(p, r):",
"+ if A[j] <= x:",
"+ A[j], A[i] = A[i], A[j]",
"- if i == j:",
"- j += 1",
"- else:",
"- while j <= r:",
"- if A[j] <= x:",... | false | 0.079918 | 0.036755 | 2.174347 | [
"s180997927",
"s861897470"
] |
u697559326 | p03160 | python | s971596112 | s792125446 | 170 | 130 | 13,928 | 13,716 | Accepted | Accepted | 23.53 | #1:初期化
N = int(eval(input()))
h = list(map(int, input().split()))
inf = float("inf")
dp = [inf]*(N)
#2:初期値
dp[0] = 0
#3:dp実行部
for i in range(1,N):
dp[i] = min(dp[i], dp[i-1] + abs(h[i] - h[i-1]))
if(i>1): #2つ目の足場には二個前の足場がないので.
dp[i] = min(dp[i], dp[i-2] + abs(h[i] - h[i-2]))
#4:出力
pri... | import sys
input = sys.stdin.readline
def main():
#1:初期化
N = int(eval(input()))
h = list(map(int, input().split()))
#h = [int(x) for x in input().split()]
inf = float("inf")
dp = [inf]*(N)
#2:初期値
dp[0] = 0
#3:dp実行部(貰うDP)
for i in range(1,N):
dp[i] = min... | 17 | 32 | 325 | 754 | # 1:初期化
N = int(eval(input()))
h = list(map(int, input().split()))
inf = float("inf")
dp = [inf] * (N)
# 2:初期値
dp[0] = 0
# 3:dp実行部
for i in range(1, N):
dp[i] = min(dp[i], dp[i - 1] + abs(h[i] - h[i - 1]))
if i > 1: # 2つ目の足場には二個前の足場がないので.
dp[i] = min(dp[i], dp[i - 2] + abs(h[i] - h[i - 2]))
# 4:出力
prin... | import sys
input = sys.stdin.readline
def main():
# 1:初期化
N = int(eval(input()))
h = list(map(int, input().split()))
# h = [int(x) for x in input().split()]
inf = float("inf")
dp = [inf] * (N)
# 2:初期値
dp[0] = 0
# 3:dp実行部(貰うDP)
for i in range(1, N):
dp[i] = min(dp[i], d... | false | 46.875 | [
"-# 1:初期化",
"-N = int(eval(input()))",
"-h = list(map(int, input().split()))",
"-inf = float(\"inf\")",
"-dp = [inf] * (N)",
"-# 2:初期値",
"-dp[0] = 0",
"-# 3:dp実行部",
"-for i in range(1, N):",
"- dp[i] = min(dp[i], dp[i - 1] + abs(h[i] - h[i - 1]))",
"- if i > 1: # 2つ目の足場には二個前の足場がないので.",
... | false | 0.043605 | 0.034914 | 1.248913 | [
"s971596112",
"s792125446"
] |
u103724957 | p02707 | python | s181586896 | s784726937 | 146 | 117 | 24,356 | 25,316 | Accepted | Accepted | 19.86 | n = int(eval(input()))
a_list = list(map(int, input().split()))
sub_nums = [0] * n
for a in a_list:
sub_nums[a - 1] += 1
for sub_num in sub_nums:
print(sub_num)
| n = int(eval(input()))
a_list = list(map(int, input().split()))
sub_nums = [0] * n
for a in a_list:
sub_nums[a - 1] += 1
print(("\n".join(map(str, sub_nums))))
# for sub_num in sub_nums:
# print(sub_num)
| 9 | 10 | 167 | 209 | n = int(eval(input()))
a_list = list(map(int, input().split()))
sub_nums = [0] * n
for a in a_list:
sub_nums[a - 1] += 1
for sub_num in sub_nums:
print(sub_num)
| n = int(eval(input()))
a_list = list(map(int, input().split()))
sub_nums = [0] * n
for a in a_list:
sub_nums[a - 1] += 1
print(("\n".join(map(str, sub_nums))))
# for sub_num in sub_nums:
# print(sub_num)
| false | 10 | [
"-for sub_num in sub_nums:",
"- print(sub_num)",
"+print((\"\\n\".join(map(str, sub_nums))))",
"+# for sub_num in sub_nums:",
"+# print(sub_num)"
] | false | 0.049476 | 0.049435 | 1.000817 | [
"s181586896",
"s784726937"
] |
u065099501 | p03495 | python | s372590476 | s932320495 | 176 | 84 | 46,544 | 40,008 | Accepted | Accepted | 52.27 | from collections import Counter
_, K = list(map(int, input().split()))
A = list(map(int, input().split()))
_, cnt = list(zip(*Counter(A).most_common()[::-1]))
print((sum(cnt[:len(cnt) - K]))) | from collections import Counter
_, K = list(map(int, input().split()))
A = sorted(list(Counter(input().split()).values()))
print((sum(A[:len(A)-K]))) | 5 | 4 | 181 | 144 | from collections import Counter
_, K = list(map(int, input().split()))
A = list(map(int, input().split()))
_, cnt = list(zip(*Counter(A).most_common()[::-1]))
print((sum(cnt[: len(cnt) - K])))
| from collections import Counter
_, K = list(map(int, input().split()))
A = sorted(list(Counter(input().split()).values()))
print((sum(A[: len(A) - K])))
| false | 20 | [
"-A = list(map(int, input().split()))",
"-_, cnt = list(zip(*Counter(A).most_common()[::-1]))",
"-print((sum(cnt[: len(cnt) - K])))",
"+A = sorted(list(Counter(input().split()).values()))",
"+print((sum(A[: len(A) - K])))"
] | false | 0.047065 | 0.118134 | 0.398403 | [
"s372590476",
"s932320495"
] |
u840579553 | p02719 | python | s398476297 | s749293671 | 171 | 21 | 38,256 | 3,316 | Accepted | Accepted | 87.72 | """
import random
import functools
import copy
import bisect
import array
import re
import collections
import heapq
import fractions
import itertools
import string
import math
from operator import itemgetter as ig
from bisect import bisect_left, bisect_right, insort_left, insort_right
from itertools impo... | """
import random
import functools
import copy
import bisect
import array
import re
import collections
import heapq
import fractions
import itertools
import string
import math
from operator import itemgetter as ig
from bisect import bisect_left, bisect_right, insort_left, insort_right
from itertools impo... | 49 | 111 | 1,106 | 2,141 | """
import random
import functools
import copy
import bisect
import array
import re
import collections
import heapq
import fractions
import itertools
import string
import math
from operator import itemgetter as ig
from bisect import bisect_left, bisect_right, insort_left, insort_right
from itertools import permutations... | """
import random
import functools
import copy
import bisect
import array
import re
import collections
import heapq
import fractions
import itertools
import string
import math
from operator import itemgetter as ig
from bisect import bisect_left, bisect_right, insort_left, insort_right
from itertools import permutations... | false | 55.855856 | [
"-#import numpy as np",
"+# import numpy as np",
"+from collections import defaultdict",
"+import sys",
"+",
"+sys.setrecursionlimit(10**7)",
"+",
"+",
"+def wi():",
"+ return list(map(int, sys.stdin.readline().split()))",
"+",
"+",
"+# WideIntPoint",
"+def wip():",
"+ return [int(... | false | 0.042994 | 0.033637 | 1.278168 | [
"s398476297",
"s749293671"
] |
u800258529 | p03436 | python | s751551373 | s905163054 | 905 | 47 | 65,500 | 3,952 | Accepted | Accepted | 94.81 | import sys
sys.setrecursionlimit(3000)
h,w=list(map(int,input().split()))
s=['#'*(w+2)]+['#'+eval(input())+'#' for _ in [0]*h]+['#'*(w+2)]
l=[[0]*(w+2) for _ in [0]*(h+2)]
for i in range(h+2):
for j in range(w+2):
if s[i][j]=='#':
l[i][j]=-1
def sol(m,n):
global l
if l[m][n]>=... | import sys
sys.setrecursionlimit(3000)
import queue
h,w=list(map(int,input().split()))
s=['#'*(w+2)]+['#'+eval(input())+'#' for _ in [0]*h]+['#'*(w+2)]
l=[[0]*(w+2) for _ in [0]*(h+2)]
for i in range(h+2):
for j in range(w+2):
if s[i][j]=='#':
l[i][j]=-1
L=queue.Queue()
L.put([1,1])
... | 22 | 21 | 672 | 637 | import sys
sys.setrecursionlimit(3000)
h, w = list(map(int, input().split()))
s = ["#" * (w + 2)] + ["#" + eval(input()) + "#" for _ in [0] * h] + ["#" * (w + 2)]
l = [[0] * (w + 2) for _ in [0] * (h + 2)]
for i in range(h + 2):
for j in range(w + 2):
if s[i][j] == "#":
l[i][j] = -1
def sol(m... | import sys
sys.setrecursionlimit(3000)
import queue
h, w = list(map(int, input().split()))
s = ["#" * (w + 2)] + ["#" + eval(input()) + "#" for _ in [0] * h] + ["#" * (w + 2)]
l = [[0] * (w + 2) for _ in [0] * (h + 2)]
for i in range(h + 2):
for j in range(w + 2):
if s[i][j] == "#":
l[i][j] = ... | false | 4.545455 | [
"+import queue",
"+",
"-",
"-",
"-def sol(m, n):",
"- global l",
"- if l[m][n] >= 0:",
"- for i, j in [(m - 1, n), (m + 1, n), (m, n - 1), (m, n + 1)]:",
"- if l[i][j] == 0 and [i, j] != [1, 1]:",
"- l[i][j] = l[m][n] + 1",
"- sol(i, j)",
"... | false | 0.039167 | 0.038899 | 1.006895 | [
"s751551373",
"s905163054"
] |
u127499732 | p02865 | python | s761472724 | s314673029 | 20 | 17 | 2,940 | 2,940 | Accepted | Accepted | 15 | N = int(eval(input()))
if N%2 == 0:
print((N//2-1))
else:
print(((N-1)//2)) | n=int(eval(input()))
print((int(n/2)-1 if n%2==0 else int((n-1)/2))) | 5 | 2 | 77 | 61 | N = int(eval(input()))
if N % 2 == 0:
print((N // 2 - 1))
else:
print(((N - 1) // 2))
| n = int(eval(input()))
print((int(n / 2) - 1 if n % 2 == 0 else int((n - 1) / 2)))
| false | 60 | [
"-N = int(eval(input()))",
"-if N % 2 == 0:",
"- print((N // 2 - 1))",
"-else:",
"- print(((N - 1) // 2))",
"+n = int(eval(input()))",
"+print((int(n / 2) - 1 if n % 2 == 0 else int((n - 1) / 2)))"
] | false | 0.049519 | 0.046027 | 1.075861 | [
"s761472724",
"s314673029"
] |
u987164499 | p03221 | python | s675887893 | s147777901 | 632 | 357 | 47,664 | 90,052 | Accepted | Accepted | 43.51 | from sys import stdin
import bisect
n,m = [int(x) for x in stdin.readline().rstrip().split()]
li = [list(map(int,stdin.readline().rstrip().split())) for _ in range(m)]
lin = [[]for _ in range(n)]
lin2 = []
for i in range(m):
lin[li[i][0]-1].append(li[i][1])
for j in range(n):
liv = sorted(lin[j... | import bisect
n,m = list(map(int,input().split()))
li = [[] for _ in range(n+1)]
num = []
for _ in range(m):
p,y = list(map(int,input().split()))
li[p].append(y)
num.append((p,y))
for i in range(n+1):
li[i].sort()
for i,j in num:
print((str(i).zfill(6)+str(bisect.bisect_left(li[... | 20 | 17 | 489 | 325 | from sys import stdin
import bisect
n, m = [int(x) for x in stdin.readline().rstrip().split()]
li = [list(map(int, stdin.readline().rstrip().split())) for _ in range(m)]
lin = [[] for _ in range(n)]
lin2 = []
for i in range(m):
lin[li[i][0] - 1].append(li[i][1])
for j in range(n):
liv = sorted(lin[j])
lin2... | import bisect
n, m = list(map(int, input().split()))
li = [[] for _ in range(n + 1)]
num = []
for _ in range(m):
p, y = list(map(int, input().split()))
li[p].append(y)
num.append((p, y))
for i in range(n + 1):
li[i].sort()
for i, j in num:
print((str(i).zfill(6) + str(bisect.bisect_left(li[i], j) +... | false | 15 | [
"-from sys import stdin",
"-n, m = [int(x) for x in stdin.readline().rstrip().split()]",
"-li = [list(map(int, stdin.readline().rstrip().split())) for _ in range(m)]",
"-lin = [[] for _ in range(n)]",
"-lin2 = []",
"-for i in range(m):",
"- lin[li[i][0] - 1].append(li[i][1])",
"-for j in range(n):"... | false | 0.039109 | 0.035745 | 1.09411 | [
"s675887893",
"s147777901"
] |
u994988729 | p03607 | python | s783439829 | s773773377 | 167 | 78 | 19,836 | 16,616 | Accepted | Accepted | 53.29 | from collections import Counter
n=int(eval(input()))
a=[eval(input()) for _ in range(n)]
c=Counter(a)
ans=0
for k,v in list(c.items()):
ans+=v%2
print(ans) | from collections import Counter
import sys
input = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 7)
N = int(eval(input()))
c = Counter([int(eval(input())) for _ in range(N)])
ans = sum(v % 2 for v in list(c.values()))
print(ans) | 9 | 10 | 150 | 229 | from collections import Counter
n = int(eval(input()))
a = [eval(input()) for _ in range(n)]
c = Counter(a)
ans = 0
for k, v in list(c.items()):
ans += v % 2
print(ans)
| from collections import Counter
import sys
input = sys.stdin.buffer.readline
sys.setrecursionlimit(10**7)
N = int(eval(input()))
c = Counter([int(eval(input())) for _ in range(N)])
ans = sum(v % 2 for v in list(c.values()))
print(ans)
| false | 10 | [
"+import sys",
"-n = int(eval(input()))",
"-a = [eval(input()) for _ in range(n)]",
"-c = Counter(a)",
"-ans = 0",
"-for k, v in list(c.items()):",
"- ans += v % 2",
"+input = sys.stdin.buffer.readline",
"+sys.setrecursionlimit(10**7)",
"+N = int(eval(input()))",
"+c = Counter([int(eval(input... | false | 0.035282 | 0.035478 | 0.994465 | [
"s783439829",
"s773773377"
] |
u440180827 | p02412 | python | s865559737 | s837400715 | 560 | 40 | 7,608 | 7,556 | Accepted | Accepted | 92.86 | while True:
n, x = list(map(int, input().split()))
count = 0
if not(n or x):
break
for i in range(1, n-1, 1):
for j in range(i+1, n, 1):
for k in range(j+1, n+1, 1):
if i + j + k == x:
count += 1
print(count) | while True:
n, x = list(map(int, input().split()))
count = 0
if not(n or x):
break
for i in range(1, n-1, 1):
for j in range(i+1, n, 1):
k = x - i -j
if k > j and k <= n:
count += 1
print(count) | 11 | 11 | 296 | 274 | while True:
n, x = list(map(int, input().split()))
count = 0
if not (n or x):
break
for i in range(1, n - 1, 1):
for j in range(i + 1, n, 1):
for k in range(j + 1, n + 1, 1):
if i + j + k == x:
count += 1
print(count)
| while True:
n, x = list(map(int, input().split()))
count = 0
if not (n or x):
break
for i in range(1, n - 1, 1):
for j in range(i + 1, n, 1):
k = x - i - j
if k > j and k <= n:
count += 1
print(count)
| false | 0 | [
"- for k in range(j + 1, n + 1, 1):",
"- if i + j + k == x:",
"- count += 1",
"+ k = x - i - j",
"+ if k > j and k <= n:",
"+ count += 1"
] | false | 0.037677 | 0.036096 | 1.043813 | [
"s865559737",
"s837400715"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.