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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
u279266699 | p02848 | python | s788654831 | s453637821 | 37 | 30 | 9,140 | 9,000 | Accepted | Accepted | 18.92 | n = int(eval(input()))
S = eval(input())
ans = ''
for s in S:
if ord(s) + n <= 90:
ans += chr(ord(s) + n)
else:
ans += chr(65 + ord(s) + n - 90 - 1)
print(ans)
| n = int(eval(input()))
S = eval(input())
a = ord('A')
z = ord('Z')
ans = ''
for s in S:
if ord(s) + n <= 90:
ans += chr(ord(s) + n)
else:
ans += chr(a + ord(s) + n - z - 1)
print(ans)
| 9 | 11 | 180 | 206 | n = int(eval(input()))
S = eval(input())
ans = ""
for s in S:
if ord(s) + n <= 90:
ans += chr(ord(s) + n)
else:
ans += chr(65 + ord(s) + n - 90 - 1)
print(ans)
| n = int(eval(input()))
S = eval(input())
a = ord("A")
z = ord("Z")
ans = ""
for s in S:
if ord(s) + n <= 90:
ans += chr(ord(s) + n)
else:
ans += chr(a + ord(s) + n - z - 1)
print(ans)
| false | 18.181818 | [
"+a = ord(\"A\")",
"+z = ord(\"Z\")",
"- ans += chr(65 + ord(s) + n - 90 - 1)",
"+ ans += chr(a + ord(s) + n - z - 1)"
] | false | 0.048633 | 0.037836 | 1.285359 | [
"s788654831",
"s453637821"
] |
u391875425 | p03548 | python | s762636968 | s630153660 | 19 | 17 | 2,940 | 2,940 | Accepted | Accepted | 10.53 | X, Y, Z = list(map(int, input().split()))
ans = X//(Y+Z)
if X - ans*(Y+Z) < Z:
print((ans-1))
else:
print(ans) | X, Y, Z = list(map(int, input().split()))
print(((X-Z)//(Y+Z))) | 6 | 2 | 116 | 57 | X, Y, Z = list(map(int, input().split()))
ans = X // (Y + Z)
if X - ans * (Y + Z) < Z:
print((ans - 1))
else:
print(ans)
| X, Y, Z = list(map(int, input().split()))
print(((X - Z) // (Y + Z)))
| false | 66.666667 | [
"-ans = X // (Y + Z)",
"-if X - ans * (Y + Z) < Z:",
"- print((ans - 1))",
"-else:",
"- print(ans)",
"+print(((X - Z) // (Y + Z)))"
] | false | 0.038488 | 0.037323 | 1.031219 | [
"s762636968",
"s630153660"
] |
u879266613 | p02899 | python | s654626297 | s562891448 | 124 | 106 | 19,704 | 13,880 | Accepted | Accepted | 14.52 | N = int(eval(input()))
list = list(map(int,input().split()))
dic={}
ans=""
for i in range(N):
dic[list[i]]=i+1
for i in range(1, N+1):
ans += " " + str(dic[i])
print(ans)
| N = int(eval(input()))
A = list(map(int,input().split()))
ans = [0]*N
for i, a in enumerate(A):
ans[a-1] = i + 1
print((*ans)) | 13 | 7 | 197 | 129 | N = int(eval(input()))
list = list(map(int, input().split()))
dic = {}
ans = ""
for i in range(N):
dic[list[i]] = i + 1
for i in range(1, N + 1):
ans += " " + str(dic[i])
print(ans)
| N = int(eval(input()))
A = list(map(int, input().split()))
ans = [0] * N
for i, a in enumerate(A):
ans[a - 1] = i + 1
print((*ans))
| false | 46.153846 | [
"-list = list(map(int, input().split()))",
"-dic = {}",
"-ans = \"\"",
"-for i in range(N):",
"- dic[list[i]] = i + 1",
"-for i in range(1, N + 1):",
"- ans += \" \" + str(dic[i])",
"-print(ans)",
"+A = list(map(int, input().split()))",
"+ans = [0] * N",
"+for i, a in enumerate(A):",
"+ ... | false | 0.035698 | 0.035598 | 1.002803 | [
"s654626297",
"s562891448"
] |
u282228874 | p03039 | python | s074588947 | s309492092 | 176 | 82 | 11,252 | 10,868 | Accepted | Accepted | 53.41 | MOD = 10**9+7
N,M,K = list(map(int,input().split()))
U = N*M
fact = [1]*(U+1)
for i in range(1,U+1):
fact[i] = (fact[i-1]*i)%MOD
def comb(n,k):
x = fact[n]
x *= pow(fact[n-k],MOD-2,MOD)
x %= MOD
x *= pow(fact[k],MOD-2,MOD)
return x
res = 0
for i in range(1,N):
res += i*... | mod = 10**9 + 7
n,m,k = list(map(int,input().split()))
nm = n*m
f = [1]*(nm+1)
for i in range(1,nm+1):
f[i] = (f[i-1]*i)%mod
def C(n,k):
x = f[n]
x *= pow(f[n-k],mod-2,mod)
x %= mod
x *= pow(f[k],mod-2,mod)
x %= mod
return x
def F(n):
x = n*n*(n+1)//2
y = n*(n+1)*(2*n+... | 28 | 20 | 461 | 427 | MOD = 10**9 + 7
N, M, K = list(map(int, input().split()))
U = N * M
fact = [1] * (U + 1)
for i in range(1, U + 1):
fact[i] = (fact[i - 1] * i) % MOD
def comb(n, k):
x = fact[n]
x *= pow(fact[n - k], MOD - 2, MOD)
x %= MOD
x *= pow(fact[k], MOD - 2, MOD)
return x
res = 0
for i in range(1, N):... | mod = 10**9 + 7
n, m, k = list(map(int, input().split()))
nm = n * m
f = [1] * (nm + 1)
for i in range(1, nm + 1):
f[i] = (f[i - 1] * i) % mod
def C(n, k):
x = f[n]
x *= pow(f[n - k], mod - 2, mod)
x %= mod
x *= pow(f[k], mod - 2, mod)
x %= mod
return x
def F(n):
x = n * n * (n + 1) ... | false | 28.571429 | [
"-MOD = 10**9 + 7",
"-N, M, K = list(map(int, input().split()))",
"-U = N * M",
"-fact = [1] * (U + 1)",
"-for i in range(1, U + 1):",
"- fact[i] = (fact[i - 1] * i) % MOD",
"+mod = 10**9 + 7",
"+n, m, k = list(map(int, input().split()))",
"+nm = n * m",
"+f = [1] * (nm + 1)",
"+for i in rang... | false | 0.083136 | 0.084166 | 0.987766 | [
"s074588947",
"s309492092"
] |
u606045429 | p02874 | python | s606904670 | s371738990 | 334 | 300 | 26,504 | 25,564 | Accepted | Accepted | 10.18 | N, *LR = list(map(int, open(0).read().split()))
L, R = LR[::2], LR[1::2]
max_l = max(L)
min_r = min(R)
ab = [(max(0, r - max_l + 1), -max(0, min_r - l + 1)) for l, r in zip(L, R)]
ab.sort()
mi = float("inf")
ma = max(r - l + 1 for l, r in zip(L, R)) + max(0, min_r - max_l + 1)
for i in range(N - 1):
... | N, *LR = list(map(int, open(0).read().split()))
L, R = LR[::2], LR[1::2]
max_l = max(L)
min_r = min(R)
A = sorted(max(0, r - max_l + 1) for r in R)
B = sorted(-max(0, min_r - l + 1) for l in L)
mi = float("inf")
ma = max(r - l + 1 for l, r in zip(L, R)) + max(0, min_r - max_l + 1)
for i in range(N - 1):... | 17 | 17 | 390 | 385 | N, *LR = list(map(int, open(0).read().split()))
L, R = LR[::2], LR[1::2]
max_l = max(L)
min_r = min(R)
ab = [(max(0, r - max_l + 1), -max(0, min_r - l + 1)) for l, r in zip(L, R)]
ab.sort()
mi = float("inf")
ma = max(r - l + 1 for l, r in zip(L, R)) + max(0, min_r - max_l + 1)
for i in range(N - 1):
mi = min(mi, -a... | N, *LR = list(map(int, open(0).read().split()))
L, R = LR[::2], LR[1::2]
max_l = max(L)
min_r = min(R)
A = sorted(max(0, r - max_l + 1) for r in R)
B = sorted(-max(0, min_r - l + 1) for l in L)
mi = float("inf")
ma = max(r - l + 1 for l, r in zip(L, R)) + max(0, min_r - max_l + 1)
for i in range(N - 1):
mi = min(mi... | false | 0 | [
"-ab = [(max(0, r - max_l + 1), -max(0, min_r - l + 1)) for l, r in zip(L, R)]",
"-ab.sort()",
"+A = sorted(max(0, r - max_l + 1) for r in R)",
"+B = sorted(-max(0, min_r - l + 1) for l in L)",
"- mi = min(mi, -ab[i][1])",
"- ma = max(ma, mi + ab[i + 1][0])",
"+ mi = min(mi, -B[i])",
"+ ma... | false | 0.046997 | 0.037879 | 1.240724 | [
"s606904670",
"s371738990"
] |
u279605379 | p02297 | python | s213895056 | s711744209 | 30 | 20 | 7,712 | 7,728 | Accepted | Accepted | 33.33 | n = int(eval(input()))
P =[]
s = 0
for i in range(n):P.append([int(i) for i in input().split()])
P.append(P[0])
for i in range(n):s += (P[i][0])*P[i+1][1] - (P[i][1])*P[i+1][0]
print((abs(s)*0.5)) | n = int(eval(input()))
P =[]
s = 0
for i in range(n):P.append([int(i) for i in input().split()])
P.append(P[0])
for i in range(n):s += P[i][0]*P[i+1][1] - P[i][1]*P[i+1][0]
print((s*0.5)) | 7 | 7 | 194 | 185 | n = int(eval(input()))
P = []
s = 0
for i in range(n):
P.append([int(i) for i in input().split()])
P.append(P[0])
for i in range(n):
s += (P[i][0]) * P[i + 1][1] - (P[i][1]) * P[i + 1][0]
print((abs(s) * 0.5))
| n = int(eval(input()))
P = []
s = 0
for i in range(n):
P.append([int(i) for i in input().split()])
P.append(P[0])
for i in range(n):
s += P[i][0] * P[i + 1][1] - P[i][1] * P[i + 1][0]
print((s * 0.5))
| false | 0 | [
"- s += (P[i][0]) * P[i + 1][1] - (P[i][1]) * P[i + 1][0]",
"-print((abs(s) * 0.5))",
"+ s += P[i][0] * P[i + 1][1] - P[i][1] * P[i + 1][0]",
"+print((s * 0.5))"
] | false | 0.073165 | 0.035778 | 2.044956 | [
"s213895056",
"s711744209"
] |
u135389999 | p02624 | python | s608093573 | s439008068 | 2,516 | 2,116 | 9,176 | 9,168 | Accepted | Accepted | 15.9 | n = int(eval(input()))
ans = 0
for i in range(1, n + 1):
if i == 1:
ans += sum(range(1,n + 1))
else:
t = n//i
ans += 0.5 * i * t * ( t + 1)
print((int(ans))) | n = int(eval(input()))
ans = 0
for i in range(1, n + 1):
t = n//i
ans += 0.5 * i * t * ( t + 1)
print((int(ans))) | 12 | 9 | 195 | 124 | n = int(eval(input()))
ans = 0
for i in range(1, n + 1):
if i == 1:
ans += sum(range(1, n + 1))
else:
t = n // i
ans += 0.5 * i * t * (t + 1)
print((int(ans)))
| n = int(eval(input()))
ans = 0
for i in range(1, n + 1):
t = n // i
ans += 0.5 * i * t * (t + 1)
print((int(ans)))
| false | 25 | [
"- if i == 1:",
"- ans += sum(range(1, n + 1))",
"- else:",
"- t = n // i",
"- ans += 0.5 * i * t * (t + 1)",
"+ t = n // i",
"+ ans += 0.5 * i * t * (t + 1)"
] | false | 0.80822 | 0.6671 | 1.211543 | [
"s608093573",
"s439008068"
] |
u102461423 | p02750 | python | s303038998 | s947420738 | 1,411 | 516 | 91,920 | 90,152 | Accepted | Accepted | 63.43 | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
from functools import cmp_to_key
import itertools
N, T = list(map(int, readline().split()))
m = list(map(int, read().split()))
AB0 = []
AB1 = []
for a,b in zip(m,m):
if a == 0:
... | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
from functools import cmp_to_key
import itertools
N, T = list(map(int, readline().split()))
m = list(map(int, read().split()))
AB0 = []
AB1 = []
for a,b in zip(m,m):
if a == 0:
... | 58 | 58 | 1,161 | 1,182 | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
from functools import cmp_to_key
import itertools
N, T = list(map(int, readline().split()))
m = list(map(int, read().split()))
AB0 = []
AB1 = []
for a, b in zip(m, m):
if a == 0:
AB0.append(... | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
from functools import cmp_to_key
import itertools
N, T = list(map(int, readline().split()))
m = list(map(int, read().split()))
AB0 = []
AB1 = []
for a, b in zip(m, m):
if a == 0:
AB0.append(... | false | 0 | [
"-AB1.sort(key=cmp_to_key(sort_func))",
"+AB1.sort(key=lambda x: x[0] / (x[1] + 1), reverse=True)"
] | false | 0.037771 | 0.045197 | 0.835709 | [
"s303038998",
"s947420738"
] |
u279493135 | p02787 | python | s249531458 | s950579200 | 1,222 | 540 | 318,428 | 70,488 | Accepted | Accepted | 55.81 | import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_upp... | import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_upp... | 36 | 34 | 1,046 | 970 | import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase... | import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase... | false | 5.555556 | [
"-dp = [[INF] * (H + max(A) + 1) for _ in range(N + 1)]",
"-dp[0][0] = 0",
"+max_A = max(A)",
"+dp = [INF] * (H + max_A + 1)",
"+dp[0] = 0",
"- for j in range(H + max(A) + 1):",
"- if j - A[i] >= 0:",
"- dp[i + 1][j] = min(dp[i][j], dp[i + 1][j - A[i]] + B[i])",
"- else:"... | false | 0.125687 | 0.067488 | 1.862366 | [
"s249531458",
"s950579200"
] |
u223133214 | p03286 | python | s036024655 | s214902631 | 19 | 17 | 2,940 | 2,940 | Accepted | Accepted | 10.53 | N = int(eval(input()))
ans = []
num = 0
while True:
if N % (2**(num + 1)) == 0:
b = 0
else:
b = 1
ans.append(str(b))
N = N - ((-2)**num) * b
num += 1
if N == 0:
break
print((''.join(ans[::-1])))
| N = int(eval(input()))
a = ''
n = 0
while N != 0:
b = '0' if N % (2**(n + 1)) == 0 else '1'
a += b
N -= ((-2)**n) * int(b)
n += 1
print((a[::-1] if a else 0))
| 15 | 9 | 250 | 175 | N = int(eval(input()))
ans = []
num = 0
while True:
if N % (2 ** (num + 1)) == 0:
b = 0
else:
b = 1
ans.append(str(b))
N = N - ((-2) ** num) * b
num += 1
if N == 0:
break
print(("".join(ans[::-1])))
| N = int(eval(input()))
a = ""
n = 0
while N != 0:
b = "0" if N % (2 ** (n + 1)) == 0 else "1"
a += b
N -= ((-2) ** n) * int(b)
n += 1
print((a[::-1] if a else 0))
| false | 40 | [
"-ans = []",
"-num = 0",
"-while True:",
"- if N % (2 ** (num + 1)) == 0:",
"- b = 0",
"- else:",
"- b = 1",
"- ans.append(str(b))",
"- N = N - ((-2) ** num) * b",
"- num += 1",
"- if N == 0:",
"- break",
"-print((\"\".join(ans[::-1])))",
"+a = \"\"",... | false | 0.063226 | 0.043879 | 1.44093 | [
"s036024655",
"s214902631"
] |
u543954314 | p02854 | python | s449043349 | s481265071 | 210 | 181 | 26,056 | 26,024 | Accepted | Accepted | 13.81 | n = int(eval(input()))
a = list(map(int,input().split()))
for i in range(1,n):
a[i] += a[i-1]
c = a[-1]
for i in range(n):
c = min(c, abs(a[-1]-a[i]*2))
print(c) | n = int(eval(input()))
a = list(map(int,input().split()))
for i in range(1,n):
a[i] += a[i-1]
c = a[-1]
for i in range(n):
p = abs(a[-1]-a[i]*2)
if c > p:
c = p
print(c) | 10 | 10 | 175 | 195 | n = int(eval(input()))
a = list(map(int, input().split()))
for i in range(1, n):
a[i] += a[i - 1]
c = a[-1]
for i in range(n):
c = min(c, abs(a[-1] - a[i] * 2))
print(c)
| n = int(eval(input()))
a = list(map(int, input().split()))
for i in range(1, n):
a[i] += a[i - 1]
c = a[-1]
for i in range(n):
p = abs(a[-1] - a[i] * 2)
if c > p:
c = p
print(c)
| false | 0 | [
"- c = min(c, abs(a[-1] - a[i] * 2))",
"+ p = abs(a[-1] - a[i] * 2)",
"+ if c > p:",
"+ c = p"
] | false | 0.040899 | 0.068247 | 0.59928 | [
"s449043349",
"s481265071"
] |
u785578220 | p03038 | python | s842589147 | s064519819 | 738 | 571 | 24,520 | 26,732 | Accepted | Accepted | 22.63 | import heapq
N,M=list(map(int,input().split()))
A = list(map(int,input().split()))
heapq.heapify(A)
l = []
for i in range(M):
tmp = list(map(int,input().split()))
l.append([tmp[1],tmp[0]])
l.sort(reverse=True)
for i,j in l:
for I in range(j):
Q = heapq.heappop(A)
if Q<i :
heapq.hea... | N,M=list(map(int,input().split()))
A = list(map(int,input().split()))
l = []
for i in range(M):
tmp = list(map(int,input().split()))
l.append([tmp[1],tmp[0]])
l.sort(reverse=True)
for i,j in l:
A.extend([i]*j)
if len(A)>2*N:break
A.sort(reverse=True)
print((sum(A[:N]))) | 21 | 12 | 402 | 286 | import heapq
N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
heapq.heapify(A)
l = []
for i in range(M):
tmp = list(map(int, input().split()))
l.append([tmp[1], tmp[0]])
l.sort(reverse=True)
for i, j in l:
for I in range(j):
Q = heapq.heappop(A)
if Q < i:
... | N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
l = []
for i in range(M):
tmp = list(map(int, input().split()))
l.append([tmp[1], tmp[0]])
l.sort(reverse=True)
for i, j in l:
A.extend([i] * j)
if len(A) > 2 * N:
break
A.sort(reverse=True)
print((sum(A[:N])))
| false | 42.857143 | [
"-import heapq",
"-",
"-heapq.heapify(A)",
"- for I in range(j):",
"- Q = heapq.heappop(A)",
"- if Q < i:",
"- heapq.heappush(A, i)",
"- else:",
"- heapq.heappush(A, Q)",
"- break",
"-# print(A)",
"-print((sum(A)))",
"+ A.extend([i]... | false | 0.040814 | 0.037094 | 1.100276 | [
"s842589147",
"s064519819"
] |
u941407962 | p02626 | python | s901192495 | s251921715 | 75 | 64 | 67,000 | 61,960 | Accepted | Accepted | 14.67 | from functools import lru_cache
N, = list(map(int, input().split()))
X = list(map(int, input().split()))
t = 0
for x in X:
t = t^x
inf = float('inf')
@lru_cache(None)
def it(x, y, z):
xm, ym, zm = x%2, y%2, z%2
if xm ^ ym != zm:
return inf
if x^y == z:
return 0
Rz = 2*i... | import sys
N, = list(map(int, input().split()))
X = list(map(int, input().split()))
S = X[0]+X[1]
T = 0
for i in range(2, N):
T ^= X[i]
if S<T or (S-T)%2:
print((-1))
sys.exit()
D = (S-T)//2
if D&T:
print((-1))
sys.exit()
M = T.bit_length()+1
if D > X[0]:
print((-1))
sys.exi... | 26 | 26 | 533 | 473 | from functools import lru_cache
(N,) = list(map(int, input().split()))
X = list(map(int, input().split()))
t = 0
for x in X:
t = t ^ x
inf = float("inf")
@lru_cache(None)
def it(x, y, z):
xm, ym, zm = x % 2, y % 2, z % 2
if xm ^ ym != zm:
return inf
if x ^ y == z:
return 0
Rz = 2 ... | import sys
(N,) = list(map(int, input().split()))
X = list(map(int, input().split()))
S = X[0] + X[1]
T = 0
for i in range(2, N):
T ^= X[i]
if S < T or (S - T) % 2:
print((-1))
sys.exit()
D = (S - T) // 2
if D & T:
print((-1))
sys.exit()
M = T.bit_length() + 1
if D > X[0]:
print((-1))
sys.e... | false | 0 | [
"-from functools import lru_cache",
"+import sys",
"-t = 0",
"-for x in X:",
"- t = t ^ x",
"-inf = float(\"inf\")",
"-",
"-",
"-@lru_cache(None)",
"-def it(x, y, z):",
"- xm, ym, zm = x % 2, y % 2, z % 2",
"- if xm ^ ym != zm:",
"- return inf",
"- if x ^ y == z:",
"- ... | false | 0.049265 | 0.046923 | 1.049905 | [
"s901192495",
"s251921715"
] |
u664610890 | p03013 | python | s259262701 | s707644890 | 492 | 186 | 51,180 | 7,832 | Accepted | Accepted | 62.2 | N, M = list(map(int, input().split()))
a = []
stair = [1 for i in range(N+1)]
for i in range(M):
stair[int(eval(input()))] = 0
dp = [0 for i in range(N+2)]
dp[1] = 1
MOD = 1000000007
for i in range(2, N+2):
if stair[i-1] == 1:
dp[i] = (dp[i-1] + dp[i-2]) % MOD
print((dp[N+1]))
| N, M = list(map(int, input().split()))
a = []
stair = [1 for i in range(N+2)]
for i in range(M):
stair[int(eval(input()))] = 0
dp = [0 for i in range(N+2)]
dp[0] = 1
MOD = 1000000007
for i in range(1, N+1):
if stair[i] == 1:
if i == 1:
dp[i] = dp[i - 1] % MOD
else:
... | 17 | 19 | 301 | 383 | N, M = list(map(int, input().split()))
a = []
stair = [1 for i in range(N + 1)]
for i in range(M):
stair[int(eval(input()))] = 0
dp = [0 for i in range(N + 2)]
dp[1] = 1
MOD = 1000000007
for i in range(2, N + 2):
if stair[i - 1] == 1:
dp[i] = (dp[i - 1] + dp[i - 2]) % MOD
print((dp[N + 1]))
| N, M = list(map(int, input().split()))
a = []
stair = [1 for i in range(N + 2)]
for i in range(M):
stair[int(eval(input()))] = 0
dp = [0 for i in range(N + 2)]
dp[0] = 1
MOD = 1000000007
for i in range(1, N + 1):
if stair[i] == 1:
if i == 1:
dp[i] = dp[i - 1] % MOD
else:
... | false | 10.526316 | [
"-stair = [1 for i in range(N + 1)]",
"+stair = [1 for i in range(N + 2)]",
"-dp[1] = 1",
"+dp[0] = 1",
"-for i in range(2, N + 2):",
"- if stair[i - 1] == 1:",
"- dp[i] = (dp[i - 1] + dp[i - 2]) % MOD",
"-print((dp[N + 1]))",
"+for i in range(1, N + 1):",
"+ if stair[i] == 1:",
"+ ... | false | 0.054001 | 0.036103 | 1.495755 | [
"s259262701",
"s707644890"
] |
u729133443 | p03221 | python | s951516936 | s813517543 | 1,282 | 941 | 92,960 | 49,684 | Accepted | Accepted | 26.6 | I=lambda:list(map(int,input().split()))
n,m=I()
l=[[]for _ in range(n+1)]
for i in range(m):
p,y=I()
l[p].append([y,i])
a=[]
for p in range(1,n+1):
l[p].sort()
for i,t in enumerate(l[p]):
a.append([t[1],'%06d'%p+'%06d'%-~i])
a.sort()
for t in a:
print((t[1])) | I=lambda:list(map(int,input().split()));n,m=I();l=[[]for _ in[0]*-~n];a=[]
for i in range(m):p,y=I();l[p].append([y,i])
for p in range(1,n+1):
for i,t in enumerate(sorted(l[p])):a.append([t[1],'%06d'%p+'%06d'%-~i])
for t in sorted(a):print((t[1])) | 14 | 5 | 278 | 244 | I = lambda: list(map(int, input().split()))
n, m = I()
l = [[] for _ in range(n + 1)]
for i in range(m):
p, y = I()
l[p].append([y, i])
a = []
for p in range(1, n + 1):
l[p].sort()
for i, t in enumerate(l[p]):
a.append([t[1], "%06d" % p + "%06d" % -~i])
a.sort()
for t in a:
print((t[1]))
| I = lambda: list(map(int, input().split()))
n, m = I()
l = [[] for _ in [0] * -~n]
a = []
for i in range(m):
p, y = I()
l[p].append([y, i])
for p in range(1, n + 1):
for i, t in enumerate(sorted(l[p])):
a.append([t[1], "%06d" % p + "%06d" % -~i])
for t in sorted(a):
print((t[1]))
| false | 64.285714 | [
"-l = [[] for _ in range(n + 1)]",
"+l = [[] for _ in [0] * -~n]",
"+a = []",
"-a = []",
"- l[p].sort()",
"- for i, t in enumerate(l[p]):",
"+ for i, t in enumerate(sorted(l[p])):",
"-a.sort()",
"-for t in a:",
"+for t in sorted(a):"
] | false | 0.04287 | 0.098106 | 0.436972 | [
"s951516936",
"s813517543"
] |
u845573105 | p02580 | python | s923438333 | s440267536 | 1,283 | 710 | 272,488 | 213,784 | Accepted | Accepted | 44.66 | H, W, M = list(map(int, input().split()))
countH = [[h, 0] for h in range(H)]
countW = [[w, 0] for w in range(W)]
Bh = {}
for i in range(M):
h, w = list(map(int, input().split()))
h, w = h-1, w-1
if h in Bh:
Bh[h].add(w)
else:
Bh[h] = {w}
countH[h][1] += 1
countW[w][1] += 1
countH.s... | H, W, M = list(map(int, input().split()))
countH = [0 for h in range(H)]
countW = [0 for w in range(W)]
Bh = {}
for i in range(M):
h, w = list(map(int, input().split()))
h, w = h-1, w-1
if h in Bh:
Bh[h].add(w)
else:
Bh[h] = {w}
countH[h] += 1
countW[w] += 1
maxh = 0
ch = []
maxw ... | 45 | 47 | 866 | 790 | H, W, M = list(map(int, input().split()))
countH = [[h, 0] for h in range(H)]
countW = [[w, 0] for w in range(W)]
Bh = {}
for i in range(M):
h, w = list(map(int, input().split()))
h, w = h - 1, w - 1
if h in Bh:
Bh[h].add(w)
else:
Bh[h] = {w}
countH[h][1] += 1
countW[w][1] += 1
c... | H, W, M = list(map(int, input().split()))
countH = [0 for h in range(H)]
countW = [0 for w in range(W)]
Bh = {}
for i in range(M):
h, w = list(map(int, input().split()))
h, w = h - 1, w - 1
if h in Bh:
Bh[h].add(w)
else:
Bh[h] = {w}
countH[h] += 1
countW[w] += 1
maxh = 0
ch = []
... | false | 4.255319 | [
"-countH = [[h, 0] for h in range(H)]",
"-countW = [[w, 0] for w in range(W)]",
"+countH = [0 for h in range(H)]",
"+countW = [0 for w in range(W)]",
"- countH[h][1] += 1",
"- countW[w][1] += 1",
"-countH.sort(reverse=True, key=lambda x: x[1])",
"-countW.sort(reverse=True, key=lambda x: x[1])",
... | false | 0.058385 | 0.052528 | 1.1115 | [
"s923438333",
"s440267536"
] |
u638456847 | p03476 | python | s711331630 | s210178984 | 1,059 | 181 | 18,248 | 25,588 | Accepted | Accepted | 82.91 | import math
import numpy as np
n = 10**5 + 1
p = [False] * n
c = [0] * n
def main():
# 2からnまでの数字をsearch_listに入れる
search_list = list(range(2,n))
while True:
# search_listの先頭の値が√nの値を超えたら処理終了
if search_list[0] > math.sqrt(n):
# search_listの残りの素数フラグを立てる
fo... | from math import ceil, sqrt
from itertools import accumulate
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
def eratosthenes(n):
p = [] # n以下の素数リスト
t = [-1] * n # t_iの素因数の内最小のもの
t[0] = 0
t[1] = 0
for i in range(2, ceil(sqrt(n))... | 42 | 45 | 1,025 | 980 | import math
import numpy as np
n = 10**5 + 1
p = [False] * n
c = [0] * n
def main():
# 2からnまでの数字をsearch_listに入れる
search_list = list(range(2, n))
while True:
# search_listの先頭の値が√nの値を超えたら処理終了
if search_list[0] > math.sqrt(n):
# search_listの残りの素数フラグを立てる
for num in sea... | from math import ceil, sqrt
from itertools import accumulate
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
def eratosthenes(n):
p = [] # n以下の素数リスト
t = [-1] * n # t_iの素因数の内最小のもの
t[0] = 0
t[1] = 0
for i in range(2, ceil(sqrt(n))):
if t[i] =... | false | 6.666667 | [
"-import math",
"-import numpy as np",
"+from math import ceil, sqrt",
"+from itertools import accumulate",
"+import sys",
"-n = 10**5 + 1",
"-p = [False] * n",
"-c = [0] * n",
"+read = sys.stdin.read",
"+readline = sys.stdin.readline",
"+readlines = sys.stdin.readlines",
"+",
"+",
"+def e... | false | 0.19483 | 0.107268 | 1.816286 | [
"s711331630",
"s210178984"
] |
u309120194 | p02910 | python | s655544468 | s567028514 | 29 | 25 | 9,052 | 8,928 | Accepted | Accepted | 13.79 | S = eval(input())
N = len(S)
# 1,3,...文字目が'R'でも'U'でも'D'でもない、または、2,4,...文字目が'L'でも'U'でも'D'でもないとき、'No'を出力する
ans = 'Yes'
for i in range(N):
if (i % 2 == 0 and S[i] != 'R' and S[i] != 'U' and S[i] != 'D') or (i % 2 == 1 and S[i] != 'L' and S[i] != 'U' and S[i] != 'D'):
ans = 'No'
break
print(ans) | S = eval(input())
# Sの各文字は'L', 'R', 'U', 'D'のいずれかであることに注意する
# 1,3,...文字目が'L'でなく、偶数文字目が'R'でないとき 'Yes'とする
N = len(S)
ans = 'Yes'
for i in range(N):
if (i % 2 == 0 and S[i] == 'L') or (i % 2 == 1 and S[i] == 'R'):
ans = 'No'
break
print(ans) | 11 | 12 | 312 | 260 | S = eval(input())
N = len(S)
# 1,3,...文字目が'R'でも'U'でも'D'でもない、または、2,4,...文字目が'L'でも'U'でも'D'でもないとき、'No'を出力する
ans = "Yes"
for i in range(N):
if (i % 2 == 0 and S[i] != "R" and S[i] != "U" and S[i] != "D") or (
i % 2 == 1 and S[i] != "L" and S[i] != "U" and S[i] != "D"
):
ans = "No"
break
prin... | S = eval(input())
# Sの各文字は'L', 'R', 'U', 'D'のいずれかであることに注意する
# 1,3,...文字目が'L'でなく、偶数文字目が'R'でないとき 'Yes'とする
N = len(S)
ans = "Yes"
for i in range(N):
if (i % 2 == 0 and S[i] == "L") or (i % 2 == 1 and S[i] == "R"):
ans = "No"
break
print(ans)
| false | 8.333333 | [
"+# Sの各文字は'L', 'R', 'U', 'D'のいずれかであることに注意する",
"+# 1,3,...文字目が'L'でなく、偶数文字目が'R'でないとき 'Yes'とする",
"-# 1,3,...文字目が'R'でも'U'でも'D'でもない、または、2,4,...文字目が'L'でも'U'でも'D'でもないとき、'No'を出力する",
"- if (i % 2 == 0 and S[i] != \"R\" and S[i] != \"U\" and S[i] != \"D\") or (",
"- i % 2 == 1 and S[i] != \"L\" and S[i] != ... | false | 0.100577 | 0.060709 | 1.656704 | [
"s655544468",
"s567028514"
] |
u537782349 | p03605 | python | s133589539 | s150146200 | 20 | 17 | 3,060 | 2,940 | Accepted | Accepted | 15 | a = eval(input())
for i in range(len(a)):
if a[i] == "9":
print("Yes")
exit()
print("No")
| a = eval(input())
print(("Yes" if a[0] == "9" or a[1] == "9" else "No"))
| 6 | 2 | 109 | 66 | a = eval(input())
for i in range(len(a)):
if a[i] == "9":
print("Yes")
exit()
print("No")
| a = eval(input())
print(("Yes" if a[0] == "9" or a[1] == "9" else "No"))
| false | 66.666667 | [
"-for i in range(len(a)):",
"- if a[i] == \"9\":",
"- print(\"Yes\")",
"- exit()",
"-print(\"No\")",
"+print((\"Yes\" if a[0] == \"9\" or a[1] == \"9\" else \"No\"))"
] | false | 0.042543 | 0.042802 | 0.99395 | [
"s133589539",
"s150146200"
] |
u340781749 | p02873 | python | s307959038 | s879285695 | 384 | 189 | 75,564 | 8,328 | Accepted | Accepted | 50.78 | s = eval(input())
n = len(s) + 1
ans = [0] * n
tmp = 1
ens = list(enumerate(s))
for i, c in ens:
if c == '<':
ans[i + 1] = tmp
tmp += 1
else:
tmp = 1
tmp = 1
for i, c in reversed(ens):
if c == '>':
ans[i] = max(ans[i], tmp)
tmp += 1
else:
... | import itertools
s = eval(input())
rlc = [len(list(itr)) for _, itr in itertools.groupby(s)]
for i in range(s[0] == '>', len(rlc) - 1, 2):
if rlc[i] < rlc[i + 1]:
rlc[i] -= 1
else:
rlc[i + 1] -= 1
print((sum(l * (l + 1) // 2 for l in rlc)))
| 21 | 11 | 343 | 269 | s = eval(input())
n = len(s) + 1
ans = [0] * n
tmp = 1
ens = list(enumerate(s))
for i, c in ens:
if c == "<":
ans[i + 1] = tmp
tmp += 1
else:
tmp = 1
tmp = 1
for i, c in reversed(ens):
if c == ">":
ans[i] = max(ans[i], tmp)
tmp += 1
else:
tmp = 1
print((su... | import itertools
s = eval(input())
rlc = [len(list(itr)) for _, itr in itertools.groupby(s)]
for i in range(s[0] == ">", len(rlc) - 1, 2):
if rlc[i] < rlc[i + 1]:
rlc[i] -= 1
else:
rlc[i + 1] -= 1
print((sum(l * (l + 1) // 2 for l in rlc)))
| false | 47.619048 | [
"+import itertools",
"+",
"-n = len(s) + 1",
"-ans = [0] * n",
"-tmp = 1",
"-ens = list(enumerate(s))",
"-for i, c in ens:",
"- if c == \"<\":",
"- ans[i + 1] = tmp",
"- tmp += 1",
"+rlc = [len(list(itr)) for _, itr in itertools.groupby(s)]",
"+for i in range(s[0] == \">\", le... | false | 0.06084 | 0.042989 | 1.415225 | [
"s307959038",
"s879285695"
] |
u075836834 | p00586 | python | s398108285 | s899842666 | 30 | 20 | 7,536 | 7,656 | Accepted | Accepted | 33.33 | import sys
for line in sys.stdin.readlines():
data=line.split()
print((int(data[0])+int(data[1])))
#print(eval(data[0]+"+"+data[1])) | while True:
try:
x,y=list(map(int,input().split()))
print((x+y))
except EOFError:
break | 5 | 6 | 137 | 92 | import sys
for line in sys.stdin.readlines():
data = line.split()
print((int(data[0]) + int(data[1])))
# print(eval(data[0]+"+"+data[1]))
| while True:
try:
x, y = list(map(int, input().split()))
print((x + y))
except EOFError:
break
| false | 16.666667 | [
"-import sys",
"-",
"-for line in sys.stdin.readlines():",
"- data = line.split()",
"- print((int(data[0]) + int(data[1])))",
"- # print(eval(data[0]+\"+\"+data[1]))",
"+while True:",
"+ try:",
"+ x, y = list(map(int, input().split()))",
"+ print((x + y))",
"+ except... | false | 0.040615 | 0.04074 | 0.996943 | [
"s398108285",
"s899842666"
] |
u754022296 | p02559 | python | s434317285 | s322490239 | 634 | 572 | 126,908 | 125,836 | Accepted | Accepted | 9.78 | class BIT():
__slots__ = ["n", "data"]
def __init__(self, li):
self.n = len(li) + 1
self.data = [0] + li
for i in range(1, self.n):
if i + (i & -i) < self.n:
self.data[i + (i & -i)] += self.data[i]
def add(self, i, a):
i += 1
... | class BIT():
__slots__ = ["n", "data"]
def __init__(self, li):
self.n = len(li) + 1
self.data = [0] + li
for i in range(1, self.n):
if i + (i & -i) < self.n:
self.data[i + (i & -i)] += self.data[i]
def add(self, i, a):
i += 1
... | 38 | 45 | 896 | 1,051 | class BIT:
__slots__ = ["n", "data"]
def __init__(self, li):
self.n = len(li) + 1
self.data = [0] + li
for i in range(1, self.n):
if i + (i & -i) < self.n:
self.data[i + (i & -i)] += self.data[i]
def add(self, i, a):
i += 1
while i < self... | class BIT:
__slots__ = ["n", "data"]
def __init__(self, li):
self.n = len(li) + 1
self.data = [0] + li
for i in range(1, self.n):
if i + (i & -i) < self.n:
self.data[i + (i & -i)] += self.data[i]
def add(self, i, a):
i += 1
while i < self... | false | 15.555556 | [
"- return self.acc(r) - self.acc(l)",
"+ res = 0",
"+ while l < r:",
"+ res += self.data[r]",
"+ r -= r & -r",
"+ while r < l:",
"+ res -= self.data[l]",
"+ l -= l & -l",
"+ return res"
] | false | 0.044216 | 0.044858 | 0.98568 | [
"s434317285",
"s322490239"
] |
u098223184 | p03331 | python | s351989141 | s653706960 | 133 | 117 | 9,176 | 9,092 | Accepted | Accepted | 12.03 | n=int(eval(input()))
ans=10e5
for a in range(1,n//2+1):
b=n-a
ans=min(ans,sum([int(i) for i in str(a)])+sum([int(i) for i in str(b)]))
print((int(ans)))
| n=int(eval(input()))
ans=10e5
for a in range(1,n//2+1):
b=n-a
ans=min(ans,sum(map(int,str(a)))+sum(map(int,str(b))))
print((int(ans)))
| 6 | 6 | 158 | 140 | n = int(eval(input()))
ans = 10e5
for a in range(1, n // 2 + 1):
b = n - a
ans = min(ans, sum([int(i) for i in str(a)]) + sum([int(i) for i in str(b)]))
print((int(ans)))
| n = int(eval(input()))
ans = 10e5
for a in range(1, n // 2 + 1):
b = n - a
ans = min(ans, sum(map(int, str(a))) + sum(map(int, str(b))))
print((int(ans)))
| false | 0 | [
"- ans = min(ans, sum([int(i) for i in str(a)]) + sum([int(i) for i in str(b)]))",
"+ ans = min(ans, sum(map(int, str(a))) + sum(map(int, str(b))))"
] | false | 0.09691 | 0.073463 | 1.319163 | [
"s351989141",
"s653706960"
] |
u157020659 | p02665 | python | s401557754 | s017870593 | 122 | 110 | 22,376 | 22,244 | Accepted | Accepted | 9.84 | n = int(eval(input()))
a = list(map(int, input().split()))
a_min = [0] * (n + 1)
a_min[n] = a[n]
for i in range(n - 1, -1, -1):
a_min[i] = a[i] + a_min[i + 1]
b = [1]
for i in range(n):
tmp = b[i] - a[i]
b.append(min(tmp * 2, a_min[i + 1]))
if tmp < 1 or tmp * 2 < a[i + 1]:
print((-... | n = int(eval(input()))
a = list(map(int, input().split()))
a_min = [0] * (n + 1)
a_min[n] = a[n]
for i in range(n - 1, -1, -1):
a_min[i] = a[i] + a_min[i + 1]
b = [1]
for i in range(n):
tmp = b[i] - a[i]
b.append(min(tmp * 2, a_min[i + 1]))
if tmp < 1:
print((-1))
break
el... | 20 | 19 | 446 | 391 | n = int(eval(input()))
a = list(map(int, input().split()))
a_min = [0] * (n + 1)
a_min[n] = a[n]
for i in range(n - 1, -1, -1):
a_min[i] = a[i] + a_min[i + 1]
b = [1]
for i in range(n):
tmp = b[i] - a[i]
b.append(min(tmp * 2, a_min[i + 1]))
if tmp < 1 or tmp * 2 < a[i + 1]:
print((-1))
b... | n = int(eval(input()))
a = list(map(int, input().split()))
a_min = [0] * (n + 1)
a_min[n] = a[n]
for i in range(n - 1, -1, -1):
a_min[i] = a[i] + a_min[i + 1]
b = [1]
for i in range(n):
tmp = b[i] - a[i]
b.append(min(tmp * 2, a_min[i + 1]))
if tmp < 1:
print((-1))
break
else:
if b[n]... | false | 5 | [
"- if tmp < 1 or tmp * 2 < a[i + 1]:",
"+ if tmp < 1:",
"- if n == 0:",
"- ans = 1 if a[0] == 1 else -1",
"- print(ans)",
"+ if b[n] != a[n]:",
"+ print((-1))"
] | false | 0.038692 | 0.03871 | 0.999546 | [
"s401557754",
"s017870593"
] |
u759412327 | p02946 | python | s406253567 | s267888375 | 30 | 25 | 9,140 | 9,092 | Accepted | Accepted | 16.67 | K,X = list(map(int,input().split()))
print((*[n for n in range(1+X-K,X+K)])) | K,X = list(map(int,input().split()))
print((*list(range(1+X-K,X+K)))) | 2 | 2 | 69 | 56 | K, X = list(map(int, input().split()))
print((*[n for n in range(1 + X - K, X + K)]))
| K, X = list(map(int, input().split()))
print((*list(range(1 + X - K, X + K))))
| false | 0 | [
"-print((*[n for n in range(1 + X - K, X + K)]))",
"+print((*list(range(1 + X - K, X + K))))"
] | false | 0.039185 | 0.039564 | 0.99042 | [
"s406253567",
"s267888375"
] |
u002459665 | p02743 | python | s026806072 | s268368992 | 34 | 17 | 5,076 | 2,940 | Accepted | Accepted | 50 | a, b, c = list(map(int, input().split()))
# from math import sqrt
import decimal
a2 = decimal.Decimal(a)
b2 = decimal.Decimal(b)
c2 = decimal.Decimal(c)
a2 = a2.sqrt()
b2 = b2.sqrt()
c2 = c2.sqrt()
# if sqrt(a) + sqrt(b) < sqrt(c):
# print('Yes')
# else:
# print('No')
if a2 + b2 < c2:
... | a, b, c = list(map(int, input().split()))
if c - a - b > 0 and 4 * a * b < (c - a - b) ** 2:
print('Yes')
else:
print('No') | 23 | 6 | 360 | 137 | a, b, c = list(map(int, input().split()))
# from math import sqrt
import decimal
a2 = decimal.Decimal(a)
b2 = decimal.Decimal(b)
c2 = decimal.Decimal(c)
a2 = a2.sqrt()
b2 = b2.sqrt()
c2 = c2.sqrt()
# if sqrt(a) + sqrt(b) < sqrt(c):
# print('Yes')
# else:
# print('No')
if a2 + b2 < c2:
print("Yes")
else:
... | a, b, c = list(map(int, input().split()))
if c - a - b > 0 and 4 * a * b < (c - a - b) ** 2:
print("Yes")
else:
print("No")
| false | 73.913043 | [
"-# from math import sqrt",
"-import decimal",
"-",
"-a2 = decimal.Decimal(a)",
"-b2 = decimal.Decimal(b)",
"-c2 = decimal.Decimal(c)",
"-a2 = a2.sqrt()",
"-b2 = b2.sqrt()",
"-c2 = c2.sqrt()",
"-# if sqrt(a) + sqrt(b) < sqrt(c):",
"-# print('Yes')",
"-# else:",
"-# print('No')",
"-... | false | 0.041416 | 0.070668 | 0.586068 | [
"s026806072",
"s268368992"
] |
u938812966 | p03546 | python | s688292569 | s362164287 | 38 | 30 | 3,064 | 3,064 | Accepted | Accepted | 21.05 | 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):
c[i][j] = min(c[i][j], c[i][k] + c[k][j])
ans = 0
for _ in range(H):
for x in input().split():
x = int(x)
if x != -1:
ans += c[x][1]
print(an... | 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):
c[i][j] = min(c[i][j], c[i][k] + c[k][j])
ans = 0
for _ in range(H):
ans += sum([c[x][1] for x in map(int,input().split()) if x != -1])
print(ans)
| 15 | 13 | 317 | 312 | 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):
c[i][j] = min(c[i][j], c[i][k] + c[k][j])
ans = 0
for _ in range(H):
for x in input().split():
x = int(x)
if x != -1:
... | 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):
c[i][j] = min(c[i][j], c[i][k] + c[k][j])
ans = 0
for _ in range(H):
ans += sum([c[x][1] for x in map(int, input().split()) if x != -1])... | false | 13.333333 | [
"- for x in input().split():",
"- x = int(x)",
"- if x != -1:",
"- ans += c[x][1]",
"+ ans += sum([c[x][1] for x in map(int, input().split()) if x != -1])"
] | false | 0.044436 | 0.043429 | 1.023182 | [
"s688292569",
"s362164287"
] |
u073852194 | p03682 | python | s679151380 | s504031130 | 1,892 | 1,370 | 127,512 | 125,648 | Accepted | Accepted | 27.59 | import sys
input = sys.stdin.readline
class UnionFind():
def __init__(self, n):
self.n = n
self.parents = [-1] * n
def find(self, x):
if self.parents[x] < 0:
return x
else:
self.parents[x] = self.find(self.parents[x])
return self.p... | class Graph(): #non-directed
def __init__(self, n, edge, indexed=1):
self.n = n
self.edge = edge
self.indexed = indexed
self.graph = [[] for _ in range(n)]
for e in edge:
self.graph[e[0] - indexed].append((e[1] - indexed, e[2]))
self.graph[e[1... | 52 | 84 | 1,257 | 2,562 | import sys
input = sys.stdin.readline
class UnionFind:
def __init__(self, n):
self.n = n
self.parents = [-1] * n
def find(self, x):
if self.parents[x] < 0:
return x
else:
self.parents[x] = self.find(self.parents[x])
return self.parents[x]
... | class Graph: # non-directed
def __init__(self, n, edge, indexed=1):
self.n = n
self.edge = edge
self.indexed = indexed
self.graph = [[] for _ in range(n)]
for e in edge:
self.graph[e[0] - indexed].append((e[1] - indexed, e[2]))
self.graph[e[1] - index... | false | 38.095238 | [
"-import sys",
"+class Graph: # non-directed",
"+ def __init__(self, n, edge, indexed=1):",
"+ self.n = n",
"+ self.edge = edge",
"+ self.indexed = indexed",
"+ self.graph = [[] for _ in range(n)]",
"+ for e in edge:",
"+ self.graph[e[0] - indexed].a... | false | 0.042333 | 0.040706 | 1.039986 | [
"s679151380",
"s504031130"
] |
u918601425 | p02623 | python | s131609820 | s698452031 | 1,518 | 292 | 61,228 | 48,940 | Accepted | Accepted | 80.76 | N,M,K=[int(s) for s in input().split()]
A=[int(s) for s in input().split()]
B=[int(s) for s in input().split()]
Asum=[0 for i in range(N+1)]
Bsum=[0 for i in range(M+1)]
for i in range(N):
Asum[i+1]=Asum[i]+A[i]
for i in range(M):
Bsum[i+1]=Bsum[i]+B[i]
def nibu(x):
time=set()
for i in range(0,N+1)... | import bisect
N,M,K=[int(s) for s in input().split()]
A=[int(s) for s in input().split()]
B=[int(s) for s in input().split()]
Asum=[0 for i in range(N+1)]
Bsum=[0 for i in range(M+1)]
for i in range(N):
Asum[i+1]=Asum[i]+A[i]
for i in range(M):
Bsum[i+1]=Bsum[i]+B[i]
ans=[0 for i in range(N+1)]
t=bisect.... | 35 | 22 | 672 | 480 | N, M, K = [int(s) for s in input().split()]
A = [int(s) for s in input().split()]
B = [int(s) for s in input().split()]
Asum = [0 for i in range(N + 1)]
Bsum = [0 for i in range(M + 1)]
for i in range(N):
Asum[i + 1] = Asum[i] + A[i]
for i in range(M):
Bsum[i + 1] = Bsum[i] + B[i]
def nibu(x):
time = set(... | import bisect
N, M, K = [int(s) for s in input().split()]
A = [int(s) for s in input().split()]
B = [int(s) for s in input().split()]
Asum = [0 for i in range(N + 1)]
Bsum = [0 for i in range(M + 1)]
for i in range(N):
Asum[i + 1] = Asum[i] + A[i]
for i in range(M):
Bsum[i + 1] = Bsum[i] + B[i]
ans = [0 for i ... | false | 37.142857 | [
"+import bisect",
"+",
"-",
"-",
"-def nibu(x):",
"- time = set()",
"- for i in range(0, N + 1):",
"- if i > x:",
"- break",
"- if x - i > M:",
"- continue",
"- time.add(Asum[i] + Bsum[x - i])",
"- if min(time) <= K:",
"- return Tr... | false | 0.040163 | 0.034373 | 1.168424 | [
"s131609820",
"s698452031"
] |
u191874006 | p02846 | python | s539847176 | s873341212 | 171 | 71 | 38,384 | 65,776 | Accepted | Accepted | 58.48 | #!/usr/bin/env python3
import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from... | #!/usr/bin/env python3
import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from... | 41 | 49 | 923 | 1,252 | #!/usr/bin/env python3
import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop, heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collectio... | #!/usr/bin/env python3
import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop, heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collectio... | false | 16.326531 | [
"-x, y = a1 * t1, b1 * t1",
"-z, w = a1 * t1 + a2 * t2, b1 * t1 + b2 * t2",
"-if (x > y and z > w) or (y > x and w > z):",
"- print((0))",
"- quit()",
"-if z == w:",
"+a = a1 * t1 + a2 * t2",
"+b = b1 * t1 + b2 * t2",
"+if a == b:",
"- quit()",
"-if x < y:",
"- x, y = y, x",
"-if... | false | 0.036168 | 0.0352 | 1.027521 | [
"s539847176",
"s873341212"
] |
u747602774 | p02755 | python | s958184511 | s175081230 | 49 | 20 | 3,060 | 3,064 | Accepted | Accepted | 59.18 | A,B = list(map(int,input().split()))
for i in range(100000):
if int(i*0.08) == A and int(i*0.1) == B:
break
print((i if i != 99999 else -1))
| A,B = list(map(int,input().split()))
for i in range(10000):
if int(i*0.08) == A and int(i*0.1) == B:
print(i)
exit()
print((-1))
| 6 | 6 | 151 | 146 | A, B = list(map(int, input().split()))
for i in range(100000):
if int(i * 0.08) == A and int(i * 0.1) == B:
break
print((i if i != 99999 else -1))
| A, B = list(map(int, input().split()))
for i in range(10000):
if int(i * 0.08) == A and int(i * 0.1) == B:
print(i)
exit()
print((-1))
| false | 0 | [
"-for i in range(100000):",
"+for i in range(10000):",
"- break",
"-print((i if i != 99999 else -1))",
"+ print(i)",
"+ exit()",
"+print((-1))"
] | false | 0.047879 | 0.03509 | 1.364466 | [
"s958184511",
"s175081230"
] |
u968166680 | p03732 | python | s950814035 | s805797081 | 219 | 74 | 74,500 | 74,032 | Accepted | Accepted | 66.21 | import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007
def solve1(N, W, weight, value):
dp = [[0] * (W + 1) for _ in range(N + 1)]
for i in range(N):
for w in range(W + 1):
... | import sys
from itertools import accumulate
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007
def main():
N, W, *wv = list(map(int, read().split()))
w0 = wv[0]
weight = [[] for _ in range(4)]
... | 61 | 45 | 1,634 | 940 | import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10**9)
INF = 1 << 60
MOD = 1000000007
def solve1(N, W, weight, value):
dp = [[0] * (W + 1) for _ in range(N + 1)]
for i in range(N):
for w in range(W + 1):
if w - weight[i]... | import sys
from itertools import accumulate
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10**9)
INF = 1 << 60
MOD = 1000000007
def main():
N, W, *wv = list(map(int, read().split()))
w0 = wv[0]
weight = [[] for _ in range(4)]
for w, v in zip... | false | 26.229508 | [
"+from itertools import accumulate",
"-def solve1(N, W, weight, value):",
"- dp = [[0] * (W + 1) for _ in range(N + 1)]",
"- for i in range(N):",
"- for w in range(W + 1):",
"- if w - weight[i] >= 0:",
"- dp[i + 1][w] = dp[i][w - weight[i]] + value[i]",
"- ... | false | 0.03868 | 0.038225 | 1.011894 | [
"s950814035",
"s805797081"
] |
u297574184 | p02937 | python | s471890634 | s911926937 | 757 | 324 | 111,604 | 107,044 | Accepted | Accepted | 57.2 | import sys
ordA = ord('a')
ss = eval(input())
ts = eval(input())
lenS, lenT = len(ss), len(ts)
setS = set(ss)
for t in ts:
if t not in setS:
print((-1))
sys.exit()
poss = [-1] * 26
for i, s in enumerate(ss):
ch = ord(s)-ordA
if poss[ch] == -1:
poss[ch] = i + l... | import sys
numChar = 26
ordA = ord('a')
Ss = input().rstrip()
Ts = input().rstrip()
setS, setT = set(Ss), set(Ts)
for T in setT:
if T not in setS:
print((-1))
sys.exit()
def getDistNextss(As, numChar):
lenA = len(As)
poss = [-1] * numChar
for i, A in enumerate(As):
... | 37 | 37 | 632 | 758 | import sys
ordA = ord("a")
ss = eval(input())
ts = eval(input())
lenS, lenT = len(ss), len(ts)
setS = set(ss)
for t in ts:
if t not in setS:
print((-1))
sys.exit()
poss = [-1] * 26
for i, s in enumerate(ss):
ch = ord(s) - ordA
if poss[ch] == -1:
poss[ch] = i + lenS
nextss = [[0] * (... | import sys
numChar = 26
ordA = ord("a")
Ss = input().rstrip()
Ts = input().rstrip()
setS, setT = set(Ss), set(Ts)
for T in setT:
if T not in setS:
print((-1))
sys.exit()
def getDistNextss(As, numChar):
lenA = len(As)
poss = [-1] * numChar
for i, A in enumerate(As):
if poss[A] ... | false | 0 | [
"+numChar = 26",
"-ss = eval(input())",
"-ts = eval(input())",
"-lenS, lenT = len(ss), len(ts)",
"-setS = set(ss)",
"-for t in ts:",
"- if t not in setS:",
"+Ss = input().rstrip()",
"+Ts = input().rstrip()",
"+setS, setT = set(Ss), set(Ts)",
"+for T in setT:",
"+ if T not in setS:",
"-... | false | 0.126629 | 0.076758 | 1.649728 | [
"s471890634",
"s911926937"
] |
u372501464 | p02781 | python | s876960871 | s365393859 | 192 | 29 | 41,328 | 3,820 | Accepted | Accepted | 84.9 | from collections import defaultdict
N = input().strip()
K = int(input().strip())
lenN = len(N)
memo = defaultdict(lambda :defaultdict(lambda :defaultdict(int)))
def f(keta, flag, k):
if keta == lenN-1:
if k == K:
return 1
else:
return 0
if keta in memo and ... | from collections import defaultdict
from functools import lru_cache
N = input().strip()
K = int(input().strip())
lenN = len(N)
#memo = defaultdict(lambda :defaultdict(lambda :defaultdict(int)))
@lru_cache(maxsize=None)
def f(keta, flag, k):
if keta == lenN-1:
if k == K:
return 1
... | 28 | 30 | 741 | 804 | from collections import defaultdict
N = input().strip()
K = int(input().strip())
lenN = len(N)
memo = defaultdict(lambda: defaultdict(lambda: defaultdict(int)))
def f(keta, flag, k):
if keta == lenN - 1:
if k == K:
return 1
else:
return 0
if keta in memo and flag in me... | from collections import defaultdict
from functools import lru_cache
N = input().strip()
K = int(input().strip())
lenN = len(N)
# memo = defaultdict(lambda :defaultdict(lambda :defaultdict(int)))
@lru_cache(maxsize=None)
def f(keta, flag, k):
if keta == lenN - 1:
if k == K:
return 1
else... | false | 6.666667 | [
"+from functools import lru_cache",
"-memo = defaultdict(lambda: defaultdict(lambda: defaultdict(int)))",
"-",
"-",
"+# memo = defaultdict(lambda :defaultdict(lambda :defaultdict(int)))",
"+@lru_cache(maxsize=None)",
"- if keta in memo and flag in memo[keta] and k in memo[keta][flag]:",
"- r... | false | 0.086111 | 0.036421 | 2.364333 | [
"s876960871",
"s365393859"
] |
u645250356 | p03438 | python | s277854133 | s829982823 | 209 | 46 | 41,580 | 6,648 | Accepted | Accepted | 77.99 | from collections import Counter,defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())
de... | from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,fractions
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
n = ... | 23 | 19 | 606 | 519 | from collections import Counter, defaultdict, deque
import sys, heapq, bisect, math, itertools, string, queue
sys.setrecursionlimit(10**8)
mod = 10**9 + 7
def inp():
return int(sys.stdin.readline())
def inpl():
return list(map(int, sys.stdin.readline().split()))
def inpl_str():
return list(sys.stdin.... | from collections import Counter, defaultdict, deque
from heapq import heappop, heappush, heapify
import sys, bisect, math, itertools, fractions
sys.setrecursionlimit(10**8)
mod = 10**9 + 7
INF = float("inf")
def inp():
return int(sys.stdin.readline())
def inpl():
return list(map(int, sys.stdin.readline().s... | false | 17.391304 | [
"-import sys, heapq, bisect, math, itertools, string, queue",
"+from heapq import heappop, heappush, heapify",
"+import sys, bisect, math, itertools, fractions",
"+INF = float(\"inf\")",
"-def inpl_str():",
"- return list(sys.stdin.readline().split())",
"-",
"-",
"-def inpln(n):",
"- return ... | false | 0.045947 | 0.037623 | 1.221259 | [
"s277854133",
"s829982823"
] |
u168825829 | p03111 | python | s675492230 | s980722029 | 73 | 60 | 3,064 | 3,064 | Accepted | Accepted | 17.81 | N, A, B, C = list(map(int, input().split(" ")))
l = [int(eval(input())) for i in range(N)]
INF = 10 ** 9
def dfs(cnt, a, b, c):
if cnt == N:
return abs(a-A)+abs(b-B)+abs(c-C)-30 if min(a,b,c)>0 else INF
ret1=dfs(cnt+1,a+l[cnt],b,c)+10
ret2=dfs(cnt+1,a,b+l[cnt],c)+10
ret3=dfs(cnt+1,a,b,c+... | N,A,B,C = list(map(int, input().split()))
l = [0]*N
for i in range(N):
l[i] = int(eval(input()))
def dfs(i,a,b,c):
if i == N:
if a==0 or b==0 or c==0:
return 100000
else:
return abs(A-a)+abs(B-b)+abs(C-c)-30
else:
return min(dfs(i+1,a+l[i],b,c)+10,... | 13 | 14 | 405 | 396 | N, A, B, C = list(map(int, input().split(" ")))
l = [int(eval(input())) for i in range(N)]
INF = 10**9
def dfs(cnt, a, b, c):
if cnt == N:
return abs(a - A) + abs(b - B) + abs(c - C) - 30 if min(a, b, c) > 0 else INF
ret1 = dfs(cnt + 1, a + l[cnt], b, c) + 10
ret2 = dfs(cnt + 1, a, b + l[cnt], c) ... | N, A, B, C = list(map(int, input().split()))
l = [0] * N
for i in range(N):
l[i] = int(eval(input()))
def dfs(i, a, b, c):
if i == N:
if a == 0 or b == 0 or c == 0:
return 100000
else:
return abs(A - a) + abs(B - b) + abs(C - c) - 30
else:
return min(
... | false | 7.142857 | [
"-N, A, B, C = list(map(int, input().split(\" \")))",
"-l = [int(eval(input())) for i in range(N)]",
"-INF = 10**9",
"+N, A, B, C = list(map(int, input().split()))",
"+l = [0] * N",
"+for i in range(N):",
"+ l[i] = int(eval(input()))",
"-def dfs(cnt, a, b, c):",
"- if cnt == N:",
"- r... | false | 0.094195 | 0.216181 | 0.435725 | [
"s675492230",
"s980722029"
] |
u077291787 | p02558 | python | s754292048 | s982268637 | 378 | 308 | 144,920 | 18,872 | Accepted | Accepted | 18.52 | class UnionFind:
"""Union-Find: O(α(N))"""
__slots__ = ["_data_size", "_first_idx", "_parents"]
def __init__(self, data_size: int, is_zero_origin: bool = True) -> None:
self._data_size = data_size
self._first_idx = 0 if is_zero_origin else 1
self._parents = [-1] * (data_siz... | class UnionFind:
__slots__ = ["N", "root", "rank"]
def __init__(self, N):
"""
N:要素数
root:各要素の親要素の番号を格納するリスト.
ただし, root[x] < 0 ならその頂点が根で-root[x]が木の要素数.
rank:ランク
"""
self.N = N
self.root = [-1] * N
def __repr__(self):
... | 47 | 81 | 1,504 | 2,036 | class UnionFind:
"""Union-Find: O(α(N))"""
__slots__ = ["_data_size", "_first_idx", "_parents"]
def __init__(self, data_size: int, is_zero_origin: bool = True) -> None:
self._data_size = data_size
self._first_idx = 0 if is_zero_origin else 1
self._parents = [-1] * (data_size + self... | class UnionFind:
__slots__ = ["N", "root", "rank"]
def __init__(self, N):
"""
N:要素数
root:各要素の親要素の番号を格納するリスト.
ただし, root[x] < 0 ならその頂点が根で-root[x]が木の要素数.
rank:ランク
"""
self.N = N
self.root = [-1] * N
def __repr__(self):
return "\n".j... | false | 41.975309 | [
"- \"\"\"Union-Find: O(α(N))\"\"\"",
"+ __slots__ = [\"N\", \"root\", \"rank\"]",
"- __slots__ = [\"_data_size\", \"_first_idx\", \"_parents\"]",
"+ def __init__(self, N):",
"+ \"\"\"",
"+ N:要素数",
"+ root:各要素の親要素の番号を格納するリスト.",
"+ ただし, root[x] < 0 ならその頂点が根で-... | false | 0.047376 | 0.099617 | 0.475586 | [
"s754292048",
"s982268637"
] |
u332385682 | p03999 | python | s223217627 | s526803120 | 20 | 17 | 3,064 | 3,064 | Accepted | Accepted | 15 | import sys
def debug(x, table):
for name, val in table.items():
if x is val:
print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr)
return None
def solve():
S = input()
N = len(S) - 1
ans = 0
for i in range(2**N):
bi = bin(i)[2:].zfill(N)
... | import sys
from itertools import accumulate
def debug(x, table):
for name, val in table.items():
if x is val:
print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr)
return None
def solve():
S = [int(i) for i in input()]
N = len(S)
sac = [0] + list(accumu... | 38 | 22 | 695 | 503 | import sys
def debug(x, table):
for name, val in table.items():
if x is val:
print("DEBUG:{} -> {}".format(name, val), file=sys.stderr)
return None
def solve():
S = input()
N = len(S) - 1
ans = 0
for i in range(2**N):
bi = bin(i)[2:].zfill(N)
# pri... | import sys
from itertools import accumulate
def debug(x, table):
for name, val in table.items():
if x is val:
print("DEBUG:{} -> {}".format(name, val), file=sys.stderr)
return None
def solve():
S = [int(i) for i in input()]
N = len(S)
sac = [0] + list(accumulate(S))
... | false | 42.105263 | [
"+from itertools import accumulate",
"- S = input()",
"- N = len(S) - 1",
"+ S = [int(i) for i in input()]",
"+ N = len(S)",
"+ sac = [0] + list(accumulate(S))",
"- for i in range(2**N):",
"- bi = bin(i)[2:].zfill(N)",
"- # print(bi)",
"- ans += calc(S, bi)",... | false | 0.036486 | 0.037456 | 0.974102 | [
"s223217627",
"s526803120"
] |
u634079249 | p02959 | python | s838859631 | s694636655 | 177 | 121 | 19,228 | 18,744 | Accepted | Accepted | 31.64 | import sys
import os
def main():
if os.getenv("LOCAL"):
sys.stdin = open("input.txt", "r")
N = int(sys.stdin.readline().rstrip())
city = list(map(int, sys.stdin.readline().split()))
brave = list(map(int, sys.stdin.readline().split()))
init = sum(city)
for n in range(N):
... | import sys
sys.setrecursionlimit(10000000)
import os
import math
import bisect
import collections
import itertools
import heapq
import re
import queue
# import fractions
ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda... | 23 | 54 | 525 | 1,271 | import sys
import os
def main():
if os.getenv("LOCAL"):
sys.stdin = open("input.txt", "r")
N = int(sys.stdin.readline().rstrip())
city = list(map(int, sys.stdin.readline().split()))
brave = list(map(int, sys.stdin.readline().split()))
init = sum(city)
for n in range(N):
bef = c... | import sys
sys.setrecursionlimit(10000000)
import os
import math
import bisect
import collections
import itertools
import heapq
import re
import queue
# import fractions
ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float,... | false | 57.407407 | [
"+",
"+sys.setrecursionlimit(10000000)",
"+import math",
"+import bisect",
"+import collections",
"+import itertools",
"+import heapq",
"+import re",
"+import queue",
"+",
"+# import fractions",
"+ii = lambda: int(sys.stdin.buffer.readline().rstrip())",
"+il = lambda: list(map(int, sys.stdin... | false | 0.039438 | 0.040445 | 0.975116 | [
"s838859631",
"s694636655"
] |
u072717685 | p02702 | python | s880877238 | s696753679 | 312 | 104 | 87,652 | 87,728 | Accepted | Accepted | 66.67 | import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
from collections import defaultdict
def main():
s = tuple(map(int, eval(input())))
lens = len(s)
d1 = defaultdict(int)
ss = 0
k = 1
num10 = 1
while k <= lens:
ss += (int(s[-k]) * num10) % 2019
ss ... | import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
from collections import defaultdict
def main():
s = tuple(map(int, eval(input())))
lens = len(s)
d1 = defaultdict(int)
ss = 0
num10 = 1
for i1 in range(1, lens+1):
ss += (int(s[-i1]) * num10) % 2019
ss... | 25 | 23 | 528 | 513 | import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
from collections import defaultdict
def main():
s = tuple(map(int, eval(input())))
lens = len(s)
d1 = defaultdict(int)
ss = 0
k = 1
num10 = 1
while k <= lens:
ss += (int(s[-k]) * num10) % 2019
ss = ss % 2019
... | import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
from collections import defaultdict
def main():
s = tuple(map(int, eval(input())))
lens = len(s)
d1 = defaultdict(int)
ss = 0
num10 = 1
for i1 in range(1, lens + 1):
ss += (int(s[-i1]) * num10) % 2019
ss = ss % 2... | false | 8 | [
"- k = 1",
"- while k <= lens:",
"- ss += (int(s[-k]) * num10) % 2019",
"+ for i1 in range(1, lens + 1):",
"+ ss += (int(s[-i1]) * num10) % 2019",
"- k += 1"
] | false | 0.037573 | 0.038457 | 0.977001 | [
"s880877238",
"s696753679"
] |
u883621917 | p03775 | python | s699386059 | s177661466 | 192 | 86 | 40,432 | 65,692 | Accepted | Accepted | 55.21 | import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
n = int(eval(input()))
i = 1
ab = set()
while i ** 2 <= n:
if n % i == 0:
ab.add((i, n // i))
i += 1
def digit(n):
ans = 0
while n > 0:
ans += 1
n //= 10
return ans
ans = 10 ** 10
fo... | import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
n = int(eval(input()))
def digit(n):
l = 0
while n:
l += 1
n //= 10
return l
ans = 100
i = 1
while i ** 2 <= n:
if n % i == 0:
#ans = min(ans, max(len(str(i)), len(str(n // i))))
ans... | 25 | 21 | 387 | 380 | import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
n = int(eval(input()))
i = 1
ab = set()
while i**2 <= n:
if n % i == 0:
ab.add((i, n // i))
i += 1
def digit(n):
ans = 0
while n > 0:
ans += 1
n //= 10
return ans
ans = 10**10
for a, b in ab:
ans = mi... | import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
n = int(eval(input()))
def digit(n):
l = 0
while n:
l += 1
n //= 10
return l
ans = 100
i = 1
while i**2 <= n:
if n % i == 0:
# ans = min(ans, max(len(str(i)), len(str(n // i))))
ans = min(ans, max(dig... | false | 16 | [
"-i = 1",
"-ab = set()",
"-while i**2 <= n:",
"- if n % i == 0:",
"- ab.add((i, n // i))",
"- i += 1",
"- ans = 0",
"- while n > 0:",
"- ans += 1",
"+ l = 0",
"+ while n:",
"+ l += 1",
"- return ans",
"+ return l",
"-ans = 10**10",
"-for a, ... | false | 0.061722 | 0.062387 | 0.989337 | [
"s699386059",
"s177661466"
] |
u281610856 | p03162 | python | s927899763 | s661082570 | 1,094 | 659 | 47,272 | 68,716 | Accepted | Accepted | 39.76 | n = int(eval(input()))
a = [0] * n
for x in range(n):
a[x] = list(map(int, input().split()))
# print(a)
dp = [[0 for _ in range(3)] for _ in range(n+1)]
# print(dp)
for i in range(n):
for j in range(3):
for k in range(3):
if j == k:
continue
dp[i + 1][... | MAX_N = 10 ** 5 + 10
N = int(eval(input()))
dp = [[0] * 3 for _ in range(MAX_N)]
arr = [0] * MAX_N
for i in range(N):
arr[i] = list(map(int, input().split()))
for i in range(N):
for j in range(3):
for k in range(3):
if j == k:
continue
dp[i+1][k] = ma... | 15 | 14 | 388 | 368 | n = int(eval(input()))
a = [0] * n
for x in range(n):
a[x] = list(map(int, input().split()))
# print(a)
dp = [[0 for _ in range(3)] for _ in range(n + 1)]
# print(dp)
for i in range(n):
for j in range(3):
for k in range(3):
if j == k:
continue
dp[i + 1][k] = max(d... | MAX_N = 10**5 + 10
N = int(eval(input()))
dp = [[0] * 3 for _ in range(MAX_N)]
arr = [0] * MAX_N
for i in range(N):
arr[i] = list(map(int, input().split()))
for i in range(N):
for j in range(3):
for k in range(3):
if j == k:
continue
dp[i + 1][k] = max(dp[i + 1][k... | false | 6.666667 | [
"-n = int(eval(input()))",
"-a = [0] * n",
"-for x in range(n):",
"- a[x] = list(map(int, input().split()))",
"-# print(a)",
"-dp = [[0 for _ in range(3)] for _ in range(n + 1)]",
"-# print(dp)",
"-for i in range(n):",
"+MAX_N = 10**5 + 10",
"+N = int(eval(input()))",
"+dp = [[0] * 3 for _ in... | false | 0.091827 | 0.119172 | 0.770542 | [
"s927899763",
"s661082570"
] |
u535803878 | p02744 | python | s481891943 | s328503138 | 494 | 440 | 139,736 | 155,736 | Accepted | Accepted | 10.93 | # パナソニック2020D
from queue import deque
n = int(eval(input()))
q = deque([("a", "a")])
while True:
s, m = q.pop()
if len(s)==n:
print(s)
elif len(s)>=n+1:
break
for o in range(ord("a"), ord(m)+2):
if ord(m)<o:
m = chr(o)
q.appendleft((s + chr(o), m)... | # パナソニック2020D
import sys
write = lambda x: sys.stdout.write(x+"\n")
from queue import deque
n = int(eval(input()))
q = deque([("a", "a")])
while True:
s, m = q.pop()
if len(s)==n:
write(s)
elif len(s)>=n+1:
break
for o in range(ord("a"), ord(m)+2):
if ord(m)<o:
... | 14 | 16 | 315 | 371 | # パナソニック2020D
from queue import deque
n = int(eval(input()))
q = deque([("a", "a")])
while True:
s, m = q.pop()
if len(s) == n:
print(s)
elif len(s) >= n + 1:
break
for o in range(ord("a"), ord(m) + 2):
if ord(m) < o:
m = chr(o)
q.appendleft((s + chr(o), m))
| # パナソニック2020D
import sys
write = lambda x: sys.stdout.write(x + "\n")
from queue import deque
n = int(eval(input()))
q = deque([("a", "a")])
while True:
s, m = q.pop()
if len(s) == n:
write(s)
elif len(s) >= n + 1:
break
for o in range(ord("a"), ord(m) + 2):
if ord(m) < o:
... | false | 12.5 | [
"+import sys",
"+",
"+write = lambda x: sys.stdout.write(x + \"\\n\")",
"- print(s)",
"+ write(s)"
] | false | 0.09061 | 0.0448 | 2.02254 | [
"s481891943",
"s328503138"
] |
u298297089 | p03330 | python | s222938177 | s961076147 | 237 | 219 | 3,188 | 3,188 | Accepted | Accepted | 7.59 | n,c = list(map(int, input().split()))
color, grid = [], []
for _ in range(c):
color.append(list(map(int, input().split())))
grid = {i:{} for i in range(3)}
for i in range(n):
for j,t in enumerate(map(int, input().split())):
t -= 1
if t not in grid[(i+j + 2) % 3]:
grid[(i+j... | import sys
input = sys.stdin.readline
n,c = list(map(int, input().split()))
color = []
for _ in range(c):
color.append(list(map(int, input().split())))
grid = {i:{} for i in range(3)}
for i in range(n):
for j,t in enumerate(map(int, input().split())):
t -= 1
if t not in grid[(i+j +... | 31 | 36 | 1,026 | 1,057 | n, c = list(map(int, input().split()))
color, grid = [], []
for _ in range(c):
color.append(list(map(int, input().split())))
grid = {i: {} for i in range(3)}
for i in range(n):
for j, t in enumerate(map(int, input().split())):
t -= 1
if t not in grid[(i + j + 2) % 3]:
grid[(i + j + 2... | import sys
input = sys.stdin.readline
n, c = list(map(int, input().split()))
color = []
for _ in range(c):
color.append(list(map(int, input().split())))
grid = {i: {} for i in range(3)}
for i in range(n):
for j, t in enumerate(map(int, input().split())):
t -= 1
if t not in grid[(i + j + 2) % 3]... | false | 13.888889 | [
"+import sys",
"+",
"+input = sys.stdin.readline",
"-color, grid = [], []",
"+color = []",
"-x = sorted(list(range(c)), key=lambda x: costs[0][x])[:3]",
"-y = sorted(list(range(c)), key=lambda x: costs[1][x])[:3]",
"-z = sorted(list(range(c)), key=lambda x: costs[2][x])[:3]",
"+rc = list(range(c))",... | false | 0.045848 | 0.034692 | 1.32158 | [
"s222938177",
"s961076147"
] |
u419877586 | p02779 | python | s642258229 | s254535515 | 282 | 147 | 86,228 | 33,996 | Accepted | Accepted | 47.87 | N=int(eval(input()))
A=list(map(int, input().split()))
A.sort()
ans="YES"
for i in range(N-1):
if A[i]==A[i+1]:
ans="NO"
break
print(ans) | from collections import defaultdict
N = int(eval(input()))
A = list(map(int, input().split()))
d = defaultdict(int)
for a in A:
d[a] += 1
if len(d) == N:
print("YES")
else:
print("NO") | 9 | 13 | 159 | 205 | N = int(eval(input()))
A = list(map(int, input().split()))
A.sort()
ans = "YES"
for i in range(N - 1):
if A[i] == A[i + 1]:
ans = "NO"
break
print(ans)
| from collections import defaultdict
N = int(eval(input()))
A = list(map(int, input().split()))
d = defaultdict(int)
for a in A:
d[a] += 1
if len(d) == N:
print("YES")
else:
print("NO")
| false | 30.769231 | [
"+from collections import defaultdict",
"+",
"-A.sort()",
"-ans = \"YES\"",
"-for i in range(N - 1):",
"- if A[i] == A[i + 1]:",
"- ans = \"NO\"",
"- break",
"-print(ans)",
"+d = defaultdict(int)",
"+for a in A:",
"+ d[a] += 1",
"+if len(d) == N:",
"+ print(\"YES\")"... | false | 0.079015 | 0.035518 | 2.224672 | [
"s642258229",
"s254535515"
] |
u363407238 | p03370 | python | s232872096 | s281846016 | 36 | 17 | 3,060 | 2,940 | Accepted | Accepted | 52.78 | n,x=list(map(int, input().split()))
min_cost=float('inf')
cnt=0
for i in range(n):
mi = int(eval(input()))
x -= mi
cnt += 1
min_cost = min(min_cost,mi)
while x >= min_cost:
x -= min_cost
cnt += 1
print(cnt) | n,x = list(map(int, input().split()))
l = [int(eval(input())) for _ in range(n)]
print((len(l)+(x-sum(l))//min(l))) | 12 | 3 | 229 | 103 | n, x = list(map(int, input().split()))
min_cost = float("inf")
cnt = 0
for i in range(n):
mi = int(eval(input()))
x -= mi
cnt += 1
min_cost = min(min_cost, mi)
while x >= min_cost:
x -= min_cost
cnt += 1
print(cnt)
| n, x = list(map(int, input().split()))
l = [int(eval(input())) for _ in range(n)]
print((len(l) + (x - sum(l)) // min(l)))
| false | 75 | [
"-min_cost = float(\"inf\")",
"-cnt = 0",
"-for i in range(n):",
"- mi = int(eval(input()))",
"- x -= mi",
"- cnt += 1",
"- min_cost = min(min_cost, mi)",
"-while x >= min_cost:",
"- x -= min_cost",
"- cnt += 1",
"-print(cnt)",
"+l = [int(eval(input())) for _ in range(n)]",
... | false | 0.038701 | 0.076949 | 0.502942 | [
"s232872096",
"s281846016"
] |
u146803137 | p03289 | python | s428458134 | s971672471 | 169 | 29 | 38,384 | 9,100 | Accepted | Accepted | 82.84 | import sys
s = eval(input())
ans = 'AC'
c = 0
if s[0] != 'A':
ans = "WA"
for i in range(2,len(s)-1):
if "C" == s[i]:
c += 1
if c != 1:
ans = "WA"
c = 0
for i in range(len(s)):
a = ord(s[i])
if 65 <= a and a <= 96:
c += 1
if c != 2:
ans = "WA"
print(ans) | s = eval(input())
ans = 'AC'
if s[0] != 'A':
ans = 'WA'
if not('C' in s[2:-1]):
ans = 'WA'
s = s.replace('A','')
s = s.replace('C','',1)
for i in s:
if ord(i) < ord('a') or ord(i) > ord('z'):
ans = 'WA'
print(ans)
| 19 | 12 | 305 | 239 | import sys
s = eval(input())
ans = "AC"
c = 0
if s[0] != "A":
ans = "WA"
for i in range(2, len(s) - 1):
if "C" == s[i]:
c += 1
if c != 1:
ans = "WA"
c = 0
for i in range(len(s)):
a = ord(s[i])
if 65 <= a and a <= 96:
c += 1
if c != 2:
ans = "WA"
print(ans)
| s = eval(input())
ans = "AC"
if s[0] != "A":
ans = "WA"
if not ("C" in s[2:-1]):
ans = "WA"
s = s.replace("A", "")
s = s.replace("C", "", 1)
for i in s:
if ord(i) < ord("a") or ord(i) > ord("z"):
ans = "WA"
print(ans)
| false | 36.842105 | [
"-import sys",
"-",
"-c = 0",
"-for i in range(2, len(s) - 1):",
"- if \"C\" == s[i]:",
"- c += 1",
"-if c != 1:",
"+if not (\"C\" in s[2:-1]):",
"-c = 0",
"-for i in range(len(s)):",
"- a = ord(s[i])",
"- if 65 <= a and a <= 96:",
"- c += 1",
"-if c != 2:",
"- ... | false | 0.036293 | 0.033204 | 1.093049 | [
"s428458134",
"s971672471"
] |
u365686736 | p02401 | python | s786512771 | s583168484 | 30 | 20 | 5,548 | 5,548 | Accepted | Accepted | 33.33 | while True:
s = eval(input())
if '?' in s:
break
print((int(eval(s))))
| while 1:
s = eval(input())
if '?' in s:break
print((int(eval(s))))
| 5 | 4 | 87 | 74 | while True:
s = eval(input())
if "?" in s:
break
print((int(eval(s))))
| while 1:
s = eval(input())
if "?" in s:
break
print((int(eval(s))))
| false | 20 | [
"-while True:",
"+while 1:"
] | false | 0.038876 | 0.038725 | 1.003897 | [
"s786512771",
"s583168484"
] |
u243312682 | p02780 | python | s002232397 | s879247706 | 169 | 139 | 32,000 | 31,892 | Accepted | Accepted | 17.75 | n, k = list(map(int, input().split()))
P = [int(x) for x in input().split()]
p_e = list()
exp = 0
for p in P:
# 期待値
# 累積和
exp += (1+p)/2
p_e.append(exp)
# この後差を取るので
# n==kの時とそうでない時でやり方を分けないとだめ
if n == k:
print((p_e[-1]))
else:
# 初期値
maxv = p_e[k-1] - 0
for i in range(1,... | def main():
n, k = list(map(int, input().split()))
P = [int(x) for x in input().split()]
p_e = list()
exp = 0
for p in P:
# 期待値
# 累積和
exp += (1+p)/2
p_e.append(exp)
# 初期値
maxv = p_e[k-1] - 0
for i in range(1, n-k):
# 隣接するk個の期待値の和
... | 21 | 19 | 427 | 434 | n, k = list(map(int, input().split()))
P = [int(x) for x in input().split()]
p_e = list()
exp = 0
for p in P:
# 期待値
# 累積和
exp += (1 + p) / 2
p_e.append(exp)
# この後差を取るので
# n==kの時とそうでない時でやり方を分けないとだめ
if n == k:
print((p_e[-1]))
else:
# 初期値
maxv = p_e[k - 1] - 0
for i in range(1, n - k):
... | def main():
n, k = list(map(int, input().split()))
P = [int(x) for x in input().split()]
p_e = list()
exp = 0
for p in P:
# 期待値
# 累積和
exp += (1 + p) / 2
p_e.append(exp)
# 初期値
maxv = p_e[k - 1] - 0
for i in range(1, n - k):
# 隣接するk個の期待値の和
p_... | false | 9.52381 | [
"-n, k = list(map(int, input().split()))",
"-P = [int(x) for x in input().split()]",
"-p_e = list()",
"-exp = 0",
"-for p in P:",
"- # 期待値",
"- # 累積和",
"- exp += (1 + p) / 2",
"- p_e.append(exp)",
"-# この後差を取るので",
"-# n==kの時とそうでない時でやり方を分けないとだめ",
"-if n == k:",
"- print((p_e[-1]... | false | 0.119598 | 0.045195 | 2.646272 | [
"s002232397",
"s879247706"
] |
u820351940 | p03167 | python | s898767844 | s144415760 | 1,002 | 584 | 265,992 | 246,364 | Accepted | Accepted | 41.72 | import sys
sys.setrecursionlimit(10**6)
h, w = list(map(int, input().split()))
field = [list(eval(input())) for _ in range(h)]
dp = [[None] * w for _ in range(h)]
def dfs(hindex=h - 1, windex=w - 1):
if field[hindex][windex] == "#":
return 0
if hindex == windex == 0:
return 1
... | import sys
sys.setrecursionlimit(10**6)
h, w = list(map(int, input().split()))
field = [list(eval(input())) for _ in range(h)]
dp = [[None] * w for _ in range(h)]
# def dfs(hindex=h - 1, windex=w - 1):
# if field[hindex][windex] == "#":
# return 0
# if hindex == windex == 0:
# retur... | 20 | 30 | 536 | 931 | import sys
sys.setrecursionlimit(10**6)
h, w = list(map(int, input().split()))
field = [list(eval(input())) for _ in range(h)]
dp = [[None] * w for _ in range(h)]
def dfs(hindex=h - 1, windex=w - 1):
if field[hindex][windex] == "#":
return 0
if hindex == windex == 0:
return 1
if dp[hindex... | import sys
sys.setrecursionlimit(10**6)
h, w = list(map(int, input().split()))
field = [list(eval(input())) for _ in range(h)]
dp = [[None] * w for _ in range(h)]
# def dfs(hindex=h - 1, windex=w - 1):
# if field[hindex][windex] == "#":
# return 0
# if hindex == windex == 0:
# return 1
#
# ... | false | 33.333333 | [
"-",
"-",
"-def dfs(hindex=h - 1, windex=w - 1):",
"- if field[hindex][windex] == \"#\":",
"- return 0",
"- if hindex == windex == 0:",
"- return 1",
"- if dp[hindex][windex] is not None:",
"- return dp[hindex][windex]",
"- r = (hindex and dfs(hindex - 1, windex)) ... | false | 0.046542 | 0.091803 | 0.506978 | [
"s898767844",
"s144415760"
] |
u084963909 | p02711 | python | s106533232 | s521546208 | 24 | 22 | 9,024 | 8,960 | Accepted | Accepted | 8.33 | s = eval(input())
for c in s:
if '7' in s:
print("Yes")
break
else:
print("No")
break | n=eval(input(""))
x=0
while x<3:
if n[x]=="7":
print("Yes")
break
x=x+1
if x==3: print("No")
| 9 | 9 | 128 | 124 | s = eval(input())
for c in s:
if "7" in s:
print("Yes")
break
else:
print("No")
break
| n = eval(input(""))
x = 0
while x < 3:
if n[x] == "7":
print("Yes")
break
x = x + 1
if x == 3:
print("No")
| false | 0 | [
"-s = eval(input())",
"-for c in s:",
"- if \"7\" in s:",
"+n = eval(input(\"\"))",
"+x = 0",
"+while x < 3:",
"+ if n[x] == \"7\":",
"- else:",
"+ x = x + 1",
"+ if x == 3:",
"- break"
] | false | 0.041982 | 0.104406 | 0.402102 | [
"s106533232",
"s521546208"
] |
u051684204 | p02923 | python | s094156936 | s462503520 | 101 | 69 | 14,252 | 14,224 | Accepted | Accepted | 31.68 | N=int(eval(input()))
H = list(map(int, input().split()))
I=[H[i]-H[i+1] for i in range(N-1)]
a=0
n=0
j=0
while j<N-1:
if I[j]>=0:
j+=1
n+=1
else:
j+=1
a=max(n,a)
n=0
a=max(n,a)
print(a) | N=int(eval(input()))
ls=list(map(int,input().split()))
if N==1:
print((0))
exit()
a=[]
k=0
for i in range(N-1):
if ls[i]>=ls[i+1]:
k+=1
else:
a.append(k)
k=0
a.append(k)
print((max(a))) | 16 | 15 | 218 | 209 | N = int(eval(input()))
H = list(map(int, input().split()))
I = [H[i] - H[i + 1] for i in range(N - 1)]
a = 0
n = 0
j = 0
while j < N - 1:
if I[j] >= 0:
j += 1
n += 1
else:
j += 1
a = max(n, a)
n = 0
a = max(n, a)
print(a)
| N = int(eval(input()))
ls = list(map(int, input().split()))
if N == 1:
print((0))
exit()
a = []
k = 0
for i in range(N - 1):
if ls[i] >= ls[i + 1]:
k += 1
else:
a.append(k)
k = 0
a.append(k)
print((max(a)))
| false | 6.25 | [
"-H = list(map(int, input().split()))",
"-I = [H[i] - H[i + 1] for i in range(N - 1)]",
"-a = 0",
"-n = 0",
"-j = 0",
"-while j < N - 1:",
"- if I[j] >= 0:",
"- j += 1",
"- n += 1",
"+ls = list(map(int, input().split()))",
"+if N == 1:",
"+ print((0))",
"+ exit()",
"... | false | 0.035408 | 0.036129 | 0.980041 | [
"s094156936",
"s462503520"
] |
u046187684 | p02912 | python | s525272210 | s367762838 | 118 | 104 | 14,224 | 15,172 | Accepted | Accepted | 11.86 | n,m = list(map(int,input().split()))
arr = list(map(int,input().split()))
l = len(arr)
while m != 0 :
arr.sort(reverse=True)
j = arr[0] // 2
for i in range(l):
if arr[i] > j:
if m != 0:
m -= 1
else:
break
... | from heapq import heappush, heappop
def solve(string):
n, m, *a = list(map(int, string.split()))
while m > 0:
a.sort(reverse=True)
if a[0] == 0:
break
b = a[0] // 2
for i, _a in enumerate(a):
if m == 0 or _a <= b:
break
... | 21 | 20 | 457 | 457 | n, m = list(map(int, input().split()))
arr = list(map(int, input().split()))
l = len(arr)
while m != 0:
arr.sort(reverse=True)
j = arr[0] // 2
for i in range(l):
if arr[i] > j:
if m != 0:
m -= 1
else:
break
arr[i] //= 2
else... | from heapq import heappush, heappop
def solve(string):
n, m, *a = list(map(int, string.split()))
while m > 0:
a.sort(reverse=True)
if a[0] == 0:
break
b = a[0] // 2
for i, _a in enumerate(a):
if m == 0 or _a <= b:
break
a[i] /... | false | 4.761905 | [
"-n, m = list(map(int, input().split()))",
"-arr = list(map(int, input().split()))",
"-l = len(arr)",
"-while m != 0:",
"- arr.sort(reverse=True)",
"- j = arr[0] // 2",
"- for i in range(l):",
"- if arr[i] > j:",
"- if m != 0:",
"- m -= 1",
"- ... | false | 0.03687 | 0.036921 | 0.998615 | [
"s525272210",
"s367762838"
] |
u634490486 | p02384 | python | s288934228 | s223399952 | 120 | 40 | 7,344 | 7,100 | Accepted | Accepted | 66.67 | from sys import stdin
from copy import deepcopy
import queue
class Dice:
def __init__(self, nums):
self.labels = [None] + [ nums[i] for i in range(6) ]
self.pos = {
"E" : 3,
"W" : 4,
"S" : 2,
"N" : 5,
"T" : 1,
"B" ... | from sys import stdin
from copy import deepcopy
import queue
class Dice:
def __init__(self, nums):
self.labels = [None] + [ nums[i] for i in range(6) ]
self.pos = {
"E" : 3,
"W" : 4,
"S" : 2,
"N" : 5,
"T" : 1,
"B" ... | 68 | 71 | 2,058 | 2,115 | from sys import stdin
from copy import deepcopy
import queue
class Dice:
def __init__(self, nums):
self.labels = [None] + [nums[i] for i in range(6)]
self.pos = {"E": 3, "W": 4, "S": 2, "N": 5, "T": 1, "B": 6}
def rolled(dice, queries):
d = deepcopy(dice)
for q in queries:
... | from sys import stdin
from copy import deepcopy
import queue
class Dice:
def __init__(self, nums):
self.labels = [None] + [nums[i] for i in range(6)]
self.pos = {"E": 3, "W": 4, "S": 2, "N": 5, "T": 1, "B": 6}
def rolled(dice, queries):
d = deepcopy(dice)
for q in queries:
... | false | 4.225352 | [
"+ if isinstance(memo[T][S], str):",
"+ return memo[T][S]"
] | false | 0.058574 | 0.054344 | 1.077821 | [
"s288934228",
"s223399952"
] |
u796942881 | p02898 | python | s450849770 | s932675529 | 51 | 47 | 11,872 | 11,872 | Accepted | Accepted | 7.84 | N, K, *h = list(map(int, open(0).read().split()))
print((sum(1 for i in [x for x in h if K <= x])))
| N, K, *h = list(map(int, open(0).read().split()))
print((sum([1 for i in h if K <= i])))
| 2 | 2 | 96 | 82 | N, K, *h = list(map(int, open(0).read().split()))
print((sum(1 for i in [x for x in h if K <= x])))
| N, K, *h = list(map(int, open(0).read().split()))
print((sum([1 for i in h if K <= i])))
| false | 0 | [
"-print((sum(1 for i in [x for x in h if K <= x])))",
"+print((sum([1 for i in h if K <= i])))"
] | false | 0.055363 | 0.039341 | 1.407255 | [
"s450849770",
"s932675529"
] |
u460245024 | p03102 | python | s401785677 | s845359138 | 22 | 17 | 3,444 | 3,064 | Accepted | Accepted | 22.73 | import copy
N, M, C = list(map(int, input().split()))
B = list(map(int, input().split()))
As = []
for i in range(N):
As.append(list(map(int, input().split())))
correct_answer_num = 0
for A in As:
result = 0
for j in range(M):
result += A[j] * B[j]
result += C
if result > ... | N, M, C = list(map(int, input().split()))
B = list(map(int, input().split()))
As = []
for i in range(N):
As.append(list(map(int, input().split())))
correct_answer_num = 0
for A in As:
result = 0
for j in range(M):
result += A[j] * B[j]
result += C
if result > 0:
cor... | 20 | 18 | 392 | 377 | import copy
N, M, C = list(map(int, input().split()))
B = list(map(int, input().split()))
As = []
for i in range(N):
As.append(list(map(int, input().split())))
correct_answer_num = 0
for A in As:
result = 0
for j in range(M):
result += A[j] * B[j]
result += C
if result > 0:
correct_... | N, M, C = list(map(int, input().split()))
B = list(map(int, input().split()))
As = []
for i in range(N):
As.append(list(map(int, input().split())))
correct_answer_num = 0
for A in As:
result = 0
for j in range(M):
result += A[j] * B[j]
result += C
if result > 0:
correct_answer_num +=... | false | 10 | [
"-import copy",
"-"
] | false | 0.052207 | 0.052339 | 0.997483 | [
"s401785677",
"s845359138"
] |
u814986259 | p03546 | python | s382473517 | s605924423 | 386 | 211 | 3,828 | 14,040 | Accepted | Accepted | 45.34 | import copy
H, W = list(map(int, input().split()))
c = [list(map(int, input().split())) for i in range(10)]
A = [list(map(int, input().split())) for i in range(H)]
# cost = [[-1]*10 for i in range(10)]
# for j in range(10):
# cost[j] = [[c[i][j], i] for i in range(10)]
cost = [-1]*10
cost[1] = 0
dp = [[-... | from scipy.sparse.csgraph import floyd_warshall, csgraph_from_dense
H, W = list(map(int, input().split()))
c = [tuple(map(int, input().split())) for i in range(10)]
A = [list(map(int, input().split())) for i in range(H)]
G = csgraph_from_dense(c)
C = floyd_warshall(G)
ans = 0
for i in range(H):
for j in r... | 55 | 14 | 1,359 | 402 | import copy
H, W = list(map(int, input().split()))
c = [list(map(int, input().split())) for i in range(10)]
A = [list(map(int, input().split())) for i in range(H)]
# cost = [[-1]*10 for i in range(10)]
# for j in range(10):
# cost[j] = [[c[i][j], i] for i in range(10)]
cost = [-1] * 10
cost[1] = 0
dp = [[-1] * 10 ... | from scipy.sparse.csgraph import floyd_warshall, csgraph_from_dense
H, W = list(map(int, input().split()))
c = [tuple(map(int, input().split())) for i in range(10)]
A = [list(map(int, input().split())) for i in range(H)]
G = csgraph_from_dense(c)
C = floyd_warshall(G)
ans = 0
for i in range(H):
for j in range(W):
... | false | 74.545455 | [
"-import copy",
"+from scipy.sparse.csgraph import floyd_warshall, csgraph_from_dense",
"-c = [list(map(int, input().split())) for i in range(10)]",
"+c = [tuple(map(int, input().split())) for i in range(10)]",
"-# cost = [[-1]*10 for i in range(10)]",
"-# for j in range(10):",
"-# cost[j] = [[c[i][... | false | 0.225719 | 0.361101 | 0.625087 | [
"s382473517",
"s605924423"
] |
u377989038 | p03073 | python | s375123285 | s053502999 | 78 | 63 | 3,188 | 3,188 | Accepted | Accepted | 19.23 | s = eval(input())
a = ""
cnt, cnt_ = 0, 0
while len(a) <= len(s):
a += "10"
for i in range(len(s)):
if s[i] != a[i]:
cnt += 1
if s[i] != a[i + 1]:
cnt_ += 1
print((min(cnt, cnt_))) | s = eval(input())
cnt, cnt_ = 0, 0
a = "10" * (len(s)//2+1)
for i in range(len(s)):
if s[i] != a[i]:
cnt += 1
if s[i] != a[i + 1]:
cnt_ += 1
print((min(cnt, cnt_))) | 12 | 9 | 212 | 188 | s = eval(input())
a = ""
cnt, cnt_ = 0, 0
while len(a) <= len(s):
a += "10"
for i in range(len(s)):
if s[i] != a[i]:
cnt += 1
if s[i] != a[i + 1]:
cnt_ += 1
print((min(cnt, cnt_)))
| s = eval(input())
cnt, cnt_ = 0, 0
a = "10" * (len(s) // 2 + 1)
for i in range(len(s)):
if s[i] != a[i]:
cnt += 1
if s[i] != a[i + 1]:
cnt_ += 1
print((min(cnt, cnt_)))
| false | 25 | [
"-a = \"\"",
"-while len(a) <= len(s):",
"- a += \"10\"",
"+a = \"10\" * (len(s) // 2 + 1)"
] | false | 0.036566 | 0.041654 | 0.877845 | [
"s375123285",
"s053502999"
] |
u075012704 | p03488 | python | s412407887 | s505777594 | 1,493 | 382 | 3,816 | 49,116 | Accepted | Accepted | 74.41 | S = [len(s) for s in input().split("T")]
X, Y = list(map(int, input().split()))
# X方向・Y方向の移動成分
X_move = S[2::2]
Y_move = S[1::2]
# X方向・Y方法の到達可能な場所
X_reached = {S[0]}
Y_reached = {0}
# 到達可能な場所を計算
for xm in X_move:
tmp = set()
for xr in X_reached:
tmp.add(xr + xm)
tmp.add(xr - x... | S = eval(input())
X, Y = list(map(int, input().split()))
X_move = [len(s) for s in S.split("T")[::2]]
Y_move = [len(s) for s in S.split("T")[1::2]]
X_reached = {X_move.pop(0)}
Y_reached = {0}
for x in X_move:
tmp = set()
for nx in X_reached:
tmp.add(nx + x)
tmp.add(nx - x)
X... | 27 | 24 | 540 | 524 | S = [len(s) for s in input().split("T")]
X, Y = list(map(int, input().split()))
# X方向・Y方向の移動成分
X_move = S[2::2]
Y_move = S[1::2]
# X方向・Y方法の到達可能な場所
X_reached = {S[0]}
Y_reached = {0}
# 到達可能な場所を計算
for xm in X_move:
tmp = set()
for xr in X_reached:
tmp.add(xr + xm)
tmp.add(xr - xm)
X_reached = ... | S = eval(input())
X, Y = list(map(int, input().split()))
X_move = [len(s) for s in S.split("T")[::2]]
Y_move = [len(s) for s in S.split("T")[1::2]]
X_reached = {X_move.pop(0)}
Y_reached = {0}
for x in X_move:
tmp = set()
for nx in X_reached:
tmp.add(nx + x)
tmp.add(nx - x)
X_reached = tmp
fo... | false | 11.111111 | [
"-S = [len(s) for s in input().split(\"T\")]",
"+S = eval(input())",
"-# X方向・Y方向の移動成分",
"-X_move = S[2::2]",
"-Y_move = S[1::2]",
"-# X方向・Y方法の到達可能な場所",
"-X_reached = {S[0]}",
"+X_move = [len(s) for s in S.split(\"T\")[::2]]",
"+Y_move = [len(s) for s in S.split(\"T\")[1::2]]",
"+X_reached = {X_mov... | false | 0.038456 | 0.038738 | 0.992725 | [
"s412407887",
"s505777594"
] |
u844005364 | p03061 | python | s345702823 | s811931755 | 839 | 192 | 14,588 | 14,584 | Accepted | Accepted | 77.12 |
n = int(eval(input()))
a = list(map(int, input().split()))
a.sort(reverse=True)
from functools import lru_cache
import sys
if n == 2:
print((max(a)))
sys.exit()
@lru_cache(maxsize=100000)
def gcd(x, y):
while y:
x, y = y, x % y
return x
def gcd_list(li):
if len(... |
n = int(eval(input()))
a = list(map(int, input().split()))
import sys
if n == 2:
print((max(a)))
sys.exit()
def gcd(x, y):
while y:
x, y = y, x % y
return x
g = a[0]
gcd_left = [g]
for i in range(n-1):
g = gcd(g, a[i+1])
gcd_left.append(g)
g = a[n-1]
gcd_r... | 55 | 35 | 1,043 | 575 | n = int(eval(input()))
a = list(map(int, input().split()))
a.sort(reverse=True)
from functools import lru_cache
import sys
if n == 2:
print((max(a)))
sys.exit()
@lru_cache(maxsize=100000)
def gcd(x, y):
while y:
x, y = y, x % y
return x
def gcd_list(li):
if len(li) == 1:
return ... | n = int(eval(input()))
a = list(map(int, input().split()))
import sys
if n == 2:
print((max(a)))
sys.exit()
def gcd(x, y):
while y:
x, y = y, x % y
return x
g = a[0]
gcd_left = [g]
for i in range(n - 1):
g = gcd(g, a[i + 1])
gcd_left.append(g)
g = a[n - 1]
gcd_right = [g]
for i in r... | false | 36.363636 | [
"-a.sort(reverse=True)",
"-from functools import lru_cache",
"-@lru_cache(maxsize=100000)",
"-def gcd_list(li):",
"- if len(li) == 1:",
"- return li[0]",
"- g = gcd(li[0], li[1])",
"- for i in range(2, len(li)):",
"- g = gcd(g, li[i])",
"- return g",
"-",
"-",
"-def... | false | 0.007787 | 0.044755 | 0.173993 | [
"s345702823",
"s811931755"
] |
u644907318 | p02718 | python | s523546894 | s846616606 | 181 | 63 | 38,256 | 62,080 | Accepted | Accepted | 65.19 | N,M = list(map(int,input().split()))
A = sorted(list(map(int,input().split())),reverse=True)
if A[M-1]>=sum(A)/(4*M):
print("Yes")
else:
print("No") | import math
N,M = list(map(int,input().split()))
A = list(map(int,input().split()))
a = sum(A)
b = math.ceil(a/(4*M))
cnt = 0
for i in range(N):
if A[i]>=b:
cnt += 1
if cnt>=M:
print("Yes")
else:
print("No") | 6 | 13 | 155 | 233 | N, M = list(map(int, input().split()))
A = sorted(list(map(int, input().split())), reverse=True)
if A[M - 1] >= sum(A) / (4 * M):
print("Yes")
else:
print("No")
| import math
N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
a = sum(A)
b = math.ceil(a / (4 * M))
cnt = 0
for i in range(N):
if A[i] >= b:
cnt += 1
if cnt >= M:
print("Yes")
else:
print("No")
| false | 53.846154 | [
"+import math",
"+",
"-A = sorted(list(map(int, input().split())), reverse=True)",
"-if A[M - 1] >= sum(A) / (4 * M):",
"+A = list(map(int, input().split()))",
"+a = sum(A)",
"+b = math.ceil(a / (4 * M))",
"+cnt = 0",
"+for i in range(N):",
"+ if A[i] >= b:",
"+ cnt += 1",
"+if cnt >... | false | 0.036652 | 0.037796 | 0.969733 | [
"s523546894",
"s846616606"
] |
u729133443 | p02891 | python | s409763107 | s183783690 | 169 | 20 | 38,384 | 3,188 | Accepted | Accepted | 88.17 | from itertools import*
s,k=open(0)
k,x=int(k),0
g=[len(list(v))for _,v in groupby(s)]
for c in g:x+=c//2
x*=k
if(s[0]==s[-2])*g[0]%2&g[-2]%2:x+=k//2if-len(s)==~g[0]else k-1
print(x) | from itertools import*
s,k=open(0)
k=int(k)
g=[len(list(v))for _,v in groupby(s)]
print((sum(c//2for c in g)*k+((s[0]==s[-2])*g[0]%2&g[-2]%2)*(k//2*(-len(s)==~g[0])or k-1))) | 8 | 5 | 188 | 175 | from itertools import *
s, k = open(0)
k, x = int(k), 0
g = [len(list(v)) for _, v in groupby(s)]
for c in g:
x += c // 2
x *= k
if (s[0] == s[-2]) * g[0] % 2 & g[-2] % 2:
x += k // 2 if -len(s) == ~g[0] else k - 1
print(x)
| from itertools import *
s, k = open(0)
k = int(k)
g = [len(list(v)) for _, v in groupby(s)]
print(
(
sum(c // 2 for c in g) * k
+ ((s[0] == s[-2]) * g[0] % 2 & g[-2] % 2)
* (k // 2 * (-len(s) == ~g[0]) or k - 1)
)
)
| false | 37.5 | [
"-k, x = int(k), 0",
"+k = int(k)",
"-for c in g:",
"- x += c // 2",
"-x *= k",
"-if (s[0] == s[-2]) * g[0] % 2 & g[-2] % 2:",
"- x += k // 2 if -len(s) == ~g[0] else k - 1",
"-print(x)",
"+print(",
"+ (",
"+ sum(c // 2 for c in g) * k",
"+ + ((s[0] == s[-2]) * g[0] % 2 ... | false | 0.041002 | 0.040003 | 1.024972 | [
"s409763107",
"s183783690"
] |
u392319141 | p03291 | python | s649501804 | s726923844 | 506 | 94 | 27,600 | 3,188 | Accepted | Accepted | 81.42 | S = eval(input())
N = len(S)
MOD = 10**9 + 7
mask = 'ABC'
dp = [[0,0,0,0] for _ in range(N+1)]
for i in range(N, -1, -1) :
for j in range(4) :
if i == N :
if j == 3 :
dp[i][j] = 1
else :
dp[i][j] = 0
else :
if j == ... | S = eval(input())
MOD = 10**9 + 7
A = 0
AB = 0
Q = 1
ans = 0
for s in S:
if s == '?':
ans = (3 * ans + AB) % MOD
AB = (3 * AB + A) % MOD
A = (3 * A + Q) % MOD
Q = Q * 3 % MOD
elif s == 'A':
A = (A + Q) % MOD
elif s == 'B':
AB = (AB + A) % MO... | 26 | 22 | 680 | 382 | S = eval(input())
N = len(S)
MOD = 10**9 + 7
mask = "ABC"
dp = [[0, 0, 0, 0] for _ in range(N + 1)]
for i in range(N, -1, -1):
for j in range(4):
if i == N:
if j == 3:
dp[i][j] = 1
else:
dp[i][j] = 0
else:
if j == 3:
... | S = eval(input())
MOD = 10**9 + 7
A = 0
AB = 0
Q = 1
ans = 0
for s in S:
if s == "?":
ans = (3 * ans + AB) % MOD
AB = (3 * AB + A) % MOD
A = (3 * A + Q) % MOD
Q = Q * 3 % MOD
elif s == "A":
A = (A + Q) % MOD
elif s == "B":
AB = (AB + A) % MOD
elif s == "C"... | false | 15.384615 | [
"-N = len(S)",
"-mask = \"ABC\"",
"-dp = [[0, 0, 0, 0] for _ in range(N + 1)]",
"-for i in range(N, -1, -1):",
"- for j in range(4):",
"- if i == N:",
"- if j == 3:",
"- dp[i][j] = 1",
"- else:",
"- dp[i][j] = 0",
"- else:",
... | false | 0.088606 | 0.115499 | 0.767159 | [
"s649501804",
"s726923844"
] |
u579699847 | p02861 | python | s982561815 | s630664622 | 1,520 | 1,375 | 14,508 | 14,496 | Accepted | Accepted | 9.54 | import itertools,math,numpy as np
def I(): return int(eval(input()))
def LI(): return list(map(int,input().split()))
N = I()
xy = np.array([LI() for _ in range(N)])
sum_norm = 0
dict_norm = {}
for a in itertools.permutations(list(range(N))):
for i in range(len(a)-1):
vector = xy[a[i+1]]-xy[a[i]]
... | import itertools,math,numpy as np
def I(): return int(eval(input()))
def LI(): return list(map(int,input().split()))
N = I()
xy = np.array([LI() for _ in range(N)])
sum_norm = 0
dict_norm = {}
for a in itertools.permutations(list(range(N))):
for i in range(len(a)-1):
vector = tuple(xy[a[i+1]]-xy[a[... | 14 | 14 | 494 | 480 | import itertools, math, numpy as np
def I():
return int(eval(input()))
def LI():
return list(map(int, input().split()))
N = I()
xy = np.array([LI() for _ in range(N)])
sum_norm = 0
dict_norm = {}
for a in itertools.permutations(list(range(N))):
for i in range(len(a) - 1):
vector = xy[a[i + 1]]... | import itertools, math, numpy as np
def I():
return int(eval(input()))
def LI():
return list(map(int, input().split()))
N = I()
xy = np.array([LI() for _ in range(N)])
sum_norm = 0
dict_norm = {}
for a in itertools.permutations(list(range(N))):
for i in range(len(a) - 1):
vector = tuple(xy[a[i... | false | 0 | [
"- vector = xy[a[i + 1]] - xy[a[i]]",
"- if not tuple(vector) in dict_norm:",
"- dict_norm[tuple(vector)] = np.linalg.norm(vector)",
"- sum_norm += dict_norm[tuple(vector)]",
"+ vector = tuple(xy[a[i + 1]] - xy[a[i]])",
"+ if not vector in dict_norm:",
"+ ... | false | 0.203176 | 0.19444 | 1.044927 | [
"s982561815",
"s630664622"
] |
u509830642 | p03011 | python | s161646149 | s335083892 | 164 | 21 | 38,256 | 2,940 | Accepted | Accepted | 87.2 | T = eval(input())
data = T.split()
data_int = list(map(int, data))
data_int.sort()
print((data_int[0] + data_int[1])) | import sys
input = sys.stdin.readline
def print_ans(ar):
"""Test Case
>>> print_ans([1, 3, 4])
4
>>> print_ans([3, 2, 3])
5
"""
print((sum(ar) - max(ar)))
if __name__ == '__main__':
ar = list(map(int, input().rstrip().split()))
print_ans(ar)
| 5 | 16 | 113 | 294 | T = eval(input())
data = T.split()
data_int = list(map(int, data))
data_int.sort()
print((data_int[0] + data_int[1]))
| import sys
input = sys.stdin.readline
def print_ans(ar):
"""Test Case
>>> print_ans([1, 3, 4])
4
>>> print_ans([3, 2, 3])
5
"""
print((sum(ar) - max(ar)))
if __name__ == "__main__":
ar = list(map(int, input().rstrip().split()))
print_ans(ar)
| false | 68.75 | [
"-T = eval(input())",
"-data = T.split()",
"-data_int = list(map(int, data))",
"-data_int.sort()",
"-print((data_int[0] + data_int[1]))",
"+import sys",
"+",
"+input = sys.stdin.readline",
"+",
"+",
"+def print_ans(ar):",
"+ \"\"\"Test Case",
"+ >>> print_ans([1, 3, 4])",
"+ 4",
... | false | 0.090356 | 0.039349 | 2.296281 | [
"s161646149",
"s335083892"
] |
u498487134 | p02863 | python | s714435040 | s886102295 | 871 | 532 | 178,308 | 115,928 | Accepted | Accepted | 38.92 | N,T = list(map(int,input().split()))
A = [0]*N
B = [0]*N
for i in range(N):
A[i],B[i] = list(map(int,input().split()))
# T-1分以内に完食を目指す,特定の料理のみ使わないで計算したい.
#DP1[i][t]はi番目の料理まででt分後までに完食で得られる幸福度の最大(商品番号は1から振る)
#DP2[i][t]はiからN番目の料理でt分後までに完食で得られる幸福度の最大
dp1 =[[0]*T for _ in range(N+1)]
dp2 =[[0]*T for _ in ra... | #Aをソートしておく,時間ギリギリにi番目の料理を頼むことで固定.
N,T = list(map(int,input().split()))
AB = [[0,0] for _ in range(N)]
for i in range(N):
AB[i][0],AB[i][1] = list(map(int,input().split()))
AB.sort()
#ソートした時のbの情報を維持しないと
# T-1分以内にi番目以外の料理をできるだけ完食する
#DP1[i][t]はi番目の料理まででt分後までに完食で得られる幸福度の最大(商品番号は1から振る)
dp1 =[[0]*T for... | 33 | 26 | 806 | 592 | N, T = list(map(int, input().split()))
A = [0] * N
B = [0] * N
for i in range(N):
A[i], B[i] = list(map(int, input().split()))
# T-1分以内に完食を目指す,特定の料理のみ使わないで計算したい.
# DP1[i][t]はi番目の料理まででt分後までに完食で得られる幸福度の最大(商品番号は1から振る)
# DP2[i][t]はiからN番目の料理でt分後までに完食で得られる幸福度の最大
dp1 = [[0] * T for _ in range(N + 1)]
dp2 = [[0] * T for _ ... | # Aをソートしておく,時間ギリギリにi番目の料理を頼むことで固定.
N, T = list(map(int, input().split()))
AB = [[0, 0] for _ in range(N)]
for i in range(N):
AB[i][0], AB[i][1] = list(map(int, input().split()))
AB.sort()
# ソートした時のbの情報を維持しないと
# T-1分以内にi番目以外の料理をできるだけ完食する
# DP1[i][t]はi番目の料理まででt分後までに完食で得られる幸福度の最大(商品番号は1から振る)
dp1 = [[0] * T for _ in ra... | false | 21.212121 | [
"+# Aをソートしておく,時間ギリギリにi番目の料理を頼むことで固定.",
"-A = [0] * N",
"-B = [0] * N",
"+AB = [[0, 0] for _ in range(N)]",
"- A[i], B[i] = list(map(int, input().split()))",
"-# T-1分以内に完食を目指す,特定の料理のみ使わないで計算したい.",
"+ AB[i][0], AB[i][1] = list(map(int, input().split()))",
"+AB.sort()",
"+# ソートした時のbの情報を維持しないと",
... | false | 0.050161 | 0.04907 | 1.022246 | [
"s714435040",
"s886102295"
] |
u350997995 | p03212 | python | s881927526 | s558509947 | 152 | 87 | 3,060 | 3,436 | Accepted | Accepted | 42.76 | N = int(eval(input()))
s = "357"
cnt = 0
for i in range(1,10):
for j in range(3**i):
n = j
t = ""
for k in range(i):
t+=s[n%3]
n//=3
if len(set(t))!=3:continue
if int(t)<=N:cnt+=1
print(cnt) | from collections import deque
N = int(eval(input()))
ans = 0
A = "357"
Q = deque(["3","5","7"])
while Q:
q = Q.pop()
x = int(q)
if x>N:continue
if len(set(q))==3:ans+=1
for a in A:
Q.append(q+a)
print(ans) | 13 | 13 | 264 | 239 | N = int(eval(input()))
s = "357"
cnt = 0
for i in range(1, 10):
for j in range(3**i):
n = j
t = ""
for k in range(i):
t += s[n % 3]
n //= 3
if len(set(t)) != 3:
continue
if int(t) <= N:
cnt += 1
print(cnt)
| from collections import deque
N = int(eval(input()))
ans = 0
A = "357"
Q = deque(["3", "5", "7"])
while Q:
q = Q.pop()
x = int(q)
if x > N:
continue
if len(set(q)) == 3:
ans += 1
for a in A:
Q.append(q + a)
print(ans)
| false | 0 | [
"+from collections import deque",
"+",
"-s = \"357\"",
"-cnt = 0",
"-for i in range(1, 10):",
"- for j in range(3**i):",
"- n = j",
"- t = \"\"",
"- for k in range(i):",
"- t += s[n % 3]",
"- n //= 3",
"- if len(set(t)) != 3:",
"- ... | false | 0.150492 | 0.048144 | 3.125853 | [
"s881927526",
"s558509947"
] |
u704216644 | p03003 | python | s939966521 | s825839801 | 647 | 292 | 126,172 | 42,348 | Accepted | Accepted | 54.87 | N, M = list(map(int, input().split()))
S = list(map(int, input().split()))
T = list(map(int, input().split()))
dp = [1] * (M+1)
dpleft = [0] * (M)
MOD = 10 ** 9 + 7
ndp = [1] * (M+1)
for n in range(N):
for m in range(M):
if S[n] == T[m]:
ndp[m+1] = ndp[m] + dp[m+1]
dpleft[... | N, M = list(map(int, input().split()))
S = list(map(int, input().split()))
T = list(map(int, input().split()))
dp = [1] * (M+1)
dpleft = [0] * (M)
MOD = 10 ** 9 + 7
ndp = [1] * (M+1)
for n in range(N):
for m in range(M):
if S[n] == T[m]:
ndp[m+1] = (ndp[m] + dp[m+1]) % MOD
... | 17 | 17 | 449 | 461 | N, M = list(map(int, input().split()))
S = list(map(int, input().split()))
T = list(map(int, input().split()))
dp = [1] * (M + 1)
dpleft = [0] * (M)
MOD = 10**9 + 7
ndp = [1] * (M + 1)
for n in range(N):
for m in range(M):
if S[n] == T[m]:
ndp[m + 1] = ndp[m] + dp[m + 1]
dpleft[m] = ... | N, M = list(map(int, input().split()))
S = list(map(int, input().split()))
T = list(map(int, input().split()))
dp = [1] * (M + 1)
dpleft = [0] * (M)
MOD = 10**9 + 7
ndp = [1] * (M + 1)
for n in range(N):
for m in range(M):
if S[n] == T[m]:
ndp[m + 1] = (ndp[m] + dp[m + 1]) % MOD
dple... | false | 0 | [
"- ndp[m + 1] = ndp[m] + dp[m + 1]",
"+ ndp[m + 1] = (ndp[m] + dp[m + 1]) % MOD",
"- ndp[m + 1] = ndp[m] + dpleft[m]",
"+ ndp[m + 1] = (ndp[m] + dpleft[m]) % MOD",
"- dp[M] = ndp[M]",
"-print((dp[-1] % MOD))",
"+ dp[-1] = ndp[-1]",
"+print((dp[-1]))"
] | false | 0.085638 | 0.038108 | 2.247238 | [
"s939966521",
"s825839801"
] |
u327532412 | p02623 | python | s559569783 | s328245299 | 325 | 282 | 47,352 | 47,060 | Accepted | Accepted | 13.23 | from bisect import bisect
N, M, K = list(map(int, input().split()))
*A, = list(map(int, input().split()))
*B, = list(map(int, input().split()))
a = [0] * (N+1)
b = [0] * (M+1)
for i in range(N):
a[i+1] = a[i] + A[i]
for i in range(M):
b[i+1] = b[i] + B[i]
ans = 0
for i in range(N+1):
tmp = K - a... | N, M, K = list(map(int, input().split()))
*A, = list(map(int, input().split()))
*B, = list(map(int, input().split()))
a = [0] * (N+1)
b = [0] * (M+1)
for i in range(N):
a[i+1] = a[i] + A[i]
for i in range(M):
b[i+1] = b[i] + B[i]
ans = 0
j = M
for i in range(N+1):
if a[i] > K:
break
... | 17 | 18 | 393 | 381 | from bisect import bisect
N, M, K = list(map(int, input().split()))
(*A,) = list(map(int, input().split()))
(*B,) = list(map(int, input().split()))
a = [0] * (N + 1)
b = [0] * (M + 1)
for i in range(N):
a[i + 1] = a[i] + A[i]
for i in range(M):
b[i + 1] = b[i] + B[i]
ans = 0
for i in range(N + 1):
tmp = K ... | N, M, K = list(map(int, input().split()))
(*A,) = list(map(int, input().split()))
(*B,) = list(map(int, input().split()))
a = [0] * (N + 1)
b = [0] * (M + 1)
for i in range(N):
a[i + 1] = a[i] + A[i]
for i in range(M):
b[i + 1] = b[i] + B[i]
ans = 0
j = M
for i in range(N + 1):
if a[i] > K:
break
... | false | 5.555556 | [
"-from bisect import bisect",
"-",
"+j = M",
"- tmp = K - a[i]",
"- if tmp < 0:",
"+ if a[i] > K:",
"- ans = max(ans, i + bisect(b, tmp) - 1)",
"+ while b[j] > K - a[i]:",
"+ j -= 1",
"+ ans = max(ans, i + j)"
] | false | 0.047345 | 0.043782 | 1.08138 | [
"s559569783",
"s328245299"
] |
u350997995 | p03112 | python | s135751405 | s558058674 | 1,960 | 1,136 | 16,880 | 17,400 | Accepted | Accepted | 42.04 | def search(x, l, first, end):
if end-first<=1:
if x<l[first]:
return -1
elif x>l[end]:
return end
else:
return first
middle = (first+end)//2
if x >= l[middle]:
return search(x, l, middle, end)
else:
return search(x, ... | import bisect
A,B,Q = list(map(int,input().split()))
INF = 10**18
s = [-INF]+[int(eval(input())) for i in range(A)]+[INF]
t = [-INF]+[int(eval(input())) for i in range(B)]+[INF]
s.sort()
t.sort()
answer = []
for i in range(Q):
x = int(eval(input()))
sk = bisect.bisect_left(s,x)-1
tk = bisect.bise... | 31 | 19 | 975 | 672 | def search(x, l, first, end):
if end - first <= 1:
if x < l[first]:
return -1
elif x > l[end]:
return end
else:
return first
middle = (first + end) // 2
if x >= l[middle]:
return search(x, l, middle, end)
else:
return search(x, ... | import bisect
A, B, Q = list(map(int, input().split()))
INF = 10**18
s = [-INF] + [int(eval(input())) for i in range(A)] + [INF]
t = [-INF] + [int(eval(input())) for i in range(B)] + [INF]
s.sort()
t.sort()
answer = []
for i in range(Q):
x = int(eval(input()))
sk = bisect.bisect_left(s, x) - 1
tk = bisect.... | false | 38.709677 | [
"-def search(x, l, first, end):",
"- if end - first <= 1:",
"- if x < l[first]:",
"- return -1",
"- elif x > l[end]:",
"- return end",
"- else:",
"- return first",
"- middle = (first + end) // 2",
"- if x >= l[middle]:",
"- re... | false | 0.037297 | 0.037738 | 0.988325 | [
"s135751405",
"s558058674"
] |
u786793781 | p02936 | python | s189447921 | s723111721 | 1,949 | 1,783 | 74,768 | 62,232 | Accepted | Accepted | 8.52 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from collections import deque
# N: ノードの数
# Q: 数値をノードに付与する回数
N, Q = list(map(int, input().split()))
links = [[] for _ in range(N)]
values = [0 for _ in range(N)]
for i in range(N - 1):
edge1, edge2 = [x - 1 for x in list(map(int, input().split()))]
... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from collections import deque
# N: ノードの数
# Q: 数値をノードに付与する回数
N, Q = list(map(int, input().split()))
links = [[] for _ in range(N)]
values = [0] * N
for i in range(N - 1):
edge1, edge2 = [x - 1 for x in map(int, input().split())]
links[edge1].appen... | 35 | 35 | 803 | 771 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from collections import deque
# N: ノードの数
# Q: 数値をノードに付与する回数
N, Q = list(map(int, input().split()))
links = [[] for _ in range(N)]
values = [0 for _ in range(N)]
for i in range(N - 1):
edge1, edge2 = [x - 1 for x in list(map(int, input().split()))]
links[edge1].app... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from collections import deque
# N: ノードの数
# Q: 数値をノードに付与する回数
N, Q = list(map(int, input().split()))
links = [[] for _ in range(N)]
values = [0] * N
for i in range(N - 1):
edge1, edge2 = [x - 1 for x in map(int, input().split())]
links[edge1].append(edge2)
links... | false | 0 | [
"-values = [0 for _ in range(N)]",
"+values = [0] * N",
"- edge1, edge2 = [x - 1 for x in list(map(int, input().split()))]",
"+ edge1, edge2 = [x - 1 for x in map(int, input().split())]"
] | false | 0.089689 | 0.092741 | 0.967094 | [
"s189447921",
"s723111721"
] |
u237094818 | p02388 | python | s446401665 | s654532191 | 20 | 10 | 7,600 | 4,636 | Accepted | Accepted | 50 |
number = int(eval(input()))
number3 = number*number*number
print(number3) | # -*- coding: utf-8
x = eval(input())
y = x*x*x
print(y)
| 6 | 5 | 75 | 56 | number = int(eval(input()))
number3 = number * number * number
print(number3)
| # -*- coding: utf-8
x = eval(input())
y = x * x * x
print(y)
| false | 16.666667 | [
"-number = int(eval(input()))",
"-number3 = number * number * number",
"-print(number3)",
"+# -*- coding: utf-8",
"+x = eval(input())",
"+y = x * x * x",
"+print(y)"
] | false | 0.040383 | 0.040445 | 0.998454 | [
"s446401665",
"s654532191"
] |
u266014018 | p03821 | python | s306070969 | s471307985 | 1,122 | 310 | 36,124 | 36,244 | Accepted | Accepted | 72.37 | def main():
import sys
def input(): return sys.stdin.readline().rstrip()
n = int(eval(input()))
A = []
B = []
for _ in range(n):
a,b = list(map(int, input().split()))
A.append(a)
B.append(b)
import numpy as np
a = np.array(A[::-1], dtype=int)
ans =... | def main():
import sys
def input(): return sys.stdin.readline().rstrip()
n = int(eval(input()))
A = []
B = []
for _ in range(n):
a,b = list(map(int, input().split()))
A.append(a)
B.append(b)
import numpy as np
a = np.array(A[::-1], dtype=int)
ans =... | 24 | 23 | 489 | 479 | def main():
import sys
def input():
return sys.stdin.readline().rstrip()
n = int(eval(input()))
A = []
B = []
for _ in range(n):
a, b = list(map(int, input().split()))
A.append(a)
B.append(b)
import numpy as np
a = np.array(A[::-1], dtype=int)
ans =... | def main():
import sys
def input():
return sys.stdin.readline().rstrip()
n = int(eval(input()))
A = []
B = []
for _ in range(n):
a, b = list(map(int, input().split()))
A.append(a)
B.append(b)
import numpy as np
a = np.array(A[::-1], dtype=int)
ans =... | false | 4.166667 | [
"- tmp = (b - a[i] % b) % b",
"- a[i:] += tmp",
"+ tmp = (b - (a[i] + ans) % b) % b"
] | false | 0.419365 | 0.318675 | 1.315964 | [
"s306070969",
"s471307985"
] |
u391819434 | p03993 | python | s535824248 | s956032161 | 75 | 65 | 13,880 | 13,940 | Accepted | Accepted | 13.33 | N=int(eval(input()))
*A,=list(map(int,input().split()))
i=0
ans=0
while i<N:
if i+1==A[A[i]-1]:
ans+=1
i+=1
print((ans//2)) | N,*A=list(map(int,open(0).read().split()))
print((sum(i+1==A[A[i]-1]for i in range(N))//2)) | 9 | 2 | 133 | 84 | N = int(eval(input()))
(*A,) = list(map(int, input().split()))
i = 0
ans = 0
while i < N:
if i + 1 == A[A[i] - 1]:
ans += 1
i += 1
print((ans // 2))
| N, *A = list(map(int, open(0).read().split()))
print((sum(i + 1 == A[A[i] - 1] for i in range(N)) // 2))
| false | 77.777778 | [
"-N = int(eval(input()))",
"-(*A,) = list(map(int, input().split()))",
"-i = 0",
"-ans = 0",
"-while i < N:",
"- if i + 1 == A[A[i] - 1]:",
"- ans += 1",
"- i += 1",
"-print((ans // 2))",
"+N, *A = list(map(int, open(0).read().split()))",
"+print((sum(i + 1 == A[A[i] - 1] for i in r... | false | 0.033335 | 0.034941 | 0.954047 | [
"s535824248",
"s956032161"
] |
u562935282 | p03289 | python | s091818654 | s796694531 | 19 | 17 | 3,064 | 3,064 | Accepted | Accepted | 10.53 | s = eval(input())
chrs = 'abcdefghijklmnopqrstuvwxyz'
p1 = (s[0] == 'A')
p2 = (s[2:-1].count('C') == 1)
p4 = (s[1] in chrs)
p5 = (s[-1] in chrs)
p3 = True
C_found = False
for i in range(2, len(s) - 1):
if not(s[i] in chrs):
if (s[i] == 'C'):
if C_found:
p3 = False... | def check(s):
if (s[0] != 'A'): return False
c = 0
for i in range(2, len(s) - 1):
if (s[i] == 'C'):
c += 1
if c != 1: return False
upper = 0
for i in range(len(s)):
if ('A' <= s[i] <= 'Z'):
upper += 1
if upper != 2: return False
... | 26 | 18 | 545 | 382 | s = eval(input())
chrs = "abcdefghijklmnopqrstuvwxyz"
p1 = s[0] == "A"
p2 = s[2:-1].count("C") == 1
p4 = s[1] in chrs
p5 = s[-1] in chrs
p3 = True
C_found = False
for i in range(2, len(s) - 1):
if not (s[i] in chrs):
if s[i] == "C":
if C_found:
p3 = False
break
... | def check(s):
if s[0] != "A":
return False
c = 0
for i in range(2, len(s) - 1):
if s[i] == "C":
c += 1
if c != 1:
return False
upper = 0
for i in range(len(s)):
if "A" <= s[i] <= "Z":
upper += 1
if upper != 2:
return False
r... | false | 30.769231 | [
"-s = eval(input())",
"-chrs = \"abcdefghijklmnopqrstuvwxyz\"",
"-p1 = s[0] == \"A\"",
"-p2 = s[2:-1].count(\"C\") == 1",
"-p4 = s[1] in chrs",
"-p5 = s[-1] in chrs",
"-p3 = True",
"-C_found = False",
"-for i in range(2, len(s) - 1):",
"- if not (s[i] in chrs):",
"+def check(s):",
"+ if ... | false | 0.072652 | 0.069333 | 1.04787 | [
"s091818654",
"s796694531"
] |
u974292946 | p03325 | python | s979334508 | s520294918 | 101 | 88 | 4,084 | 4,084 | Accepted | Accepted | 12.87 | n, *a = list(map(int, open(0).read().split()))
count = 0
for i in a:
if i % 2 == 0:
while i % 2 == 0:
if i % 2 == 0:
count += 1
i //= 2
else:
break
print(count) | n, *a = list(map(int, open(0).read().split()))
count = 0
for i in a:
while i % 2 == 0:
count += 1
i //= 2
print(count) | 13 | 7 | 252 | 150 | n, *a = list(map(int, open(0).read().split()))
count = 0
for i in a:
if i % 2 == 0:
while i % 2 == 0:
if i % 2 == 0:
count += 1
i //= 2
else:
break
print(count)
| n, *a = list(map(int, open(0).read().split()))
count = 0
for i in a:
while i % 2 == 0:
count += 1
i //= 2
print(count)
| false | 46.153846 | [
"- if i % 2 == 0:",
"- while i % 2 == 0:",
"- if i % 2 == 0:",
"- count += 1",
"- i //= 2",
"- else:",
"- break",
"+ while i % 2 == 0:",
"+ count += 1",
"+ i //= 2"
] | false | 0.038405 | 0.060501 | 0.634782 | [
"s979334508",
"s520294918"
] |
u095021077 | p02951 | python | s059533512 | s529252803 | 204 | 169 | 38,384 | 38,256 | Accepted | Accepted | 17.16 | temp=list(map(int, input().split()))
a=temp[2]-(temp[0]-temp[1])
if a>=0:
print(a)
else:
print((0)) | temp=list(map(int, input().split()))
temp=temp[2]-(temp[0]-temp[1])
if temp<0:
print((0))
else:
print((int(temp))) | 6 | 8 | 106 | 123 | temp = list(map(int, input().split()))
a = temp[2] - (temp[0] - temp[1])
if a >= 0:
print(a)
else:
print((0))
| temp = list(map(int, input().split()))
temp = temp[2] - (temp[0] - temp[1])
if temp < 0:
print((0))
else:
print((int(temp)))
| false | 25 | [
"-a = temp[2] - (temp[0] - temp[1])",
"-if a >= 0:",
"- print(a)",
"+temp = temp[2] - (temp[0] - temp[1])",
"+if temp < 0:",
"+ print((0))",
"- print((0))",
"+ print((int(temp)))"
] | false | 0.041782 | 0.036726 | 1.13768 | [
"s059533512",
"s529252803"
] |
u263830634 | p03972 | python | s218627969 | s013031964 | 323 | 284 | 11,592 | 11,592 | Accepted | Accepted | 12.07 | import sys
input = sys.stdin.readline
from bisect import bisect_left, bisect_right
W, H = list(map(int, input().split()))
P = [int(eval(input())) for _ in range(W)]
P.sort()
Q = [int(eval(input())) for _ in range(H)]
Q.sort()
ans = 0
for q in Q:
tmp = bisect_right(P, q)
# print ('tmp=', tmp)
... | def main():
import sys
input = sys.stdin.readline
from bisect import bisect_left, bisect_right
W, H = list(map(int, input().split()))
P = [int(eval(input())) for _ in range(W)]
P.sort()
Q = [int(eval(input())) for _ in range(H)]
Q.sort()
ans = 0
for q in Q:
... | 26 | 30 | 477 | 612 | import sys
input = sys.stdin.readline
from bisect import bisect_left, bisect_right
W, H = list(map(int, input().split()))
P = [int(eval(input())) for _ in range(W)]
P.sort()
Q = [int(eval(input())) for _ in range(H)]
Q.sort()
ans = 0
for q in Q:
tmp = bisect_right(P, q)
# print ('tmp=', tmp)
ans += q * (1... | def main():
import sys
input = sys.stdin.readline
from bisect import bisect_left, bisect_right
W, H = list(map(int, input().split()))
P = [int(eval(input())) for _ in range(W)]
P.sort()
Q = [int(eval(input())) for _ in range(H)]
Q.sort()
ans = 0
for q in Q:
tmp = bisect... | false | 13.333333 | [
"-import sys",
"+def main():",
"+ import sys",
"-input = sys.stdin.readline",
"-from bisect import bisect_left, bisect_right",
"+ input = sys.stdin.readline",
"+ from bisect import bisect_left, bisect_right",
"-W, H = list(map(int, input().split()))",
"-P = [int(eval(input())) for _ in rang... | false | 0.113221 | 0.043871 | 2.580792 | [
"s218627969",
"s013031964"
] |
u839537730 | p03994 | python | s678834657 | s815923916 | 176 | 99 | 4,156 | 4,152 | Accepted | Accepted | 43.75 | s = list(eval(input()))
K = int(eval(input()))
alphabet = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
for i in range(len(s)):
if K <=0 :
break
if (26 - alphabet.index(s[i])) <= K and s[i] != "a":
... | s = list(eval(input()))
K = int(eval(input()))
alphabet = "abcdefghijklmnopqrstuvwxyz"
for i in range(len(s)):
if (26 - alphabet.index(s[i])) <= K and (s[i] != "a"):
K -= (26 - alphabet.index(s[i]))
s[i] = "a"
if K <= 0:
break
if K > 0:
K = K % 26
... | 20 | 20 | 588 | 399 | s = list(eval(input()))
K = int(eval(input()))
alphabet = [
"a",
"b",
"c",
"d",
"e",
"f",
"g",
"h",
"i",
"j",
"k",
"l",
"m",
"n",
"o",
"p",
"q",
"r",
"s",
"t",
"u",
"v",
"w",
"x",
"y",
"z",
]
for i in range(len(s)):
... | s = list(eval(input()))
K = int(eval(input()))
alphabet = "abcdefghijklmnopqrstuvwxyz"
for i in range(len(s)):
if (26 - alphabet.index(s[i])) <= K and (s[i] != "a"):
K -= 26 - alphabet.index(s[i])
s[i] = "a"
if K <= 0:
break
if K > 0:
K = K % 26
idx = alphabet.index(s[-1]) + K
... | false | 0 | [
"-alphabet = [",
"- \"a\",",
"- \"b\",",
"- \"c\",",
"- \"d\",",
"- \"e\",",
"- \"f\",",
"- \"g\",",
"- \"h\",",
"- \"i\",",
"- \"j\",",
"- \"k\",",
"- \"l\",",
"- \"m\",",
"- \"n\",",
"- \"o\",",
"- \"p\",",
"- \"q\",",
"- \"... | false | 0.041399 | 0.040335 | 1.026381 | [
"s678834657",
"s815923916"
] |
u631277801 | p03999 | python | s121273585 | s190998829 | 19 | 17 | 3,064 | 3,064 | Accepted | Accepted | 10.53 | S = eval(input())
tf_str = ""
ans = 0
def dfs(tf_str,S):
global ans
if len(tf_str) != len(S)-1:
dfs(tf_str + "f",S)
dfs(tf_str + "t",S)
else:
frm = 0
for to in range(1,len(S)):
if tf_str[to-1] == "t":
ans += int(S[frm:to])
... | s = input()
d = len(s) - 1
def dfs(depth: int, cur:int, s: str, res: str) -> int:
if depth == d:
tmp = s + res[:1]
return cur + int(tmp)
else:
tmp = s + res[:1]
return dfs(depth+1, cur+int(tmp), "", res[1:]) \
+ dfs(depth+1, cur, tmp, res[1:])
... | 22 | 17 | 403 | 374 | S = eval(input())
tf_str = ""
ans = 0
def dfs(tf_str, S):
global ans
if len(tf_str) != len(S) - 1:
dfs(tf_str + "f", S)
dfs(tf_str + "t", S)
else:
frm = 0
for to in range(1, len(S)):
if tf_str[to - 1] == "t":
ans += int(S[frm:to])
... | s = input()
d = len(s) - 1
def dfs(depth: int, cur: int, s: str, res: str) -> int:
if depth == d:
tmp = s + res[:1]
return cur + int(tmp)
else:
tmp = s + res[:1]
return dfs(depth + 1, cur + int(tmp), "", res[1:]) + dfs(
depth + 1, cur, tmp, res[1:]
)
ans =... | false | 22.727273 | [
"-S = eval(input())",
"-tf_str = \"\"",
"-ans = 0",
"+s = input()",
"+d = len(s) - 1",
"-def dfs(tf_str, S):",
"- global ans",
"- if len(tf_str) != len(S) - 1:",
"- dfs(tf_str + \"f\", S)",
"- dfs(tf_str + \"t\", S)",
"+def dfs(depth: int, cur: int, s: str, res: str) -> int:"... | false | 0.0388 | 0.044539 | 0.871167 | [
"s121273585",
"s190998829"
] |
u391875425 | p03087 | python | s209601847 | s665123205 | 898 | 323 | 8,712 | 8,948 | Accepted | Accepted | 64.03 | from itertools import accumulate
N, Q = list(map(int, input().split()))
S = eval(input())
rs = [0] * N
for i in range(N - 1):
if S[i] + S[i + 1] == "AC":
rs[i + 1] = 1
rm = [0] + list(accumulate(rs))
for i in range(Q):
ans = 0
l, r = list(map(int, input().split()))
if S[l] == "C... | from itertools import accumulate
import sys
N, Q = list(map(int, input().split()))
S = eval(input())
rs = [0] * N
for i in range(N - 1):
if S[i] + S[i + 1] == "AC":
rs[i + 1] = 1
rm = [0] + list(accumulate(rs))
for i in range(Q):
ans = 0
l, r = list(map(int, sys.stdin.readline().spl... | 18 | 19 | 363 | 388 | from itertools import accumulate
N, Q = list(map(int, input().split()))
S = eval(input())
rs = [0] * N
for i in range(N - 1):
if S[i] + S[i + 1] == "AC":
rs[i + 1] = 1
rm = [0] + list(accumulate(rs))
for i in range(Q):
ans = 0
l, r = list(map(int, input().split()))
if S[l] == "C":
ans -... | from itertools import accumulate
import sys
N, Q = list(map(int, input().split()))
S = eval(input())
rs = [0] * N
for i in range(N - 1):
if S[i] + S[i + 1] == "AC":
rs[i + 1] = 1
rm = [0] + list(accumulate(rs))
for i in range(Q):
ans = 0
l, r = list(map(int, sys.stdin.readline().split()))
if S[... | false | 5.263158 | [
"+import sys",
"- l, r = list(map(int, input().split()))",
"+ l, r = list(map(int, sys.stdin.readline().split()))"
] | false | 0.042496 | 0.173533 | 0.244884 | [
"s209601847",
"s665123205"
] |
u962024525 | p02612 | python | s053469129 | s892842237 | 30 | 25 | 9,116 | 9,096 | Accepted | Accepted | 16.67 | m=int(eval(input()))
if m%1000==0:
print((0))
else:
print((1000-m%1000)) | m=int(eval(input()))
print(((1000-m%1000)%1000)) | 5 | 2 | 74 | 41 | m = int(eval(input()))
if m % 1000 == 0:
print((0))
else:
print((1000 - m % 1000))
| m = int(eval(input()))
print(((1000 - m % 1000) % 1000))
| false | 60 | [
"-if m % 1000 == 0:",
"- print((0))",
"-else:",
"- print((1000 - m % 1000))",
"+print(((1000 - m % 1000) % 1000))"
] | false | 0.044023 | 0.044162 | 0.99686 | [
"s053469129",
"s892842237"
] |
u936985471 | p03147 | python | s449477577 | s497630700 | 19 | 17 | 3,060 | 2,940 | Accepted | Accepted | 10.53 | N=int(eval(input()))
A=list(map(int,input().split()))
maxh=max(A)
ans=0
for i in range(1,maxh+1):
# i 以上の高さのブロック数をカウントする
block=0
cur=False
if A[0]>=i:
block+=1
cur=True
for j in range(1,len(A)):
if A[j]>=i:
if not cur:
block+=1
cur=True
else:
cur=... | N=int(eval(input()))
A=list(map(int,input().split()))
cur=0
ans=0
for i in range(N):
if A[i]>cur:
ans+=A[i]-cur
cur=A[i]
print(ans) | 22 | 9 | 348 | 141 | N = int(eval(input()))
A = list(map(int, input().split()))
maxh = max(A)
ans = 0
for i in range(1, maxh + 1):
# i 以上の高さのブロック数をカウントする
block = 0
cur = False
if A[0] >= i:
block += 1
cur = True
for j in range(1, len(A)):
if A[j] >= i:
if not cur:
bloc... | N = int(eval(input()))
A = list(map(int, input().split()))
cur = 0
ans = 0
for i in range(N):
if A[i] > cur:
ans += A[i] - cur
cur = A[i]
print(ans)
| false | 59.090909 | [
"-maxh = max(A)",
"+cur = 0",
"-for i in range(1, maxh + 1):",
"- # i 以上の高さのブロック数をカウントする",
"- block = 0",
"- cur = False",
"- if A[0] >= i:",
"- block += 1",
"- cur = True",
"- for j in range(1, len(A)):",
"- if A[j] >= i:",
"- if not cur:",
"- ... | false | 0.061062 | 0.036866 | 1.656318 | [
"s449477577",
"s497630700"
] |
u057109575 | p02598 | python | s199803989 | s393652393 | 185 | 170 | 94,108 | 104,172 | Accepted | Accepted | 8.11 |
N, K = list(map(int, input().split()))
X = list(map(int, input().split()))
ub = 10 ** 9 + 7
lb = 0
while ub - lb > 1:
mid = (ub + lb) // 2
res = 0
for v in X:
res += (v - 1) // mid
if res <= K:
ub = mid
else:
lb = mid
print(ub)
|
N, K = list(map(int, input().split()))
X = list(map(int, input().split()))
ub = 10 ** 9 + 7
lb = 0
while ub - lb > 1:
mid = (ub + lb) // 2
cnt = 0
for v in X:
cnt += -(-v // mid) - 1
if cnt <= K:
ub = mid
else:
lb = mid
print(ub)
| 19 | 19 | 289 | 291 | N, K = list(map(int, input().split()))
X = list(map(int, input().split()))
ub = 10**9 + 7
lb = 0
while ub - lb > 1:
mid = (ub + lb) // 2
res = 0
for v in X:
res += (v - 1) // mid
if res <= K:
ub = mid
else:
lb = mid
print(ub)
| N, K = list(map(int, input().split()))
X = list(map(int, input().split()))
ub = 10**9 + 7
lb = 0
while ub - lb > 1:
mid = (ub + lb) // 2
cnt = 0
for v in X:
cnt += -(-v // mid) - 1
if cnt <= K:
ub = mid
else:
lb = mid
print(ub)
| false | 0 | [
"- res = 0",
"+ cnt = 0",
"- res += (v - 1) // mid",
"- if res <= K:",
"+ cnt += -(-v // mid) - 1",
"+ if cnt <= K:"
] | false | 0.03753 | 0.037226 | 1.008164 | [
"s199803989",
"s393652393"
] |
u936985471 | p03213 | python | s631564387 | s640757730 | 26 | 21 | 3,444 | 3,316 | Accepted | Accepted | 19.23 | def factorization(n):
arr = []
temp = n
for i in range(2, int(-(-n**0.5//1))+1):
if temp%i==0:
cnt=0
while temp%i==0:
cnt+=1
temp //= i
arr.append([i, cnt])
if temp!=1:
arr.append([temp, 1])
if arr==[... | # 約数の数 = 素因数分解して、各素因数の(指数 + 1)をかけ合わせたもの
# 例:12 = 2^2 * 3^1 -> 3 * 2 = 6 (1,2,3,4,6,12)
# これが75になるためには、以下のペアを作れる必要がある。この組み合わせを数える
# 75 : 指数が74
# 3 * 25 : 指数が2 , 24
# 5 * 15 : 指数が4 , 14
# 3 * 5 * 5 : 指数が2,4,4
import sys
readline = sys.stdin.readline
N = int(readline())
def factorization(n):
res = []
... | 44 | 81 | 858 | 1,394 | def factorization(n):
arr = []
temp = n
for i in range(2, int(-(-(n**0.5) // 1)) + 1):
if temp % i == 0:
cnt = 0
while temp % i == 0:
cnt += 1
temp //= i
arr.append([i, cnt])
if temp != 1:
arr.append([temp, 1])
if ar... | # 約数の数 = 素因数分解して、各素因数の(指数 + 1)をかけ合わせたもの
# 例:12 = 2^2 * 3^1 -> 3 * 2 = 6 (1,2,3,4,6,12)
# これが75になるためには、以下のペアを作れる必要がある。この組み合わせを数える
# 75 : 指数が74
# 3 * 25 : 指数が2 , 24
# 5 * 15 : 指数が4 , 14
# 3 * 5 * 5 : 指数が2,4,4
import sys
readline = sys.stdin.readline
N = int(readline())
def factorization(n):
res = []
temp = n
... | false | 45.679012 | [
"+# 約数の数 = 素因数分解して、各素因数の(指数 + 1)をかけ合わせたもの",
"+# 例:12 = 2^2 * 3^1 -> 3 * 2 = 6 (1,2,3,4,6,12)",
"+# これが75になるためには、以下のペアを作れる必要がある。この組み合わせを数える",
"+# 75 : 指数が74",
"+# 3 * 25 : 指数が2 , 24",
"+# 5 * 15 : 指数が4 , 14",
"+# 3 * 5 * 5 : 指数が2,4,4",
"+import sys",
"+",
"+readline = sys.stdin.readline",
"+N = i... | false | 0.042471 | 0.042437 | 1.000804 | [
"s631564387",
"s640757730"
] |
u102461423 | p03305 | python | s651399075 | s312039062 | 1,545 | 1,240 | 63,828 | 78,388 | Accepted | Accepted | 19.74 | import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
import numpy as np
from heapq import heappush, heappop
N,M,S,T = map(int,input().split())
graph = [[] for _ in range(N+1)]
for _ in range(M):
u,v,a,b = map(int,input().split())
graph[u].append((v,a,b))
graph[v].append((u,a,b)... | import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
import numpy as np
from heapq import heappush, heappop
N,M,S,T = list(map(int,input().split()))
graph = [[] for _ in range(N+1)]
for _ in range(M):
u,v,a,b = list(map(int,input().split()))
graph[u].append((v,a,b))
graph[v].ap... | 37 | 36 | 866 | 876 | import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
import numpy as np
from heapq import heappush, heappop
N, M, S, T = map(int, input().split())
graph = [[] for _ in range(N + 1)]
for _ in range(M):
u, v, a, b = map(int, input().split())
graph[u].append((v, a, b))
graph[v].append((u, a, b)... | import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
import numpy as np
from heapq import heappush, heappop
N, M, S, T = list(map(int, input().split()))
graph = [[] for _ in range(N + 1)]
for _ in range(M):
u, v, a, b = list(map(int, input().split()))
graph[u].append((v, a, b))
graph[v].appe... | false | 2.702703 | [
"-N, M, S, T = map(int, input().split())",
"+N, M, S, T = list(map(int, input().split()))",
"- u, v, a, b = map(int, input().split())",
"+ u, v, a, b = list(map(int, input().split()))",
"-print(*answer, sep=\"\\n\")",
"+print((\"\\n\".join(answer.astype(str))))"
] | false | 0.337645 | 0.31021 | 1.088439 | [
"s651399075",
"s312039062"
] |
u493130708 | p02949 | python | s229797415 | s383740384 | 1,012 | 576 | 75,856 | 75,152 | Accepted | Accepted | 43.08 | import bisect
import collections
import copy
import functools
import heapq
import math
import sys
from collections import deque
from collections import defaultdict
input = sys.stdin.readline
MOD = 10**9+7
N,M,P = list(map(int,(input().split())))
line = []
for i in range(M):
a,b,c = list(map(int,(inp... | import bisect
import collections
import copy
import functools
import heapq
import math
import sys
from collections import deque
from collections import defaultdict
input = sys.stdin.readline
MOD = 10**9+7
INF = float("inf")
N,M,P = list(map(int,(input().split())))
line = []
for i in range(M):
a,b,c... | 52 | 59 | 1,502 | 1,565 | import bisect
import collections
import copy
import functools
import heapq
import math
import sys
from collections import deque
from collections import defaultdict
input = sys.stdin.readline
MOD = 10**9 + 7
N, M, P = list(map(int, (input().split())))
line = []
for i in range(M):
a, b, c = list(map(int, (input().sp... | import bisect
import collections
import copy
import functools
import heapq
import math
import sys
from collections import deque
from collections import defaultdict
input = sys.stdin.readline
MOD = 10**9 + 7
INF = float("inf")
N, M, P = list(map(int, (input().split())))
line = []
for i in range(M):
a, b, c = list(m... | false | 11.864407 | [
"+INF = float(\"inf\")",
"-min_distance = [float(\"inf\")] * N # min_distance[i] は始点から街iまでの最短距離",
"+min_distance = [INF] * N # min_distance[i] は始点から街iまでの最短距離",
"-flag = 0",
"-for _ in range(N):",
"- update = False",
"- for s, g, d in line: # [s,g,d] = [道路の始点,道路の終点,道路の長さ] について、すべての道路を見る",
"- ... | false | 0.03725 | 0.037132 | 1.003175 | [
"s229797415",
"s383740384"
] |
u191874006 | p02947 | python | s420808978 | s468164977 | 1,778 | 374 | 105,084 | 31,800 | Accepted | Accepted | 78.97 | #!/usr/bin/env python3
#ABC137 C
import sys
import math
import bisect
sys.setrecursionlimit(1000000000)
from heapq import heappush, heappop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
fro... | #!/usr/bin/env python3
#ABC137 C
import sys
import math
import bisect
sys.setrecursionlimit(1000000000)
from heapq import heappush, heappop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
fro... | 36 | 31 | 878 | 720 | #!/usr/bin/env python3
# ABC137 C
import sys
import math
import bisect
sys.setrecursionlimit(1000000000)
from heapq import heappush, heappop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools ... | #!/usr/bin/env python3
# ABC137 C
import sys
import math
import bisect
sys.setrecursionlimit(1000000000)
from heapq import heappush, heappop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools ... | false | 13.888889 | [
"-def comb(n, r):",
"- return math.factorial(n) // math.factorial(n - r) // math.factorial(r)",
"-",
"-",
"-s = [eval(input()) for _ in range(n)]",
"-x = [list(Counter(s[i]).items()) for i in range(n)]",
"-for i in x:",
"+s = [list(eval(input())) for _ in range(n)]",
"+for i in s:",
"-y = [tupl... | false | 0.089969 | 0.06057 | 1.485368 | [
"s420808978",
"s468164977"
] |
u647522078 | p02922 | python | s434636681 | s662233116 | 19 | 17 | 2,940 | 2,940 | Accepted | Accepted | 10.53 | a,b = list(map(int, input().split()))
cnt = 0
tap = 0
for i in range(10000):
if cnt >= b or b == 1:
break
if i == 0:
cnt += a
else:
cnt += a-1
tap += 1
print(tap) | a, b = list(map(int, input().split()))
if b == 1:
print((0))
exit(0)
for i in range(10000):
if a + i * a - i >= b:
print((1 + i))
break | 13 | 8 | 210 | 160 | a, b = list(map(int, input().split()))
cnt = 0
tap = 0
for i in range(10000):
if cnt >= b or b == 1:
break
if i == 0:
cnt += a
else:
cnt += a - 1
tap += 1
print(tap)
| a, b = list(map(int, input().split()))
if b == 1:
print((0))
exit(0)
for i in range(10000):
if a + i * a - i >= b:
print((1 + i))
break
| false | 38.461538 | [
"-cnt = 0",
"-tap = 0",
"+if b == 1:",
"+ print((0))",
"+ exit(0)",
"- if cnt >= b or b == 1:",
"+ if a + i * a - i >= b:",
"+ print((1 + i))",
"- if i == 0:",
"- cnt += a",
"- else:",
"- cnt += a - 1",
"- tap += 1",
"-print(tap)"
] | false | 0.047892 | 0.048276 | 0.992045 | [
"s434636681",
"s662233116"
] |
u108617242 | p02659 | python | s625831948 | s103635673 | 56 | 30 | 61,804 | 8,988 | Accepted | Accepted | 46.43 | A, B = list(map(float, input().split()))
print(((int(A)*round(B*100))//100)) | A, B = list(map(str, input().split()))
B = ''.join(B.split('.'))
print((int(A)*int(B)//100)) | 2 | 3 | 69 | 86 | A, B = list(map(float, input().split()))
print(((int(A) * round(B * 100)) // 100))
| A, B = list(map(str, input().split()))
B = "".join(B.split("."))
print((int(A) * int(B) // 100))
| false | 33.333333 | [
"-A, B = list(map(float, input().split()))",
"-print(((int(A) * round(B * 100)) // 100))",
"+A, B = list(map(str, input().split()))",
"+B = \"\".join(B.split(\".\"))",
"+print((int(A) * int(B) // 100))"
] | false | 0.046579 | 0.04634 | 1.005164 | [
"s625831948",
"s103635673"
] |
u622523700 | p03163 | python | s966846017 | s855026507 | 468 | 230 | 119,916 | 92,264 | Accepted | Accepted | 50.85 | n, W = list(map(int, input().split()))
dp = [[0] * (W + 1) for _ in range(n + 1)]
dp[0][W] = 0
for i in range(n):
w, v = list(map(int, input().split()))
for j in range(W + 1):
if j >= w:
dp[i + 1][j] = max(dp[i][j - w] + v, dp[i][j])
else:
dp[i + 1][j] = dp[i][... | import numpy as np
n, W = list(map(int, input().split()))
dp = np.zeros((n + 1, W + 1))
for i in range(n):
w, v = list(map(int, input().split()))
dp[i + 1] = dp[i]
if w <= W:
dp[i + 1][w:] = np.maximum(dp[i][:W - w + 1] + v, dp[i][w:])
print((int(dp[n][W]))) | 12 | 10 | 327 | 274 | n, W = list(map(int, input().split()))
dp = [[0] * (W + 1) for _ in range(n + 1)]
dp[0][W] = 0
for i in range(n):
w, v = list(map(int, input().split()))
for j in range(W + 1):
if j >= w:
dp[i + 1][j] = max(dp[i][j - w] + v, dp[i][j])
else:
dp[i + 1][j] = dp[i][j]
print((d... | import numpy as np
n, W = list(map(int, input().split()))
dp = np.zeros((n + 1, W + 1))
for i in range(n):
w, v = list(map(int, input().split()))
dp[i + 1] = dp[i]
if w <= W:
dp[i + 1][w:] = np.maximum(dp[i][: W - w + 1] + v, dp[i][w:])
print((int(dp[n][W])))
| false | 16.666667 | [
"+import numpy as np",
"+",
"-dp = [[0] * (W + 1) for _ in range(n + 1)]",
"-dp[0][W] = 0",
"+dp = np.zeros((n + 1, W + 1))",
"- for j in range(W + 1):",
"- if j >= w:",
"- dp[i + 1][j] = max(dp[i][j - w] + v, dp[i][j])",
"- else:",
"- dp[i + 1][j] = dp[i][j]... | false | 0.038533 | 0.17291 | 0.22285 | [
"s966846017",
"s855026507"
] |
u947883560 | p02642 | python | s137443023 | s366147166 | 462 | 207 | 112,240 | 32,304 | Accepted | Accepted | 55.19 | #!/usr/bin/env python3
import sys
import math
sys.setrecursionlimit(10**8)
def eratosthenes_sieve(n):
table = [0] * (n + 1)
prime_list = []
for i in range(2, n + 1):
if table[i] == 0:
prime_list.append(i)
for j in range(i + i, n + 1, i):
table... | #!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**8)
def input(): return sys.stdin.readline().strip()
def INT(): return int(eval(input()))
def MAP(): return list(map(int, input().split()))
def LIST(): return list(map(int, input().split()))
def ZIP(n): return [LIST() for _ in range(n)]
INF = float(... | 50 | 41 | 887 | 849 | #!/usr/bin/env python3
import sys
import math
sys.setrecursionlimit(10**8)
def eratosthenes_sieve(n):
table = [0] * (n + 1)
prime_list = []
for i in range(2, n + 1):
if table[i] == 0:
prime_list.append(i)
for j in range(i + i, n + 1, i):
table[j] = 1
re... | #!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**8)
def input():
return sys.stdin.readline().strip()
def INT():
return int(eval(input()))
def MAP():
return list(map(int, input().split()))
def LIST():
return list(map(int, input().split()))
def ZIP(n):
return [LIST() for _ in ran... | false | 18 | [
"-import math",
"-def eratosthenes_sieve(n):",
"- table = [0] * (n + 1)",
"- prime_list = []",
"- for i in range(2, n + 1):",
"- if table[i] == 0:",
"- prime_list.append(i)",
"- for j in range(i + i, n + 1, i):",
"- table[j] = 1",
"- return p... | false | 0.03161 | 0.031763 | 0.995172 | [
"s137443023",
"s366147166"
] |
u540877546 | p02768 | python | s556013379 | s508045789 | 210 | 183 | 38,512 | 38,512 | Accepted | Accepted | 12.86 | n, a, b = list(map(int, input().split()))
mod = 10**9+7
def extgcd(a, b):
r = [1, 0, a]
w = [0, 1, b]
while w[2] != 1:
q = r[2]//w[2]
r2 = w
w2 = [r[0]-q*w[0], r[1]-q*w[1], r[2]-q*w[2]]
r = r2
w = w2
# [x,y]
return [w[0], w[1]]
def mod_inv... | n, a, b = list(map(int, input().split()))
mod = 10**9+7
def binary(n):
return bin(n)[2:]
# a^x mod n : ans = pow_by_binary_exponentiation(2, 1000, 10**9+7)
def pow_by_binary_exponentiation(a, x, n):
x = [int(b) for b in binary(x)]
y = a
for i in range(1, len(x)):
y = (y**2) % n
... | 53 | 32 | 1,007 | 771 | n, a, b = list(map(int, input().split()))
mod = 10**9 + 7
def extgcd(a, b):
r = [1, 0, a]
w = [0, 1, b]
while w[2] != 1:
q = r[2] // w[2]
r2 = w
w2 = [r[0] - q * w[0], r[1] - q * w[1], r[2] - q * w[2]]
r = r2
w = w2
# [x,y]
return [w[0], w[1]]
def mod_inv(... | n, a, b = list(map(int, input().split()))
mod = 10**9 + 7
def binary(n):
return bin(n)[2:]
# a^x mod n : ans = pow_by_binary_exponentiation(2, 1000, 10**9+7)
def pow_by_binary_exponentiation(a, x, n):
x = [int(b) for b in binary(x)]
y = a
for i in range(1, len(x)):
y = (y**2) % n
if ... | false | 39.622642 | [
"-",
"-",
"-def extgcd(a, b):",
"- r = [1, 0, a]",
"- w = [0, 1, b]",
"- while w[2] != 1:",
"- q = r[2] // w[2]",
"- r2 = w",
"- w2 = [r[0] - q * w[0], r[1] - q * w[1], r[2] - q * w[2]]",
"- r = r2",
"- w = w2",
"- # [x,y]",
"- return [w[0], ... | false | 0.12716 | 0.093974 | 1.353139 | [
"s556013379",
"s508045789"
] |
u391589398 | p02582 | python | s935504018 | s038108402 | 58 | 25 | 61,588 | 8,940 | Accepted | Accepted | 56.9 | S = eval(input())
RC = S.count('R')
if S[1] == 'S' and RC == 2:
print((1))
else:
print(RC)
| S = eval(input())
# RC = S.count('R')
# if S[1] == 'S' and RC == 2:
# print(1)
# else:
# print(RC)
rs = S.split('S')
ans = 0
for r in rs:
ans = max(ans, len(r))
print(ans)
| 6 | 12 | 96 | 190 | S = eval(input())
RC = S.count("R")
if S[1] == "S" and RC == 2:
print((1))
else:
print(RC)
| S = eval(input())
# RC = S.count('R')
# if S[1] == 'S' and RC == 2:
# print(1)
# else:
# print(RC)
rs = S.split("S")
ans = 0
for r in rs:
ans = max(ans, len(r))
print(ans)
| false | 50 | [
"-RC = S.count(\"R\")",
"-if S[1] == \"S\" and RC == 2:",
"- print((1))",
"-else:",
"- print(RC)",
"+# RC = S.count('R')",
"+# if S[1] == 'S' and RC == 2:",
"+# print(1)",
"+# else:",
"+# print(RC)",
"+rs = S.split(\"S\")",
"+ans = 0",
"+for r in rs:",
"+ ans = max(ans, len(r))",
... | false | 0.054484 | 0.04608 | 1.182369 | [
"s935504018",
"s038108402"
] |
u532966492 | p02722 | python | s548948941 | s121674838 | 189 | 121 | 40,380 | 4,172 | Accepted | Accepted | 35.98 | def main():
from collections import Counter as ct
def soinsuu(a):
yy, j = [], 2
y = yy.append
while(a > 1):
for i in range(j, int(a**0.5)+1):
if a % i == 0:
y(i)
a, j = a//i, i
break
... | def main():
from collections import Counter as ct
def soinsuu(a):
yy, j = [], 2
y = yy.append
while(a > 1):
for i in range(j, int(a**0.5)+1):
if a % i == 0:
y(i)
a, j = a//i, i
break
... | 50 | 42 | 1,022 | 873 | def main():
from collections import Counter as ct
def soinsuu(a):
yy, j = [], 2
y = yy.append
while a > 1:
for i in range(j, int(a**0.5) + 1):
if a % i == 0:
y(i)
a, j = a // i, i
break
e... | def main():
from collections import Counter as ct
def soinsuu(a):
yy, j = [], 2
y = yy.append
while a > 1:
for i in range(j, int(a**0.5) + 1):
if a % i == 0:
y(i)
a, j = a // i, i
break
e... | false | 16 | [
"- def soinsuu2(a):",
"+ def yakusuu(a):",
"- s2 = set()",
"- for k in range(1, j + 1):",
"- for l in s:",
"- s2.add(l * pow(i, k))",
"- s |= s2",
"+ s |= {l * i**k for l in s for k in range(1, j + 1)}",
"- ans = ... | false | 0.045313 | 0.048161 | 0.940868 | [
"s548948941",
"s121674838"
] |
u366996583 | p02570 | python | s998275408 | s383898179 | 30 | 27 | 9,152 | 8,964 | Accepted | Accepted | 10 | d,t,s=list(map(int,input().split()))
p=d/s
if t>=p:
print('Yes')
else:
print('No') | from sys import stdin
def ip():
return stdin.readline().rstrip()
d,t,s=list(map(int,ip().split()))
if d<=t*s:
print('Yes')
else:
print('No') | 6 | 8 | 85 | 153 | d, t, s = list(map(int, input().split()))
p = d / s
if t >= p:
print("Yes")
else:
print("No")
| from sys import stdin
def ip():
return stdin.readline().rstrip()
d, t, s = list(map(int, ip().split()))
if d <= t * s:
print("Yes")
else:
print("No")
| false | 25 | [
"-d, t, s = list(map(int, input().split()))",
"-p = d / s",
"-if t >= p:",
"+from sys import stdin",
"+",
"+",
"+def ip():",
"+ return stdin.readline().rstrip()",
"+",
"+",
"+d, t, s = list(map(int, ip().split()))",
"+if d <= t * s:"
] | false | 0.038938 | 0.041227 | 0.944475 | [
"s998275408",
"s383898179"
] |
u150984829 | p02397 | python | s376475679 | s499960668 | 50 | 40 | 5,596 | 5,892 | Accepted | Accepted | 20 | while 1:
a=eval(input())
if a=='0 0':break
print((*sorted(map(int,a.split())))) | import sys
for s in sys.stdin:
if'0 0\n'==s:break
print((*sorted(map(int,s.split())))) | 4 | 4 | 77 | 89 | while 1:
a = eval(input())
if a == "0 0":
break
print((*sorted(map(int, a.split()))))
| import sys
for s in sys.stdin:
if "0 0\n" == s:
break
print((*sorted(map(int, s.split()))))
| false | 0 | [
"-while 1:",
"- a = eval(input())",
"- if a == \"0 0\":",
"+import sys",
"+",
"+for s in sys.stdin:",
"+ if \"0 0\\n\" == s:",
"- print((*sorted(map(int, a.split()))))",
"+ print((*sorted(map(int, s.split()))))"
] | false | 0.035564 | 0.033461 | 1.062854 | [
"s376475679",
"s499960668"
] |
u454557108 | p03006 | python | s538774997 | s210493896 | 864 | 69 | 134,084 | 4,248 | Accepted | Accepted | 92.01 | import sys
n = int(eval(input()))
x = [0]*n ; y = [0]*n
for i in range(n):
x[i],y[i] = list(map(int, input().split()))
if n == 1:
print((1))
sys.exit()
ans = []
for i in range(n):
for j in range(n):
if i == j:
continue
p = x[i]-x[j]
q = y[i]-y[j]
... | from collections import Counter
import sys
n = int(eval(input()))
x = [0]*n ; y = [0]*n
for i in range(n):
x[i],y[i] = list(map(int, input().split()))
if n == 1:
print((1))
sys.exit()
dc_c = []
dc_c = []
dc_ans = []
for i in range(n):
ii = 0
d = [[-1]*2 for i in range(n)]
fo... | 26 | 30 | 526 | 622 | import sys
n = int(eval(input()))
x = [0] * n
y = [0] * n
for i in range(n):
x[i], y[i] = list(map(int, input().split()))
if n == 1:
print((1))
sys.exit()
ans = []
for i in range(n):
for j in range(n):
if i == j:
continue
p = x[i] - x[j]
q = y[i] - y[j]
count... | from collections import Counter
import sys
n = int(eval(input()))
x = [0] * n
y = [0] * n
for i in range(n):
x[i], y[i] = list(map(int, input().split()))
if n == 1:
print((1))
sys.exit()
dc_c = []
dc_c = []
dc_ans = []
for i in range(n):
ii = 0
d = [[-1] * 2 for i in range(n)]
for j in range(n)... | false | 13.333333 | [
"+from collections import Counter",
"-ans = []",
"+dc_c = []",
"+dc_c = []",
"+dc_ans = []",
"+ ii = 0",
"+ d = [[-1] * 2 for i in range(n)]",
"- if i == j:",
"- continue",
"- p = x[i] - x[j]",
"- q = y[i] - y[j]",
"- count = 0",
"- for k i... | false | 0.133867 | 0.036903 | 3.62753 | [
"s538774997",
"s210493896"
] |
u699296734 | p03624 | python | s453533564 | s510874591 | 50 | 26 | 9,176 | 9,020 | Accepted | Accepted | 48 | s = eval(input())
alphabets = [0] * 26
for i in s:
alphabets[ord(i) - ord("a")] += 1
for i in range(26):
if alphabets[i] == 0:
print((chr(i + ord("a"))))
break
else:
print("None")
| s = set(eval(input()))
for i in range(26):
if chr(i + ord("a")) not in s:
print((chr(i + ord("a"))))
break
else:
print("None")
| 12 | 8 | 213 | 151 | s = eval(input())
alphabets = [0] * 26
for i in s:
alphabets[ord(i) - ord("a")] += 1
for i in range(26):
if alphabets[i] == 0:
print((chr(i + ord("a"))))
break
else:
print("None")
| s = set(eval(input()))
for i in range(26):
if chr(i + ord("a")) not in s:
print((chr(i + ord("a"))))
break
else:
print("None")
| false | 33.333333 | [
"-s = eval(input())",
"-alphabets = [0] * 26",
"-for i in s:",
"- alphabets[ord(i) - ord(\"a\")] += 1",
"+s = set(eval(input()))",
"- if alphabets[i] == 0:",
"+ if chr(i + ord(\"a\")) not in s:"
] | false | 0.042052 | 0.03921 | 1.072482 | [
"s453533564",
"s510874591"
] |
u596276291 | p02847 | python | s753231197 | s845653358 | 161 | 36 | 4,208 | 9,776 | Accepted | Accepted | 77.64 | #!/usr/bin/env python3
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_c... | #!/usr/bin/env python3
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_c... | 50 | 51 | 1,111 | 1,109 | #!/usr/bin/env python3
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
im... | #!/usr/bin/env python3
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
im... | false | 1.960784 | [
"- return",
"+ S = eval(input())",
"+ i = [\"SUN\", \"MON\", \"TUE\", \"WED\", \"THU\", \"FRI\", \"SAT\"].index(S)",
"+ print((7 - i))",
"- S = eval(input())",
"- d = {\"SUN\": 7, \"MON\": 6, \"TUE\": 5, \"WED\": 4, \"THU\": 3, \"FRI\": 2, \"SAT\": 1}",
"- print((d[S]))",
"+ so... | false | 0.048279 | 0.048365 | 0.99822 | [
"s753231197",
"s845653358"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.