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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
u548303713 | p02756 | python | s873087805 | s781409681 | 763 | 419 | 56,436 | 8,564 | Accepted | Accepted | 45.09 | from collections import deque
ss=deque()
s=list(eval(input()))
l=len(s)
for i in range(l):
ss.append(s[i])
q=int(eval(input()))
info=[]
rev=[] #i回までに何回反転があるか
num=0
for i in range(q):
info.append(list(input().split()))
moji=0 #文字の追加数
for i in range(q):
if info[i][0]=="1":
num+=1
e... | from collections import deque
s=eval(input())
q=int(eval(input()))
count=0 #何回反転があるか
ss=deque(s)
flag=True #通常状態
for i in range(q):
info=eval(input())
if info[0]=="1":
count+=1
if flag:
flag=False
else:
flag=True
else:
_,f,c=info.split... | 40 | 29 | 859 | 615 | from collections import deque
ss = deque()
s = list(eval(input()))
l = len(s)
for i in range(l):
ss.append(s[i])
q = int(eval(input()))
info = []
rev = [] # i回までに何回反転があるか
num = 0
for i in range(q):
info.append(list(input().split()))
moji = 0 # 文字の追加数
for i in range(q):
if info[i][0] == "1":
num +... | from collections import deque
s = eval(input())
q = int(eval(input()))
count = 0 # 何回反転があるか
ss = deque(s)
flag = True # 通常状態
for i in range(q):
info = eval(input())
if info[0] == "1":
count += 1
if flag:
flag = False
else:
flag = True
else:
_, f, c ... | false | 27.5 | [
"-ss = deque()",
"-s = list(eval(input()))",
"-l = len(s)",
"-for i in range(l):",
"- ss.append(s[i])",
"+s = eval(input())",
"-info = []",
"-rev = [] # i回までに何回反転があるか",
"-num = 0",
"+count = 0 # 何回反転があるか",
"+ss = deque(s)",
"+flag = True # 通常状態",
"- info.append(list(input().split())... | false | 0.038914 | 0.060718 | 0.640889 | [
"s873087805",
"s781409681"
] |
u763209508 | p03448 | python | s368010908 | s593240226 | 57 | 52 | 8,404 | 3,060 | Accepted | Accepted | 8.77 | import itertools
A = int(eval(input()))
B = int(eval(input()))
C = int(eval(input()))
X = int(eval(input()))
available_prices = [500 * a + 100 * b + 50 * c for a, b, c in itertools.product(list(range(A+1)), list(range(B+1)), list(range(C+1)))]
cnt = 0
for p in available_prices:
if p == X:
cn... | A = int(eval(input()))
B = int(eval(input()))
C = int(eval(input()))
X = int(eval(input()))
count = 0
for i in range(A+1):
for j in range(B+1):
for k in range(C+1):
if 500*i + 100*j + 50*k == X:
count += 1
print(count) | 15 | 15 | 298 | 252 | import itertools
A = int(eval(input()))
B = int(eval(input()))
C = int(eval(input()))
X = int(eval(input()))
available_prices = [
500 * a + 100 * b + 50 * c
for a, b, c in itertools.product(
list(range(A + 1)), list(range(B + 1)), list(range(C + 1))
)
]
cnt = 0
for p in available_prices:
if p =... | A = int(eval(input()))
B = int(eval(input()))
C = int(eval(input()))
X = int(eval(input()))
count = 0
for i in range(A + 1):
for j in range(B + 1):
for k in range(C + 1):
if 500 * i + 100 * j + 50 * k == X:
count += 1
print(count)
| false | 0 | [
"-import itertools",
"-",
"-available_prices = [",
"- 500 * a + 100 * b + 50 * c",
"- for a, b, c in itertools.product(",
"- list(range(A + 1)), list(range(B + 1)), list(range(C + 1))",
"- )",
"-]",
"-cnt = 0",
"-for p in available_prices:",
"- if p == X:",
"- cnt += ... | false | 0.205977 | 0.062686 | 3.285846 | [
"s368010908",
"s593240226"
] |
u442396147 | p03163 | python | s619628357 | s232461219 | 811 | 701 | 171,656 | 171,656 | Accepted | Accepted | 13.56 | N, W = list(map(int, input().split()))
Ws = []
Vs = []
for _ in range(N):
w, v = list(map(int, input().split()))
Ws.append(w)
Vs.append(v)
S = [ [0 for _ in range(W+1)] for _ in range(N)]
if Ws[0] <= W:
for i in range(Ws[0], W+1):
S[0][i] = Vs[0]
for weight in range(W+1):
for item_... | N, W = list(map(int, input().split()))
Ws = []
Vs = []
for _ in range(N):
w, v = list(map(int, input().split()))
Ws.append(w)
Vs.append(v)
Ans = [[0 for _ in range(W+1)] for _ in range(N)]
for i in range(W+1):
if i >= Ws[0]:
Ans[0][i] = Vs[0]
for i in range(1, N):
for w in range(W+1):
... | 25 | 23 | 608 | 488 | N, W = list(map(int, input().split()))
Ws = []
Vs = []
for _ in range(N):
w, v = list(map(int, input().split()))
Ws.append(w)
Vs.append(v)
S = [[0 for _ in range(W + 1)] for _ in range(N)]
if Ws[0] <= W:
for i in range(Ws[0], W + 1):
S[0][i] = Vs[0]
for weight in range(W + 1):
for item_num i... | N, W = list(map(int, input().split()))
Ws = []
Vs = []
for _ in range(N):
w, v = list(map(int, input().split()))
Ws.append(w)
Vs.append(v)
Ans = [[0 for _ in range(W + 1)] for _ in range(N)]
for i in range(W + 1):
if i >= Ws[0]:
Ans[0][i] = Vs[0]
for i in range(1, N):
for w in range(W + 1):
... | false | 8 | [
"-S = [[0 for _ in range(W + 1)] for _ in range(N)]",
"-if Ws[0] <= W:",
"- for i in range(Ws[0], W + 1):",
"- S[0][i] = Vs[0]",
"-for weight in range(W + 1):",
"- for item_num in range(N - 1):",
"- if weight - Ws[item_num + 1] < 0:",
"- S[item_num + 1][weight] = max(S[i... | false | 0.041487 | 0.040433 | 1.026076 | [
"s619628357",
"s232461219"
] |
u744034042 | p03607 | python | s563617404 | s448895260 | 244 | 194 | 20,200 | 16,636 | Accepted | Accepted | 20.49 | n = int(eval(input()))
a = [int(eval(input())) for i in range(n)]
import collections
b = collections.Counter(a)
set_a = list(set(a))
cnt = 0
for i in range(len(set_a)):
if b[set_a[i]]%2 == 1:
cnt += 1
print(cnt) | from collections import Counter
n = int(eval(input()))
a = Counter([int(eval(input())) for i in range(n)])
print((sum([v%2 == 1 for v in list(a.values())]))) | 10 | 4 | 220 | 140 | n = int(eval(input()))
a = [int(eval(input())) for i in range(n)]
import collections
b = collections.Counter(a)
set_a = list(set(a))
cnt = 0
for i in range(len(set_a)):
if b[set_a[i]] % 2 == 1:
cnt += 1
print(cnt)
| from collections import Counter
n = int(eval(input()))
a = Counter([int(eval(input())) for i in range(n)])
print((sum([v % 2 == 1 for v in list(a.values())])))
| false | 60 | [
"+from collections import Counter",
"+",
"-a = [int(eval(input())) for i in range(n)]",
"-import collections",
"-",
"-b = collections.Counter(a)",
"-set_a = list(set(a))",
"-cnt = 0",
"-for i in range(len(set_a)):",
"- if b[set_a[i]] % 2 == 1:",
"- cnt += 1",
"-print(cnt)",
"+a = C... | false | 0.097409 | 0.093643 | 1.040226 | [
"s563617404",
"s448895260"
] |
u691018832 | p02687 | python | s741389198 | s431592711 | 62 | 26 | 61,856 | 9,160 | Accepted | Accepted | 58.06 | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)
s = readline().rstrip().decode()
ans = {'ABC': 'ARC', 'ARC': 'ABC'}
print((ans[s]))
| def main():
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)
s = readline().rstrip().decode()
check = {'ABC': 'ARC', 'ARC': 'ABC'}
print((check[s]))
if __name__ == '__main__':... | 9 | 14 | 238 | 331 | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**7)
s = readline().rstrip().decode()
ans = {"ABC": "ARC", "ARC": "ABC"}
print((ans[s]))
| def main():
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**7)
s = readline().rstrip().decode()
check = {"ABC": "ARC", "ARC": "ABC"}
print((check[s]))
if __name__ == "__main__":
main()
| false | 35.714286 | [
"-import sys",
"+def main():",
"+ import sys",
"-read = sys.stdin.buffer.read",
"-readline = sys.stdin.buffer.readline",
"-readlines = sys.stdin.buffer.readlines",
"-sys.setrecursionlimit(10**7)",
"-s = readline().rstrip().decode()",
"-ans = {\"ABC\": \"ARC\", \"ARC\": \"ABC\"}",
"-print((ans[s... | false | 0.226153 | 0.046427 | 4.871124 | [
"s741389198",
"s431592711"
] |
u690536347 | p02936 | python | s984452018 | s422334969 | 1,873 | 1,237 | 118,744 | 66,692 | Accepted | Accepted | 33.96 | from collections import defaultdict
N, Q = list(map(int ,input().split()))
d = defaultdict(list)
for _ in range(N-1):
a, b = list(map(int, input().split()))
d[a].append(b)
d[b].append(a)
dp = [0]*N
used = [False]*N
for _ in range(Q):
p, x = list(map(int, input().split()))
dp[p-1] +... | from collections import defaultdict
N, Q = list(map(int, input().split()))
d = defaultdict(list)
for _ in range(N-1):
a, b = list(map(int, input().split()))
d[a].append(b)
d[b].append(a)
ans = [0]*(N+1)
for _ in range(Q):
p, x = list(map(int, input().split()))
ans[p] += x
q = [1]
use... | 30 | 25 | 527 | 499 | from collections import defaultdict
N, Q = list(map(int, input().split()))
d = defaultdict(list)
for _ in range(N - 1):
a, b = list(map(int, input().split()))
d[a].append(b)
d[b].append(a)
dp = [0] * N
used = [False] * N
for _ in range(Q):
p, x = list(map(int, input().split()))
dp[p - 1] += x
q = [... | from collections import defaultdict
N, Q = list(map(int, input().split()))
d = defaultdict(list)
for _ in range(N - 1):
a, b = list(map(int, input().split()))
d[a].append(b)
d[b].append(a)
ans = [0] * (N + 1)
for _ in range(Q):
p, x = list(map(int, input().split()))
ans[p] += x
q = [1]
used = [Fals... | false | 16.666667 | [
"-dp = [0] * N",
"-used = [False] * N",
"+ans = [0] * (N + 1)",
"- dp[p - 1] += x",
"+ ans[p] += x",
"-used[0] = True",
"+used = [False] * (N + 1)",
"+used[1] = True",
"- x = q.pop()",
"- for i in d[x]:",
"- if used[i - 1] == True:",
"+ s = q.pop()",
"+ for t in d[s]... | false | 0.044491 | 0.11364 | 0.39151 | [
"s984452018",
"s422334969"
] |
u677121387 | p02685 | python | s603835671 | s682232844 | 1,424 | 1,117 | 24,512 | 32,408 | Accepted | Accepted | 21.56 | n,m,k = list(map(int,input().split()))
mod = 998244353
def comb(n,k):
if n < k: return 0
if n < 0 or k < 0: return 0
return fac[n]*finv[k]%mod*finv[n-k]%mod
fac = [0]*(n+1)
finv = [0]*(n+1)
fac[0] = finv[0] = 1
for i in range(1,n+1):
fac[i] = fac[i-1]*i%mod
finv[i] = pow(fac[i],mod-2,mod)... | n,m,k = list(map(int,input().split()))
mod = 998244353
def comb(n,k):
if n < k: return 0
if n < 0 or k < 0: return 0
return fac[n]*finv[k]%mod*finv[n-k]%mod
fac = [1]*(n+1)
finv = [1]*(n+1)
for i in range(1,n+1):
fac[i] = fac[i-1]*i%mod
finv[i] = pow(fac[i],mod-2,mod)
p = [1]*(n+1)
for... | 17 | 19 | 423 | 460 | n, m, k = list(map(int, input().split()))
mod = 998244353
def comb(n, k):
if n < k:
return 0
if n < 0 or k < 0:
return 0
return fac[n] * finv[k] % mod * finv[n - k] % mod
fac = [0] * (n + 1)
finv = [0] * (n + 1)
fac[0] = finv[0] = 1
for i in range(1, n + 1):
fac[i] = fac[i - 1] * i %... | n, m, k = list(map(int, input().split()))
mod = 998244353
def comb(n, k):
if n < k:
return 0
if n < 0 or k < 0:
return 0
return fac[n] * finv[k] % mod * finv[n - k] % mod
fac = [1] * (n + 1)
finv = [1] * (n + 1)
for i in range(1, n + 1):
fac[i] = fac[i - 1] * i % mod
finv[i] = po... | false | 10.526316 | [
"-fac = [0] * (n + 1)",
"-finv = [0] * (n + 1)",
"-fac[0] = finv[0] = 1",
"+fac = [1] * (n + 1)",
"+finv = [1] * (n + 1)",
"+p = [1] * (n + 1)",
"+for i in range(1, n + 1):",
"+ p[i] = p[i - 1] * (m - 1) % mod",
"- ans = (ans + m * comb(n - 1, i) % mod * pow(m - 1, n - 1 - i, mod) % mod) % mod... | false | 0.155828 | 0.16156 | 0.964522 | [
"s603835671",
"s682232844"
] |
u816631826 | p02996 | python | s166582058 | s705638551 | 845 | 512 | 29,456 | 33,480 | Accepted | Accepted | 39.41 | n=int(eval(input()))
l=[];t=0;flg=0
for i in range(1,n+1,1):
a,b=list(map(int,input().split()))
c=(b,a)
l.append(c)
l.sort()
for x,y in l:
t+=y
if t>x:
flg=1
if flg==0:print("Yes")
else:print("No")
| import sys
from math import ceil
from operator import itemgetter as get
def input():
return sys.stdin.readline().strip()
def iinput():
return int(eval(input()))
def finput():
return float(eval(input()))
def tinput():
return input().split()
def rinput():
return list(map(int, tin... | 14 | 45 | 228 | 800 | n = int(eval(input()))
l = []
t = 0
flg = 0
for i in range(1, n + 1, 1):
a, b = list(map(int, input().split()))
c = (b, a)
l.append(c)
l.sort()
for x, y in l:
t += y
if t > x:
flg = 1
if flg == 0:
print("Yes")
else:
print("No")
| import sys
from math import ceil
from operator import itemgetter as get
def input():
return sys.stdin.readline().strip()
def iinput():
return int(eval(input()))
def finput():
return float(eval(input()))
def tinput():
return input().split()
def rinput():
return list(map(int, tinput()))
de... | false | 68.888889 | [
"-n = int(eval(input()))",
"-l = []",
"-t = 0",
"-flg = 0",
"-for i in range(1, n + 1, 1):",
"- a, b = list(map(int, input().split()))",
"- c = (b, a)",
"- l.append(c)",
"-l.sort()",
"-for x, y in l:",
"- t += y",
"- if t > x:",
"- flg = 1",
"-if flg == 0:",
"+impor... | false | 0.059653 | 0.042568 | 1.401377 | [
"s166582058",
"s705638551"
] |
u970899068 | p03283 | python | s624179312 | s579424723 | 2,289 | 637 | 80,012 | 97,500 | Accepted | Accepted | 72.17 | import itertools
import numpy as np
n,m,q=list(map(int, input().split()))
a=[list(map(int, input().split())) for i in range(m)]
b=[list(map(int, input().split())) for i in range(q)]
x=[[0]*(501) for i in range(501)]
x=np.array(x)
for i in range(m):
x[a[i][0],a[i][1]]+=1
for i in range(501):
... | import sys
input = sys.stdin.readline
n,m,q= list(map(int, input().split()))
a= [list(map(int, input().split())) for i in range(m)]
b= [list(map(int, input().split())) for i in range(q)]
# 2次元累積和
c=[[0]*(n+1) for i in range(n+1)]
for i,j in a:
c[i][j]+=1
for i in range(1,n+1):
for j in range(1... | 32 | 20 | 570 | 458 | import itertools
import numpy as np
n, m, q = list(map(int, input().split()))
a = [list(map(int, input().split())) for i in range(m)]
b = [list(map(int, input().split())) for i in range(q)]
x = [[0] * (501) for i in range(501)]
x = np.array(x)
for i in range(m):
x[a[i][0], a[i][1]] += 1
for i in range(501):
x[... | import sys
input = sys.stdin.readline
n, m, q = list(map(int, input().split()))
a = [list(map(int, input().split())) for i in range(m)]
b = [list(map(int, input().split())) for i in range(q)]
# 2次元累積和
c = [[0] * (n + 1) for i in range(n + 1)]
for i, j in a:
c[i][j] += 1
for i in range(1, n + 1):
for j in range... | false | 37.5 | [
"-import itertools",
"-import numpy as np",
"+import sys",
"+input = sys.stdin.readline",
"-x = [[0] * (501) for i in range(501)]",
"-x = np.array(x)",
"-for i in range(m):",
"- x[a[i][0], a[i][1]] += 1",
"-for i in range(501):",
"- x[i] = list(itertools.accumulate(x[i]))",
"-for i in rang... | false | 0.282414 | 0.036024 | 7.839692 | [
"s624179312",
"s579424723"
] |
u562935282 | p03013 | python | s845488157 | s095119300 | 492 | 187 | 53,144 | 9,600 | Accepted | Accepted | 61.99 | MOD = 10 ** 9 + 7
N, M = list(map(int, input().split()))
a = [int(eval(input())) for _ in range(M)]
broken = [False] * (N + 1)
for aa in a:
broken[aa] = True
dp = [0] * (N + 1)
dp[0] = 1
for i in range(1, N + 1):
if broken[i]:
continue
if i >= 2:
dp[i] = dp[i - 1] + dp[i - ... | mod = 10 ** 9 + 7
n, m = list(map(int, input().split()))
a = tuple(int(eval(input())) for _ in range(m))
b = [False] * (n + 1)
for aa in a:
b[aa] = True
dp = [0] * (n + 5)
dp[0] = 1
for i in range(n):
if not b[i]:
dp[i + 1] += dp[i]
dp[i + 1] %= mod
dp[i + 2] += dp[i]
... | 20 | 18 | 381 | 347 | MOD = 10**9 + 7
N, M = list(map(int, input().split()))
a = [int(eval(input())) for _ in range(M)]
broken = [False] * (N + 1)
for aa in a:
broken[aa] = True
dp = [0] * (N + 1)
dp[0] = 1
for i in range(1, N + 1):
if broken[i]:
continue
if i >= 2:
dp[i] = dp[i - 1] + dp[i - 2]
else:
... | mod = 10**9 + 7
n, m = list(map(int, input().split()))
a = tuple(int(eval(input())) for _ in range(m))
b = [False] * (n + 1)
for aa in a:
b[aa] = True
dp = [0] * (n + 5)
dp[0] = 1
for i in range(n):
if not b[i]:
dp[i + 1] += dp[i]
dp[i + 1] %= mod
dp[i + 2] += dp[i]
dp[i + 2] %= ... | false | 10 | [
"-MOD = 10**9 + 7",
"-N, M = list(map(int, input().split()))",
"-a = [int(eval(input())) for _ in range(M)]",
"-broken = [False] * (N + 1)",
"+mod = 10**9 + 7",
"+n, m = list(map(int, input().split()))",
"+a = tuple(int(eval(input())) for _ in range(m))",
"+b = [False] * (n + 1)",
"- broken[aa] =... | false | 0.037052 | 0.164133 | 0.225743 | [
"s845488157",
"s095119300"
] |
u844789719 | p03576 | python | s493466564 | s835192624 | 1,113 | 34 | 116,120 | 9,204 | Accepted | Accepted | 96.95 | import numpy as np
from numba import njit
N, K, *XY = [int(_) for _ in open(0).read().split()]
XY = np.array(XY, dtype=np.int64).reshape((N, 2)).T
X = np.sort(XY[0])
Y = np.sort(XY[1])
@njit
def solve(XY, X, Y):
v = 4 * 10**18 + 1
ans = np.array([0, 0, 0, 0], dtype=np.int64)
for i1 in range(N - ... | N, K, *XY = [int(_) for _ in open(0).read().split()]
XY = sorted(zip(XY[::2], XY[1::2]))
ans = float('inf')
for i in range(N):
for j in range(i + K - 1, N):
xlen = XY[j][0] - XY[i][0]
Y = sorted(y for x, y in XY[i:j + 1])
ylen = min(y2 - y1 for y1, y2 in zip(Y, Y[K - 1:]))
an... | 27 | 10 | 809 | 358 | import numpy as np
from numba import njit
N, K, *XY = [int(_) for _ in open(0).read().split()]
XY = np.array(XY, dtype=np.int64).reshape((N, 2)).T
X = np.sort(XY[0])
Y = np.sort(XY[1])
@njit
def solve(XY, X, Y):
v = 4 * 10**18 + 1
ans = np.array([0, 0, 0, 0], dtype=np.int64)
for i1 in range(N - 1):
... | N, K, *XY = [int(_) for _ in open(0).read().split()]
XY = sorted(zip(XY[::2], XY[1::2]))
ans = float("inf")
for i in range(N):
for j in range(i + K - 1, N):
xlen = XY[j][0] - XY[i][0]
Y = sorted(y for x, y in XY[i : j + 1])
ylen = min(y2 - y1 for y1, y2 in zip(Y, Y[K - 1 :]))
ans = m... | false | 62.962963 | [
"-import numpy as np",
"-from numba import njit",
"-",
"-XY = np.array(XY, dtype=np.int64).reshape((N, 2)).T",
"-X = np.sort(XY[0])",
"-Y = np.sort(XY[1])",
"-",
"-",
"-@njit",
"-def solve(XY, X, Y):",
"- v = 4 * 10**18 + 1",
"- ans = np.array([0, 0, 0, 0], dtype=np.int64)",
"- for ... | false | 0.354012 | 0.036634 | 9.663383 | [
"s493466564",
"s835192624"
] |
u745554846 | p03072 | python | s218289591 | s248015422 | 19 | 17 | 2,940 | 2,940 | Accepted | Accepted | 10.53 | a = int(eval(input()))
b = [int(i) for i in input().split()]
numbers = 1
for i in range(1, len(b)):
if b[i] >= max(b[0:i]):
numbers += 1
print(numbers) | n = int(eval(input()))
mountains = [int(i) for i in input().split()]
res = 0
for i in range(n):
temp = 1
for j in range(i):
if mountains[j] > mountains[i]:
temp -= 1
break
res += temp
print(res) | 9 | 14 | 167 | 248 | a = int(eval(input()))
b = [int(i) for i in input().split()]
numbers = 1
for i in range(1, len(b)):
if b[i] >= max(b[0:i]):
numbers += 1
print(numbers)
| n = int(eval(input()))
mountains = [int(i) for i in input().split()]
res = 0
for i in range(n):
temp = 1
for j in range(i):
if mountains[j] > mountains[i]:
temp -= 1
break
res += temp
print(res)
| false | 35.714286 | [
"-a = int(eval(input()))",
"-b = [int(i) for i in input().split()]",
"-numbers = 1",
"-for i in range(1, len(b)):",
"- if b[i] >= max(b[0:i]):",
"- numbers += 1",
"-print(numbers)",
"+n = int(eval(input()))",
"+mountains = [int(i) for i in input().split()]",
"+res = 0",
"+for i in rang... | false | 0.043849 | 0.118679 | 0.369478 | [
"s218289591",
"s248015422"
] |
u808427016 | p03290 | python | s664347436 | s675022817 | 1,275 | 21 | 28,004 | 3,064 | Accepted | Accepted | 98.35 | D, G = [int(_) for _ in input().split()]
PC = [[int(_) for _ in input().split()] for i in range(D)]
P = [p for p, c in PC]
C = [c for p, c in PC]
from heapq import *
h = []
heappush(h, (0, 0, (0,)*D))
result = 0
ef = {}
while h:
t, score, pat = heappop(h)
# print(t, score, pat)
if sc... | D, G = [int(_) for _ in input().split()]
PC = [tuple(int(_) for _ in input().split()) for i in range(D)]
from itertools import product
def calc(D, G, PC, es):
r = 0
k = None
result = 0
for i, e, pc in zip(list(range(D)), es, PC):
if e:
r += (i+1) * 100 * pc[0] + pc[1]
... | 45 | 36 | 990 | 862 | D, G = [int(_) for _ in input().split()]
PC = [[int(_) for _ in input().split()] for i in range(D)]
P = [p for p, c in PC]
C = [c for p, c in PC]
from heapq import *
h = []
heappush(h, (0, 0, (0,) * D))
result = 0
ef = {}
while h:
t, score, pat = heappop(h)
# print(t, score, pat)
if score >= G:
res... | D, G = [int(_) for _ in input().split()]
PC = [tuple(int(_) for _ in input().split()) for i in range(D)]
from itertools import product
def calc(D, G, PC, es):
r = 0
k = None
result = 0
for i, e, pc in zip(list(range(D)), es, PC):
if e:
r += (i + 1) * 100 * pc[0] + pc[1]
... | false | 20 | [
"-PC = [[int(_) for _ in input().split()] for i in range(D)]",
"-P = [p for p, c in PC]",
"-C = [c for p, c in PC]",
"-from heapq import *",
"+PC = [tuple(int(_) for _ in input().split()) for i in range(D)]",
"+from itertools import product",
"-h = []",
"-heappush(h, (0, 0, (0,) * D))",
"-result = 0... | false | 0.138769 | 0.048494 | 2.861538 | [
"s664347436",
"s675022817"
] |
u724844363 | p03043 | python | s109800048 | s158056833 | 346 | 91 | 14,292 | 3,060 | Accepted | Accepted | 73.7 | import numpy as np
n, k = list(map(int, input().split()))
e = 0
for i in range(1, n + 1):
if i < k:
if (np.log2(k) - np.log2(i)) == int(np.log2(k) - np.log2(i)):
sh = int(np.log2(k) - np.log2(i)) # 何回コインを投げるか
else:
sh = int(np.log2(k) - np.log2(i) + 1)
e +... | import math
n, k = list(map(int, input().split()))
ans = 0
ma = 10**9
for i in range(1, n+1):
p = math.ceil(math.log2(k) - math.log2(i))
if p >= 1:
ans += 1/(n*2**p)
else:
ans += 1/n
print(ans) | 14 | 13 | 378 | 229 | import numpy as np
n, k = list(map(int, input().split()))
e = 0
for i in range(1, n + 1):
if i < k:
if (np.log2(k) - np.log2(i)) == int(np.log2(k) - np.log2(i)):
sh = int(np.log2(k) - np.log2(i)) # 何回コインを投げるか
else:
sh = int(np.log2(k) - np.log2(i) + 1)
e += (1 / n) ... | import math
n, k = list(map(int, input().split()))
ans = 0
ma = 10**9
for i in range(1, n + 1):
p = math.ceil(math.log2(k) - math.log2(i))
if p >= 1:
ans += 1 / (n * 2**p)
else:
ans += 1 / n
print(ans)
| false | 7.142857 | [
"-import numpy as np",
"+import math",
"-e = 0",
"+ans = 0",
"+ma = 10**9",
"- if i < k:",
"- if (np.log2(k) - np.log2(i)) == int(np.log2(k) - np.log2(i)):",
"- sh = int(np.log2(k) - np.log2(i)) # 何回コインを投げるか",
"- else:",
"- sh = int(np.log2(k) - np.log2(i) +... | false | 0.29856 | 0.096739 | 3.086242 | [
"s109800048",
"s158056833"
] |
u970133396 | p02647 | python | s588337033 | s544160090 | 1,995 | 933 | 34,700 | 131,736 | Accepted | Accepted | 53.23 | import sys
from itertools import accumulate
input=sys.stdin.buffer.readline
def main():
n, k = list(map(int, input().split()))
A = [*list(map(int, input().split()))]
# for _ in range(min(k,int(math.log(n,2)))):
for _ in "_"*k:
b=[0]*(n)
for i,v in enumera... | from numba import jit
import numpy as np
n, k = list(map(int, input().split()))
A = np.array([*list(map(int, input().split()))],dtype=np.int64)
# for _ in range(min(k,int(math.log(n,2)))):
@jit
def loop(A):
for _ in range(k):
b=np.zeros(n,dtype=np.int64)
for i,v in enumera... | 37 | 36 | 826 | 804 | import sys
from itertools import accumulate
input = sys.stdin.buffer.readline
def main():
n, k = list(map(int, input().split()))
A = [*list(map(int, input().split()))]
# for _ in range(min(k,int(math.log(n,2)))):
for _ in "_" * k:
b = [0] * (n)
for i, v in enumerate(A):
if... | from numba import jit
import numpy as np
n, k = list(map(int, input().split()))
A = np.array([*list(map(int, input().split()))], dtype=np.int64)
# for _ in range(min(k,int(math.log(n,2)))):
@jit
def loop(A):
for _ in range(k):
b = np.zeros(n, dtype=np.int64)
for i, v in enumerate(A):
# ... | false | 2.702703 | [
"-import sys",
"-from itertools import accumulate",
"+from numba import jit",
"+import numpy as np",
"-input = sys.stdin.buffer.readline",
"-",
"-",
"-def main():",
"- n, k = list(map(int, input().split()))",
"- A = [*list(map(int, input().split()))]",
"- # for _ in range(min(k,int(math... | false | 0.079502 | 0.111681 | 0.711868 | [
"s588337033",
"s544160090"
] |
u297574184 | p03003 | python | s685771874 | s022062400 | 383 | 351 | 72,796 | 72,540 | Accepted | Accepted | 8.36 | MOD = 10**9 + 7
N, M = list(map(int, input().split()))
Ss = list(map(int, input().split()))
Ts = list(map(int, input().split()))
dp = [[1]*(M+1) for _ in range(N+1)]
for i, S in enumerate(Ss, 1):
for j, T in enumerate(Ts, 1):
dp[i][j] = dp[i-1][j] + dp[i][j-1]
if S != T:
dp[... | def solve():
MOD = 10**9 + 7
N, M = list(map(int, input().split()))
Ss = list(map(int, input().split()))
Ts = list(map(int, input().split()))
dp = [[0]*(M+1) for _ in range(N+1)]
for i in range(N+1):
dp[i][0] = 1
for j in range(M+1):
dp[0][j] = 1
for i, S ... | 15 | 24 | 382 | 580 | MOD = 10**9 + 7
N, M = list(map(int, input().split()))
Ss = list(map(int, input().split()))
Ts = list(map(int, input().split()))
dp = [[1] * (M + 1) for _ in range(N + 1)]
for i, S in enumerate(Ss, 1):
for j, T in enumerate(Ts, 1):
dp[i][j] = dp[i - 1][j] + dp[i][j - 1]
if S != T:
dp[i][... | def solve():
MOD = 10**9 + 7
N, M = list(map(int, input().split()))
Ss = list(map(int, input().split()))
Ts = list(map(int, input().split()))
dp = [[0] * (M + 1) for _ in range(N + 1)]
for i in range(N + 1):
dp[i][0] = 1
for j in range(M + 1):
dp[0][j] = 1
for i, S in enu... | false | 37.5 | [
"-MOD = 10**9 + 7",
"-N, M = list(map(int, input().split()))",
"-Ss = list(map(int, input().split()))",
"-Ts = list(map(int, input().split()))",
"-dp = [[1] * (M + 1) for _ in range(N + 1)]",
"-for i, S in enumerate(Ss, 1):",
"- for j, T in enumerate(Ts, 1):",
"- dp[i][j] = dp[i - 1][j] + dp... | false | 0.120739 | 0.154376 | 0.782113 | [
"s685771874",
"s022062400"
] |
u644907318 | p02787 | python | s843753961 | s982763543 | 665 | 450 | 125,404 | 161,064 | Accepted | Accepted | 32.33 | H,N = list(map(int,input().split()))
A = [list(map(int,input().split())) for _ in range(N)]
A.insert(0,[0,0])
INFTY = 10**9
dp = [[INFTY for _ in range(H+1)] for _ in range(N+1)]
for i in range(N+1):
dp[i][0] = 0
for i in range(1,N+1):
for j in range(1,H+1):
dp[i][j] = dp[i-1][j]
dp[i]... | H,N = list(map(int,input().split()))
A = [list(map(int,input().split())) for _ in range(N)]
INFTY = 10**8
dp = [[INFTY for _ in range(H+1)] for _ in range(N+1)]
for i in range(N+1):
dp[i][0] = 0
for i in range(1,N+1):
for j in range(1,H+1):
dp[i][j] = dp[i-1][j]
if j>=A[i-1][0]:
... | 12 | 14 | 382 | 453 | H, N = list(map(int, input().split()))
A = [list(map(int, input().split())) for _ in range(N)]
A.insert(0, [0, 0])
INFTY = 10**9
dp = [[INFTY for _ in range(H + 1)] for _ in range(N + 1)]
for i in range(N + 1):
dp[i][0] = 0
for i in range(1, N + 1):
for j in range(1, H + 1):
dp[i][j] = dp[i - 1][j]
... | H, N = list(map(int, input().split()))
A = [list(map(int, input().split())) for _ in range(N)]
INFTY = 10**8
dp = [[INFTY for _ in range(H + 1)] for _ in range(N + 1)]
for i in range(N + 1):
dp[i][0] = 0
for i in range(1, N + 1):
for j in range(1, H + 1):
dp[i][j] = dp[i - 1][j]
if j >= A[i - 1]... | false | 14.285714 | [
"-A.insert(0, [0, 0])",
"-INFTY = 10**9",
"+INFTY = 10**8",
"- dp[i][j] = min(dp[i][j], dp[i][max(0, j - A[i][0])] + A[i][1])",
"+ if j >= A[i - 1][0]:",
"+ dp[i][j] = min(dp[i][j], dp[i][j - A[i - 1][0]] + A[i - 1][1])",
"+ else:",
"+ dp[i][j] = min(dp[i][j]... | false | 0.245733 | 0.325449 | 0.755057 | [
"s843753961",
"s982763543"
] |
u384124931 | p03014 | python | s761110120 | s422255713 | 509 | 458 | 68,696 | 109,952 | Accepted | Accepted | 10.02 | h, w = list(map(int, input().split()))
s = [eval(input()) for _ in range(h)]
sy = [0] * w
ret = 0
for y in range(h):
seqx = 0
seqy = 0
for x in range(w):
if s[y][x] == '.':
if sy[x] == 0:
yy = y
while yy < h and s[yy][x] != '#':
... | import numpy as np
import sys
def main():
sin = sys.stdin.buffer
H, W = list(map(int, sin.readline().split()))
grid = np.frombuffer(sin.read(H * (W + 1)), dtype="B") == ord(".")
grid = grid.reshape((H, W + 1))[:, :-1]
L = np.empty((H, W), dtype="i4")
R = np.empty((H, W), dtype="i4"... | 22 | 34 | 552 | 874 | h, w = list(map(int, input().split()))
s = [eval(input()) for _ in range(h)]
sy = [0] * w
ret = 0
for y in range(h):
seqx = 0
seqy = 0
for x in range(w):
if s[y][x] == ".":
if sy[x] == 0:
yy = y
while yy < h and s[yy][x] != "#":
yy += 1... | import numpy as np
import sys
def main():
sin = sys.stdin.buffer
H, W = list(map(int, sin.readline().split()))
grid = np.frombuffer(sin.read(H * (W + 1)), dtype="B") == ord(".")
grid = grid.reshape((H, W + 1))[:, :-1]
L = np.empty((H, W), dtype="i4")
R = np.empty((H, W), dtype="i4")
T = np... | false | 35.294118 | [
"-h, w = list(map(int, input().split()))",
"-s = [eval(input()) for _ in range(h)]",
"-sy = [0] * w",
"-ret = 0",
"-for y in range(h):",
"- seqx = 0",
"- seqy = 0",
"- for x in range(w):",
"- if s[y][x] == \".\":",
"- if sy[x] == 0:",
"- yy = y",
"- ... | false | 0.082488 | 0.170137 | 0.484833 | [
"s761110120",
"s422255713"
] |
u491550356 | p02711 | python | s522373159 | s400826546 | 22 | 20 | 8,952 | 9,092 | Accepted | Accepted | 9.09 | N = eval(input())
print(("Yes" if N.find("7") >= 0 else "No")) | N = eval(input())
print(("Yes" if "7" in N else "No")) | 2 | 2 | 55 | 47 | N = eval(input())
print(("Yes" if N.find("7") >= 0 else "No"))
| N = eval(input())
print(("Yes" if "7" in N else "No"))
| false | 0 | [
"-print((\"Yes\" if N.find(\"7\") >= 0 else \"No\"))",
"+print((\"Yes\" if \"7\" in N else \"No\"))"
] | false | 0.106102 | 0.04477 | 2.369944 | [
"s522373159",
"s400826546"
] |
u094155508 | p02713 | python | s612639461 | s587206027 | 936 | 478 | 72,348 | 68,740 | Accepted | Accepted | 48.93 | import math
from functools import reduce
from itertools import product
def resolve():
K = int(eval(input()))
gcd = math.gcd
step1 = [ gcd(x[0], x[1]) for x in product(list(range(1, K+1)), list(range(1, K+1))) ]
result = sum([ gcd(x[0], x[1]) for x in product(step1, list(range(1, K+1))) ])
print(resu... | import math
k = int(eval(input()))
ans = 0
for i in range(1, k+1):
for j in range(1, k+1):
for l in range(1, k+1):
ans += math.gcd(math.gcd(i,j), l)
print(ans)
| 13 | 11 | 345 | 191 | import math
from functools import reduce
from itertools import product
def resolve():
K = int(eval(input()))
gcd = math.gcd
step1 = [
gcd(x[0], x[1]) for x in product(list(range(1, K + 1)), list(range(1, K + 1)))
]
result = sum([gcd(x[0], x[1]) for x in product(step1, list(range(1, K + 1))... | import math
k = int(eval(input()))
ans = 0
for i in range(1, k + 1):
for j in range(1, k + 1):
for l in range(1, k + 1):
ans += math.gcd(math.gcd(i, j), l)
print(ans)
| false | 15.384615 | [
"-from functools import reduce",
"-from itertools import product",
"-",
"-def resolve():",
"- K = int(eval(input()))",
"- gcd = math.gcd",
"- step1 = [",
"- gcd(x[0], x[1]) for x in product(list(range(1, K + 1)), list(range(1, K + 1)))",
"- ]",
"- result = sum([gcd(x[0], x[1]... | false | 0.143651 | 0.086559 | 1.659577 | [
"s612639461",
"s587206027"
] |
u729133443 | p03808 | python | s091879334 | s026916624 | 256 | 66 | 69,920 | 14,068 | Accepted | Accepted | 74.22 | n,*a=list(map(int,open(0).read().split()))
b,m=sum(a),n*-~n//2
n-=1
c=b//m
f=b%m>0
for i,j in zip(*[iter([a[-1]]+a*2)]*2):
j-=i
if n:
t=min(0,j//n)
f|=c!=j+n*-t-t
print(('YNEOS'[f::2])) | n,*a=list(map(int,open(0).read().split()))
q,m=divmod(sum(a),n*-~n//2)
print(('YNEOS'[any((y-x-q)%n+m or y-x>q for x,y in zip(a,a[1:]))::2])) | 11 | 3 | 199 | 135 | n, *a = list(map(int, open(0).read().split()))
b, m = sum(a), n * -~n // 2
n -= 1
c = b // m
f = b % m > 0
for i, j in zip(*[iter([a[-1]] + a * 2)] * 2):
j -= i
if n:
t = min(0, j // n)
f |= c != j + n * -t - t
print(("YNEOS"[f::2]))
| n, *a = list(map(int, open(0).read().split()))
q, m = divmod(sum(a), n * -~n // 2)
print(("YNEOS"[any((y - x - q) % n + m or y - x > q for x, y in zip(a, a[1:])) :: 2]))
| false | 72.727273 | [
"-b, m = sum(a), n * -~n // 2",
"-n -= 1",
"-c = b // m",
"-f = b % m > 0",
"-for i, j in zip(*[iter([a[-1]] + a * 2)] * 2):",
"- j -= i",
"- if n:",
"- t = min(0, j // n)",
"- f |= c != j + n * -t - t",
"-print((\"YNEOS\"[f::2]))",
"+q, m = divmod(sum(a), n * -~n // 2)",
"... | false | 0.036338 | 0.034667 | 1.048185 | [
"s091879334",
"s026916624"
] |
u724687935 | p03682 | python | s570306901 | s977945850 | 1,994 | 1,232 | 144,464 | 50,788 | Accepted | Accepted | 38.21 | import sys
class UnionFind():
def __init__(self, n):
self.parents = [-1] * n
def find(self, x):
if self.parents[x] < 0:
return x
else:
self.parents[x] = self.find(self.parents[x])
return self.parents[x]
def union(self, x, y):
... | import sys
class UnionFind():
def __init__(self, n):
self.parents = [-1] * n
def find(self, x):
if self.parents[x] < 0:
return x
else:
self.parents[x] = self.find(self.parents[x])
return self.parents[x]
def union(self, x, y):
... | 63 | 60 | 1,199 | 1,140 | import sys
class UnionFind:
def __init__(self, n):
self.parents = [-1] * n
def find(self, x):
if self.parents[x] < 0:
return x
else:
self.parents[x] = self.find(self.parents[x])
return self.parents[x]
def union(self, x, y):
x = self.fin... | import sys
class UnionFind:
def __init__(self, n):
self.parents = [-1] * n
def find(self, x):
if self.parents[x] < 0:
return x
else:
self.parents[x] = self.find(self.parents[x])
return self.parents[x]
def union(self, x, y):
x = self.fin... | false | 4.761905 | [
"- if uf.parents[uf.find(0)] == -N:",
"- break"
] | false | 0.040964 | 0.039529 | 1.036304 | [
"s570306901",
"s977945850"
] |
u941438707 | p03380 | python | s624136426 | s440162667 | 111 | 68 | 14,028 | 14,028 | Accepted | Accepted | 38.74 | n,*a=list(map(int,open(0).read().split()))
a.sort()
b=a[-1]
c=a[0]
d=b/2-c
for i in a:
if d>abs(b/2-i):
c=i
d=abs(b/2-i)
print((b,c)) | n,*a=list(map(int,open(0).read().split()))
n=max(a)
print((n,min((abs(n/2-i),i)for i in a)[1])) | 10 | 3 | 154 | 89 | n, *a = list(map(int, open(0).read().split()))
a.sort()
b = a[-1]
c = a[0]
d = b / 2 - c
for i in a:
if d > abs(b / 2 - i):
c = i
d = abs(b / 2 - i)
print((b, c))
| n, *a = list(map(int, open(0).read().split()))
n = max(a)
print((n, min((abs(n / 2 - i), i) for i in a)[1]))
| false | 70 | [
"-a.sort()",
"-b = a[-1]",
"-c = a[0]",
"-d = b / 2 - c",
"-for i in a:",
"- if d > abs(b / 2 - i):",
"- c = i",
"- d = abs(b / 2 - i)",
"-print((b, c))",
"+n = max(a)",
"+print((n, min((abs(n / 2 - i), i) for i in a)[1]))"
] | false | 0.034386 | 0.034699 | 0.990988 | [
"s624136426",
"s440162667"
] |
u366959492 | p03161 | python | s432292064 | s340240009 | 1,940 | 383 | 13,928 | 52,448 | Accepted | Accepted | 80.26 | n,k=list(map(int,input().split()))
h=list(map(int,input().split()))
dp=[0]*n
def calc(n,k,h,dp):
for i in range(1,n):
dp[i]=min([dp[j] + abs(h[i]-h[j]) for j in range(max(i-k,0),i)])
calc(n,k,h,dp)
print((dp[-1]))
| n,k=list(map(int,input().split()))
h=list(map(int,input().split()))
h+=[0]*k
inf=10**9
dp=[inf]*(n+k)
dp[0]=0
for i in range(n):
for j in range(1,k+1):
dp[i+j]=min(dp[i]+abs(h[i]-h[i+j]),dp[i+j])
print((dp[n-1]))
| 10 | 10 | 229 | 226 | n, k = list(map(int, input().split()))
h = list(map(int, input().split()))
dp = [0] * n
def calc(n, k, h, dp):
for i in range(1, n):
dp[i] = min([dp[j] + abs(h[i] - h[j]) for j in range(max(i - k, 0), i)])
calc(n, k, h, dp)
print((dp[-1]))
| n, k = list(map(int, input().split()))
h = list(map(int, input().split()))
h += [0] * k
inf = 10**9
dp = [inf] * (n + k)
dp[0] = 0
for i in range(n):
for j in range(1, k + 1):
dp[i + j] = min(dp[i] + abs(h[i] - h[i + j]), dp[i + j])
print((dp[n - 1]))
| false | 0 | [
"-dp = [0] * n",
"-",
"-",
"-def calc(n, k, h, dp):",
"- for i in range(1, n):",
"- dp[i] = min([dp[j] + abs(h[i] - h[j]) for j in range(max(i - k, 0), i)])",
"-",
"-",
"-calc(n, k, h, dp)",
"-print((dp[-1]))",
"+h += [0] * k",
"+inf = 10**9",
"+dp = [inf] * (n + k)",
"+dp[0] = 0... | false | 0.279711 | 0.037143 | 7.530554 | [
"s432292064",
"s340240009"
] |
u588341295 | p03172 | python | s983133600 | s574411317 | 777 | 321 | 135,768 | 90,576 | Accepted | Accepted | 58.69 | # -*- coding: utf-8 -*-
import sys
from functools import reduce
def input(): return sys.stdin.readline().strip()
def ceil(a, b=1): return int(-(-a // b))
def round(x): return int((x*2+1) // 2)
def fermat(x, y, MOD): return x * pow(y, MOD-2, MOD) % MOD
def lcm(x, y): return (x * y) // gcd(x, y)
def lcm_list(n... | # -*- coding: utf-8 -*-
import sys
import numpy as np
from functools import reduce
def input(): return sys.stdin.readline().strip()
def ceil(a, b=1): return int(-(-a // b))
def round(x): return int((x*2+1) // 2)
def fermat(x, y, MOD): return x * pow(y, MOD-2, MOD) % MOD
def lcm(x, y): return (x * y) // gcd(x... | 39 | 38 | 1,115 | 1,063 | # -*- coding: utf-8 -*-
import sys
from functools import reduce
def input():
return sys.stdin.readline().strip()
def ceil(a, b=1):
return int(-(-a // b))
def round(x):
return int((x * 2 + 1) // 2)
def fermat(x, y, MOD):
return x * pow(y, MOD - 2, MOD) % MOD
def lcm(x, y):
return (x * y) //... | # -*- coding: utf-8 -*-
import sys
import numpy as np
from functools import reduce
def input():
return sys.stdin.readline().strip()
def ceil(a, b=1):
return int(-(-a // b))
def round(x):
return int((x * 2 + 1) // 2)
def fermat(x, y, MOD):
return x * pow(y, MOD - 2, MOD) % MOD
def lcm(x, y):
... | false | 2.564103 | [
"+import numpy as np",
"-aN = LIST()",
"+A = LIST()",
"-dp = [[0] * (K + 1) for i in range(N + 1)]",
"+dp = np.zeros((N + 1, K + 1), dtype=np.int64)",
"-dp[0][0] = 1",
"-for i in range(N):",
"- sm = [0] * (K + 2)",
"- # 今回送るi行について累積和を取る",
"- for j in range(1, K + 2):",
"- sm[j] =... | false | 0.940022 | 0.852928 | 1.102112 | [
"s983133600",
"s574411317"
] |
u353919145 | p02909 | python | s314160696 | s032224356 | 19 | 17 | 3,060 | 2,940 | Accepted | Accepted | 10.53 | x=eval(input())
if x=="Sunny" :
print("Cloudy")
if x=="Cloudy" :
print("Rainy")
if x=="Rainy" :
print("Sunny") | S = eval(input())
sun = "Sunny"
clo = "Cloudy"
rai = "Rainy"
if S == sun:
S = clo
print(S)
elif S == rai:
S = sun
print(S)
elif S == clo:
S = rai
print(S) | 7 | 13 | 114 | 184 | x = eval(input())
if x == "Sunny":
print("Cloudy")
if x == "Cloudy":
print("Rainy")
if x == "Rainy":
print("Sunny")
| S = eval(input())
sun = "Sunny"
clo = "Cloudy"
rai = "Rainy"
if S == sun:
S = clo
print(S)
elif S == rai:
S = sun
print(S)
elif S == clo:
S = rai
print(S)
| false | 46.153846 | [
"-x = eval(input())",
"-if x == \"Sunny\":",
"- print(\"Cloudy\")",
"-if x == \"Cloudy\":",
"- print(\"Rainy\")",
"-if x == \"Rainy\":",
"- print(\"Sunny\")",
"+S = eval(input())",
"+sun = \"Sunny\"",
"+clo = \"Cloudy\"",
"+rai = \"Rainy\"",
"+if S == sun:",
"+ S = clo",
"+ ... | false | 0.078097 | 0.104645 | 0.746305 | [
"s314160696",
"s032224356"
] |
u714878632 | p02929 | python | s057952688 | s332980553 | 115 | 86 | 4,916 | 3,516 | Accepted | Accepted | 25.22 | def main():
n = int(eval(input()))
s = eval(input())
divider = pow(10, 9) + 7
if s[0] == "W" or s[2 * n - 1] == "W":
print((0))
return
lr = [True]
for i in range(1, 2 * n - 1):
if s[i - 1] == s[i]:
lr.append(not lr[i - 1])
else:
... | def main():
n = int(eval(input()))
s = eval(input())
divider = pow(10, 9) + 7
if s[0] == "W" or s[2 * n - 1] == "W":
print((0))
return
flag = True
cnt = 1
ret = 1
for i in range(1, 2 * n):
if s[i - 1] == s[i]:
flag = not flag
if fl... | 35 | 31 | 732 | 619 | def main():
n = int(eval(input()))
s = eval(input())
divider = pow(10, 9) + 7
if s[0] == "W" or s[2 * n - 1] == "W":
print((0))
return
lr = [True]
for i in range(1, 2 * n - 1):
if s[i - 1] == s[i]:
lr.append(not lr[i - 1])
else:
lr.append(l... | def main():
n = int(eval(input()))
s = eval(input())
divider = pow(10, 9) + 7
if s[0] == "W" or s[2 * n - 1] == "W":
print((0))
return
flag = True
cnt = 1
ret = 1
for i in range(1, 2 * n):
if s[i - 1] == s[i]:
flag = not flag
if flag:
... | false | 11.428571 | [
"- lr = [True]",
"- for i in range(1, 2 * n - 1):",
"+ flag = True",
"+ cnt = 1",
"+ ret = 1",
"+ for i in range(1, 2 * n):",
"- lr.append(not lr[i - 1])",
"- else:",
"- lr.append(lr[i - 1])",
"- lr.append(False)",
"- ret = 1",
"- cnt = 0... | false | 0.047734 | 0.047162 | 1.012126 | [
"s057952688",
"s332980553"
] |
u423585790 | p02819 | python | s174584794 | s816585059 | 248 | 174 | 48,624 | 39,152 | Accepted | Accepted | 29.84 | #!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(... | n = int(eval(input()))
def f(x):
for k in range(2, int(x**0.5) + 1):
if x % k != 0:
continue
return False
return True
i = n
while 1:
if f(i):
print(i)
break
i += 1 | 53 | 13 | 1,665 | 229 | #!/usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI():
return list(map(int, input().split()))
def LF... | n = int(eval(input()))
def f(x):
for k in range(2, int(x**0.5) + 1):
if x % k != 0:
continue
return False
return True
i = n
while 1:
if f(i):
print(i)
break
i += 1
| false | 75.471698 | [
"-#!/usr/bin/env python3",
"-from collections import defaultdict, deque",
"-from heapq import heappush, heappop",
"-from bisect import bisect_left, bisect_right",
"-import sys, random, itertools, math",
"-",
"-sys.setrecursionlimit(10**5)",
"-input = sys.stdin.readline",
"-sqrt = math.sqrt",
"+n =... | false | 0.073303 | 0.034139 | 2.147191 | [
"s174584794",
"s816585059"
] |
u462434199 | p03283 | python | s250792567 | s060100330 | 1,857 | 1,508 | 57,540 | 66,896 | Accepted | Accepted | 18.79 | import numpy as np
n,m,q=list(map(int, input().split()))
a=np.array([list(map(int, input().split())) for i in range(m)])
b=[list(map(int, input().split())) for i in range(q)]
x=np.zeros((501, 501), dtype=np.int)
np.add.at(x, (a[:, 0], a[:, 1]), 1)
np.cumsum(x, axis=0, out=x)
np.cumsum(x, axis=1, out=x)... | import numpy as np
import sys
n, m, q = list(map(int, input().split()))
ab = np.array(sys.stdin.read().split(), np.int)
a = ab[:m*2].reshape(m, 2)
b = ab[m*2:].reshape(q, 2)
x=np.zeros((501, 501), dtype=np.int)
np.add.at(x, (a[:, 0], a[:, 1]), 1)
np.cumsum(x, axis=0, out=x)
np.cumsum(x, axis=1, out=x)
... | 22 | 24 | 479 | 478 | import numpy as np
n, m, q = list(map(int, input().split()))
a = np.array([list(map(int, input().split())) for i in range(m)])
b = [list(map(int, input().split())) for i in range(q)]
x = np.zeros((501, 501), dtype=np.int)
np.add.at(x, (a[:, 0], a[:, 1]), 1)
np.cumsum(x, axis=0, out=x)
np.cumsum(x, axis=1, out=x)
for i... | import numpy as np
import sys
n, m, q = list(map(int, input().split()))
ab = np.array(sys.stdin.read().split(), np.int)
a = ab[: m * 2].reshape(m, 2)
b = ab[m * 2 :].reshape(q, 2)
x = np.zeros((501, 501), dtype=np.int)
np.add.at(x, (a[:, 0], a[:, 1]), 1)
np.cumsum(x, axis=0, out=x)
np.cumsum(x, axis=1, out=x)
for i in... | false | 8.333333 | [
"+import sys",
"-a = np.array([list(map(int, input().split())) for i in range(m)])",
"-b = [list(map(int, input().split())) for i in range(q)]",
"+ab = np.array(sys.stdin.read().split(), np.int)",
"+a = ab[: m * 2].reshape(m, 2)",
"+b = ab[m * 2 :].reshape(q, 2)"
] | false | 0.270614 | 0.560264 | 0.483011 | [
"s250792567",
"s060100330"
] |
u218843509 | p02589 | python | s144931499 | s276489178 | 2,970 | 2,584 | 597,876 | 598,252 | Accepted | Accepted | 13 | import sys
def input():
return sys.stdin.readline()[:-1]
BASE, MOD = 1999849216943526259, (1<<61)-1
d = dict()
ans = 0
ss = [str(eval(input()))[::-1] for _ in range(int(eval(input())))]
zero = [0 for _ in range(26)]
ss.sort(key=lambda x: -len(x))
for s in ss:
n = len(s)
if n == 1:
ans += zero[ord(s... | import sys
def input():
return sys.stdin.readline()[:-1]
BASE, MOD = 1999849216943526259, (1<<61)-1
d = dict()
ans = 0
ss = [input()[::-1] for _ in range(int(eval(input())))]
zero = [0 for _ in range(26)]
ss.sort(key=lambda x: -len(x))
for s in ss:
n = len(s)
if n == 1:
ans += zero[ord(s[n-1])-97]
... | 34 | 34 | 876 | 871 | import sys
def input():
return sys.stdin.readline()[:-1]
BASE, MOD = 1999849216943526259, (1 << 61) - 1
d = dict()
ans = 0
ss = [str(eval(input()))[::-1] for _ in range(int(eval(input())))]
zero = [0 for _ in range(26)]
ss.sort(key=lambda x: -len(x))
for s in ss:
n = len(s)
if n == 1:
ans += zer... | import sys
def input():
return sys.stdin.readline()[:-1]
BASE, MOD = 1999849216943526259, (1 << 61) - 1
d = dict()
ans = 0
ss = [input()[::-1] for _ in range(int(eval(input())))]
zero = [0 for _ in range(26)]
ss.sort(key=lambda x: -len(x))
for s in ss:
n = len(s)
if n == 1:
ans += zero[ord(s[n -... | false | 0 | [
"-ss = [str(eval(input()))[::-1] for _ in range(int(eval(input())))]",
"+ss = [input()[::-1] for _ in range(int(eval(input())))]"
] | false | 0.048478 | 0.048103 | 1.007802 | [
"s144931499",
"s276489178"
] |
u300645821 | p00760 | python | s802308022 | s996697758 | 30 | 20 | 6,724 | 4,208 | Accepted | Accepted | 33.33 | import sys
if sys.version_info[0]>=3: raw_input=input
n=int(input())
for i in range(0,n):
a=[int(e) for e in input().split()]
a[0]-=1;a[1]-=1
print((196471-a[0]*195-a[0]//3*5-a[1]*20+(a[1]//2 if a[0]%3!=2 else 0)-a[2])) | n=int(input())
for i in range(0,n):
y,m,d=[int(e) for e in input().split()]
y-=1;m-=1
print((196471-y*195-y//3*5-m*20+(m//2 if y%3!=2 else 0)-d)) | 8 | 5 | 236 | 158 | import sys
if sys.version_info[0] >= 3:
raw_input = input
n = int(input())
for i in range(0, n):
a = [int(e) for e in input().split()]
a[0] -= 1
a[1] -= 1
print(
(
196471
- a[0] * 195
- a[0] // 3 * 5
- a[1] * 20
+ (a[1] // 2 if a[0... | n = int(input())
for i in range(0, n):
y, m, d = [int(e) for e in input().split()]
y -= 1
m -= 1
print((196471 - y * 195 - y // 3 * 5 - m * 20 + (m // 2 if y % 3 != 2 else 0) - d))
| false | 37.5 | [
"-import sys",
"-",
"-if sys.version_info[0] >= 3:",
"- raw_input = input",
"- a = [int(e) for e in input().split()]",
"- a[0] -= 1",
"- a[1] -= 1",
"- print(",
"- (",
"- 196471",
"- - a[0] * 195",
"- - a[0] // 3 * 5",
"- - a[... | false | 0.056197 | 0.034649 | 1.621905 | [
"s802308022",
"s996697758"
] |
u562935282 | p03309 | python | s391011696 | s958113137 | 224 | 195 | 26,180 | 26,836 | Accepted | Accepted | 12.95 | N = int(eval(input()))
A = list(map(int, input().split()))
B = list(A_i - (i + 1) for i, A_i in enumerate(A))
B_sorted = sorted(B)
ans = []
##中央値のインデックスmを求める
if N % 2 == 1:
##Nが奇数: 中央値のインデックスを求める
m = int((N - 1) / 2 + 1) - 1
b = B_sorted[m]
ans += [sum(abs(x - b) for x in B_sorted)]
else:
... | N = int(eval(input()))
a = list(map(int, input().split()))
a = [a[i] - (i + 1) for i in range(N)]
a = sorted(a)
if N % 2 == 0:
t = (a[N // 2 - 1] + a[N // 2]) // 2
else:
t = a[N // 2]
ans = sum(abs(aa - t) for aa in a)
print(ans)
| 18 | 12 | 496 | 245 | N = int(eval(input()))
A = list(map(int, input().split()))
B = list(A_i - (i + 1) for i, A_i in enumerate(A))
B_sorted = sorted(B)
ans = []
##中央値のインデックスmを求める
if N % 2 == 1:
##Nが奇数: 中央値のインデックスを求める
m = int((N - 1) / 2 + 1) - 1
b = B_sorted[m]
ans += [sum(abs(x - b) for x in B_sorted)]
else:
##Nが偶数: 中央... | N = int(eval(input()))
a = list(map(int, input().split()))
a = [a[i] - (i + 1) for i in range(N)]
a = sorted(a)
if N % 2 == 0:
t = (a[N // 2 - 1] + a[N // 2]) // 2
else:
t = a[N // 2]
ans = sum(abs(aa - t) for aa in a)
print(ans)
| false | 33.333333 | [
"-A = list(map(int, input().split()))",
"-B = list(A_i - (i + 1) for i, A_i in enumerate(A))",
"-B_sorted = sorted(B)",
"-ans = []",
"-##中央値のインデックスmを求める",
"-if N % 2 == 1:",
"- ##Nが奇数: 中央値のインデックスを求める",
"- m = int((N - 1) / 2 + 1) - 1",
"- b = B_sorted[m]",
"- ans += [sum(abs(x - b) for... | false | 0.096739 | 0.090426 | 1.069811 | [
"s391011696",
"s958113137"
] |
u434966508 | p03102 | python | s089248054 | s983562124 | 74 | 60 | 62,052 | 62,208 | Accepted | Accepted | 18.92 | N,M,C=list(map(int,input().split()))
B=list(map(int,input().split()))
A=[list(map(int,input().split())) for _ in range(N)]
cnt=0
for i in range(N):
ans=0
for j in range(M):
ans += B[j]*A[i][j]
if ans+C>0:
cnt+=1
print(cnt) | N,M,C=list(map(int,input().split()))
B=list(map(int,input().split()))
cnt=0
for i in range(N):
am=0
A=list(map(int,input().split()))
for j in range(M):
am+=B[j]*A[j]
if am+C>0:
cnt+=1
print(cnt) | 13 | 11 | 258 | 230 | N, M, C = list(map(int, input().split()))
B = list(map(int, input().split()))
A = [list(map(int, input().split())) for _ in range(N)]
cnt = 0
for i in range(N):
ans = 0
for j in range(M):
ans += B[j] * A[i][j]
if ans + C > 0:
cnt += 1
print(cnt)
| N, M, C = list(map(int, input().split()))
B = list(map(int, input().split()))
cnt = 0
for i in range(N):
am = 0
A = list(map(int, input().split()))
for j in range(M):
am += B[j] * A[j]
if am + C > 0:
cnt += 1
print(cnt)
| false | 15.384615 | [
"-A = [list(map(int, input().split())) for _ in range(N)]",
"- ans = 0",
"+ am = 0",
"+ A = list(map(int, input().split()))",
"- ans += B[j] * A[i][j]",
"- if ans + C > 0:",
"+ am += B[j] * A[j]",
"+ if am + C > 0:"
] | false | 0.093643 | 0.06824 | 1.372262 | [
"s089248054",
"s983562124"
] |
u145950990 | p03145 | python | s790647980 | s645276892 | 170 | 18 | 38,256 | 2,940 | Accepted | Accepted | 89.41 | a,b,c = list(map(int,input().split()))
print((a*b//2)) | a,b,c = sorted(map(int,input().split()))
print((a*b//2)) | 2 | 2 | 47 | 55 | a, b, c = list(map(int, input().split()))
print((a * b // 2))
| a, b, c = sorted(map(int, input().split()))
print((a * b // 2))
| false | 0 | [
"-a, b, c = list(map(int, input().split()))",
"+a, b, c = sorted(map(int, input().split()))"
] | false | 0.088041 | 0.04313 | 2.04129 | [
"s790647980",
"s645276892"
] |
u947883560 | p02881 | python | s694648783 | s950311474 | 293 | 182 | 3,440 | 28,984 | Accepted | Accepted | 37.88 | #!/usr/bin/env python3
import sys
INF = float("inf")
import math
import collections
def divisors_kai(n):
ret = 1
for i in range(1, int(n ** 0.5) + 1):
d, m = divmod(n, i)
if m == 0:
ret = i
# ret.add(d)
return ret
def solve(N: int):
a = div... | #!/usr/bin/env python3
import sys
import numpy as np
import math
def solve(N: int):
x = np.arange(1, np.sqrt(N)+1, dtype=np.int)
div = x[N % x == 0]
print(((N/div + div - 2).min().astype(np.int)))
return
def main():
def iterate_tokens():
for line in sys.stdin:
... | 38 | 27 | 659 | 506 | #!/usr/bin/env python3
import sys
INF = float("inf")
import math
import collections
def divisors_kai(n):
ret = 1
for i in range(1, int(n**0.5) + 1):
d, m = divmod(n, i)
if m == 0:
ret = i
# ret.add(d)
return ret
def solve(N: int):
a = divisors_kai(N)
b = ... | #!/usr/bin/env python3
import sys
import numpy as np
import math
def solve(N: int):
x = np.arange(1, np.sqrt(N) + 1, dtype=np.int)
div = x[N % x == 0]
print(((N / div + div - 2).min().astype(np.int)))
return
def main():
def iterate_tokens():
for line in sys.stdin:
for word in... | false | 28.947368 | [
"-",
"-INF = float(\"inf\")",
"+import numpy as np",
"-import collections",
"-",
"-",
"-def divisors_kai(n):",
"- ret = 1",
"- for i in range(1, int(n**0.5) + 1):",
"- d, m = divmod(n, i)",
"- if m == 0:",
"- ret = i",
"- # ret.add(d)",
"- retur... | false | 0.04476 | 0.34393 | 0.130143 | [
"s694648783",
"s950311474"
] |
u894934980 | p03162 | python | s823480165 | s199056850 | 1,464 | 704 | 14,772 | 31,732 | Accepted | Accepted | 51.91 | import numpy as np
N = int(eval(input()))
dp = np.zeros((N+1, 3), dtype=int)
for i in range(1, N+1):
a, b, c = list(map(int, input().split(' ')))
dp[i][0] = max(dp[i-1][1], dp[i-1][2]) + a
dp[i][1] = max(dp[i-1][0], dp[i-1][2]) + b
dp[i][2] = max(dp[i-1][0], dp[i-1][1]) + c
print((np.max(dp[-1])... | import numpy as np
N = int(eval(input()))
dp = [[0, 0, 0] for i in range(N+1)]
for i in range(1, N+1):
a, b, c = list(map(int, input().split(' ')))
dp[i][0] = max(dp[i-1][1], dp[i-1][2]) + a
dp[i][1] = max(dp[i-1][0], dp[i-1][2]) + b
dp[i][2] = max(dp[i-1][0], dp[i-1][1]) + c
print((np.max(dp[-1... | 9 | 9 | 314 | 316 | import numpy as np
N = int(eval(input()))
dp = np.zeros((N + 1, 3), dtype=int)
for i in range(1, N + 1):
a, b, c = list(map(int, input().split(" ")))
dp[i][0] = max(dp[i - 1][1], dp[i - 1][2]) + a
dp[i][1] = max(dp[i - 1][0], dp[i - 1][2]) + b
dp[i][2] = max(dp[i - 1][0], dp[i - 1][1]) + c
print((np.ma... | import numpy as np
N = int(eval(input()))
dp = [[0, 0, 0] for i in range(N + 1)]
for i in range(1, N + 1):
a, b, c = list(map(int, input().split(" ")))
dp[i][0] = max(dp[i - 1][1], dp[i - 1][2]) + a
dp[i][1] = max(dp[i - 1][0], dp[i - 1][2]) + b
dp[i][2] = max(dp[i - 1][0], dp[i - 1][1]) + c
print((np.... | false | 0 | [
"-dp = np.zeros((N + 1, 3), dtype=int)",
"+dp = [[0, 0, 0] for i in range(N + 1)]"
] | false | 0.43276 | 0.276558 | 1.564809 | [
"s823480165",
"s199056850"
] |
u691018832 | p03497 | python | s943408187 | s688647989 | 228 | 114 | 50,528 | 34,148 | Accepted | Accepted | 50 | import collections
import sys
input = sys.stdin.readline
n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
ans = 0
set_a = set(a)
count_a = collections.Counter(a).most_common()[::-1]
if len(set_a)-k > 0:
for i in range(len(set_a)-k):
ans += count_a[i][1]
print(ans) | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)
from collections import Counter
n, k, *a = list(map(int, read().split()))
counter = sorted(Counter(a).values())
ans = 0
for i in range(len(counter) - k):
a... | 13 | 14 | 309 | 343 | import collections
import sys
input = sys.stdin.readline
n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
ans = 0
set_a = set(a)
count_a = collections.Counter(a).most_common()[::-1]
if len(set_a) - k > 0:
for i in range(len(set_a) - k):
ans += count_a[i][1]
print(ans)
| import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**7)
from collections import Counter
n, k, *a = list(map(int, read().split()))
counter = sorted(Counter(a).values())
ans = 0
for i in range(len(counter) - k):
ans += counter[... | false | 7.142857 | [
"-import collections",
"-input = sys.stdin.readline",
"-n, k = list(map(int, input().split()))",
"-a = list(map(int, input().split()))",
"+read = sys.stdin.buffer.read",
"+readline = sys.stdin.buffer.readline",
"+readlines = sys.stdin.buffer.readlines",
"+sys.setrecursionlimit(10**7)",
"+from collec... | false | 0.0366 | 0.079587 | 0.459868 | [
"s943408187",
"s688647989"
] |
u867320886 | p03798 | python | s537811383 | s021155026 | 342 | 242 | 5,620 | 3,444 | Accepted | Accepted | 29.24 | def get_next(sw_prev2,sw_prev1,ox_prev1):
rev_ox = {"o":"x", "x":"o"}
rev_sw = {"S":"W", "W":"S"}
sw = sw_prev2
if sw_prev1 == "W": ox_prev1 = rev_ox[ox_prev1]
if ox_prev1 == "x": sw = rev_sw[sw]
return sw
n = int(eval(input()))
ox = eval(input())
ans = [None] * (n... | rev_ox = {"o":"x", "x":"o"}
rev_sw = {"S":"W", "W":"S"}
def get_next(sw_prev2,sw_prev1,ox_prev1):
sw = sw_prev2
if sw_prev1 == "W": ox_prev1 = rev_ox[ox_prev1]
if ox_prev1 == "x": sw = rev_sw[sw]
return sw
n = int(eval(input()))
ox = eval(input())
for sw0,sw1 in [("S","S")... | 29 | 27 | 643 | 593 | def get_next(sw_prev2, sw_prev1, ox_prev1):
rev_ox = {"o": "x", "x": "o"}
rev_sw = {"S": "W", "W": "S"}
sw = sw_prev2
if sw_prev1 == "W":
ox_prev1 = rev_ox[ox_prev1]
if ox_prev1 == "x":
sw = rev_sw[sw]
return sw
n = int(eval(input()))
ox = eval(input())
ans = [None] * (n + 2)
f... | rev_ox = {"o": "x", "x": "o"}
rev_sw = {"S": "W", "W": "S"}
def get_next(sw_prev2, sw_prev1, ox_prev1):
sw = sw_prev2
if sw_prev1 == "W":
ox_prev1 = rev_ox[ox_prev1]
if ox_prev1 == "x":
sw = rev_sw[sw]
return sw
n = int(eval(input()))
ox = eval(input())
for sw0, sw1 in [("S", "S"), (... | false | 6.896552 | [
"+rev_ox = {\"o\": \"x\", \"x\": \"o\"}",
"+rev_sw = {\"S\": \"W\", \"W\": \"S\"}",
"+",
"+",
"- rev_ox = {\"o\": \"x\", \"x\": \"o\"}",
"- rev_sw = {\"S\": \"W\", \"W\": \"S\"}",
"-ans = [None] * (n + 2)",
"- ans[0] = sw0",
"- ans[1] = sw1",
"+ ans = \"\"",
"+ ans = sw0 + sw1"... | false | 0.077468 | 0.082295 | 0.941352 | [
"s537811383",
"s021155026"
] |
u767664985 | p03262 | python | s762679822 | s657377772 | 107 | 98 | 16,280 | 16,240 | Accepted | Accepted | 8.41 | from fractions import gcd
N, X = list(map(int, input().split()))
x = list(map(int, input().split()))
y = list([abs(X - i) for i in x])
ans = y[0]
for i in range(1, N):
ans = gcd(ans, y[i])
print(ans)
| from fractions import gcd
N, X = list(map(int, input().split()))
x = list(map(int, input().split()))
ans = abs(x[0] - X)
for i in range(1, N):
ans = gcd(ans, abs(x[i] - X))
print(ans)
| 9 | 10 | 209 | 194 | from fractions import gcd
N, X = list(map(int, input().split()))
x = list(map(int, input().split()))
y = list([abs(X - i) for i in x])
ans = y[0]
for i in range(1, N):
ans = gcd(ans, y[i])
print(ans)
| from fractions import gcd
N, X = list(map(int, input().split()))
x = list(map(int, input().split()))
ans = abs(x[0] - X)
for i in range(1, N):
ans = gcd(ans, abs(x[i] - X))
print(ans)
| false | 10 | [
"-y = list([abs(X - i) for i in x])",
"-ans = y[0]",
"+ans = abs(x[0] - X)",
"- ans = gcd(ans, y[i])",
"+ ans = gcd(ans, abs(x[i] - X))"
] | false | 0.043884 | 0.043091 | 1.018409 | [
"s762679822",
"s657377772"
] |
u389910364 | p03221 | python | s330656930 | s020718459 | 700 | 632 | 68,976 | 69,056 | Accepted | Accepted | 9.71 | import bisect
import operator
import os
from collections import Counter, deque
from fractions import gcd
from functools import lru_cache
from functools import reduce
import functools
import heapq
import itertools
import math
import numpy as np
import re
import sys
if os.getenv("LOCAL"):
sys.stdin =... | import bisect
import heapq
import itertools
import math
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter
import numpy as np
if o... | 41 | 33 | 869 | 785 | import bisect
import operator
import os
from collections import Counter, deque
from fractions import gcd
from functools import lru_cache
from functools import reduce
import functools
import heapq
import itertools
import math
import numpy as np
import re
import sys
if os.getenv("LOCAL"):
sys.stdin = open("_in.txt",... | import bisect
import heapq
import itertools
import math
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter
import numpy as np
if os.getenv("LOCAL")... | false | 19.512195 | [
"-import operator",
"-import os",
"-from collections import Counter, deque",
"-from fractions import gcd",
"-from functools import lru_cache",
"-from functools import reduce",
"-import functools",
"+import os",
"+import re",
"+import string",
"+import sys",
"+from collections import Counter, d... | false | 0.485688 | 0.726445 | 0.668582 | [
"s330656930",
"s020718459"
] |
u936985471 | p03796 | python | s982046140 | s116965933 | 47 | 41 | 2,940 | 2,940 | Accepted | Accepted | 12.77 | N=int(eval(input()))
ans=1
DIV=10**9+7
while N>1:
ans=(ans*(N%DIV))%DIV
N-=1
print(ans) | N=int(eval(input()))
p=1
DIV=10**9+7
for i in range(1,N+1):
p = (p%DIV * i%DIV) % DIV
print(p) | 7 | 7 | 91 | 99 | N = int(eval(input()))
ans = 1
DIV = 10**9 + 7
while N > 1:
ans = (ans * (N % DIV)) % DIV
N -= 1
print(ans)
| N = int(eval(input()))
p = 1
DIV = 10**9 + 7
for i in range(1, N + 1):
p = (p % DIV * i % DIV) % DIV
print(p)
| false | 0 | [
"-ans = 1",
"+p = 1",
"-while N > 1:",
"- ans = (ans * (N % DIV)) % DIV",
"- N -= 1",
"-print(ans)",
"+for i in range(1, N + 1):",
"+ p = (p % DIV * i % DIV) % DIV",
"+print(p)"
] | false | 0.052859 | 0.052304 | 1.010612 | [
"s982046140",
"s116965933"
] |
u816631826 | p03325 | python | s095614769 | s717522174 | 76 | 56 | 3,460 | 33,132 | Accepted | Accepted | 26.32 | n = int(input())
m = list(map(int, input().split()))
total = 0
for i in range(n):
x = m[i]
while True:
if x % 2 == 1:
break
total += 1
x = x // 2
print(total) | def meu_map(l):
for i in range(len(l)):
l[i] = int(l[i])
n = int(input())
array = input().split()
meu_map(array)
fatores = 0
for e in array:
while e != 1:
if e % 2 == 0:
e /= 2
fatores += 1
else:
break
print(fatores) | 12 | 20 | 222 | 316 | n = int(input())
m = list(map(int, input().split()))
total = 0
for i in range(n):
x = m[i]
while True:
if x % 2 == 1:
break
total += 1
x = x // 2
print(total)
| def meu_map(l):
for i in range(len(l)):
l[i] = int(l[i])
n = int(input())
array = input().split()
meu_map(array)
fatores = 0
for e in array:
while e != 1:
if e % 2 == 0:
e /= 2
fatores += 1
else:
break
print(fatores)
| false | 40 | [
"+def meu_map(l):",
"+ for i in range(len(l)):",
"+ l[i] = int(l[i])",
"+",
"+",
"-m = list(map(int, input().split()))",
"-total = 0",
"-for i in range(n):",
"- x = m[i]",
"- while True:",
"- if x % 2 == 1:",
"+array = input().split()",
"+meu_map(array)",
"+fatores =... | false | 0.034876 | 0.035037 | 0.995398 | [
"s095614769",
"s717522174"
] |
u290563917 | p03106 | python | s992295196 | s432304551 | 175 | 66 | 38,384 | 61,848 | Accepted | Accepted | 62.29 | a, b, k = list(map(int, input().split()))
def make_divisors(n):
divisors = []
for i in range(1, int(n**0.5)+1):
if n % i == 0:
divisors.append(i)
if i != n // i:
divisors.append(n // i)
divisors.sort()
return divisors
a_divs = make_divisors(a)
b_divs = make_divisors(b)
... | a, b, k = list(map(int, input().split()))
m = b if a > b else a
ans = []
for i in range(1, m+1):
if a % i == 0 and b % i == 0:
ans.append(i)
print((ans[-k])) | 21 | 7 | 459 | 161 | a, b, k = list(map(int, input().split()))
def make_divisors(n):
divisors = []
for i in range(1, int(n**0.5) + 1):
if n % i == 0:
divisors.append(i)
if i != n // i:
divisors.append(n // i)
divisors.sort()
return divisors
a_divs = make_divisors(a)
b_divs... | a, b, k = list(map(int, input().split()))
m = b if a > b else a
ans = []
for i in range(1, m + 1):
if a % i == 0 and b % i == 0:
ans.append(i)
print((ans[-k]))
| false | 66.666667 | [
"-",
"-",
"-def make_divisors(n):",
"- divisors = []",
"- for i in range(1, int(n**0.5) + 1):",
"- if n % i == 0:",
"- divisors.append(i)",
"- if i != n // i:",
"- divisors.append(n // i)",
"- divisors.sort()",
"- return divisors",
"-",
... | false | 0.064333 | 0.066155 | 0.972457 | [
"s992295196",
"s432304551"
] |
u046158516 | p03610 | python | s129088710 | s043513512 | 1,064 | 181 | 133,912 | 42,224 | Accepted | Accepted | 82.99 | s=eval(input())
a=[]
def convert(s):
# initialization of string to ""
new = ""
# traverse in the string
for x in s:
new += x
# return string
return new
for i in range(len(s)):
if i%2==0:
a.append(s[i])
print((convert(a))) | s=eval(input())
ans=[]
for i in range(len(s)):
if i%2==0:
ans.append(s[i])
print((''.join(ans))) | 18 | 6 | 291 | 99 | s = eval(input())
a = []
def convert(s):
# initialization of string to ""
new = ""
# traverse in the string
for x in s:
new += x
# return string
return new
for i in range(len(s)):
if i % 2 == 0:
a.append(s[i])
print((convert(a)))
| s = eval(input())
ans = []
for i in range(len(s)):
if i % 2 == 0:
ans.append(s[i])
print(("".join(ans)))
| false | 66.666667 | [
"-a = []",
"-",
"-",
"-def convert(s):",
"- # initialization of string to \"\"",
"- new = \"\"",
"- # traverse in the string",
"- for x in s:",
"- new += x",
"- # return string",
"- return new",
"-",
"-",
"+ans = []",
"- a.append(s[i])",
"-print((convert... | false | 0.038409 | 0.039037 | 0.983914 | [
"s129088710",
"s043513512"
] |
u072717685 | p02678 | python | s977940732 | s462554673 | 1,599 | 702 | 110,420 | 44,264 | Accepted | Accepted | 56.1 | from copy import deepcopy
def main():
global flags, edges
n, m = list(map(int, input().split()))
flags = {e:[n+1, n+1] for e in range(1, n + 1)}
flags[1][1] = 0
edges = {e:set() for e in range(1, n + 1)}
edge_list = []
for _ in range(m):
a, b = list(map(int, input().split(... | import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
from collections import deque
from copy import deepcopy
def main():
n, m = map(int, input().split())
edges = {e:[] for e in range(n + 1)}
for _ in range(m):
a, b = map(int, input().split())
edges[a].append(b)
... | 45 | 35 | 1,312 | 878 | from copy import deepcopy
def main():
global flags, edges
n, m = list(map(int, input().split()))
flags = {e: [n + 1, n + 1] for e in range(1, n + 1)}
flags[1][1] = 0
edges = {e: set() for e in range(1, n + 1)}
edge_list = []
for _ in range(m):
a, b = list(map(int, input().split()))... | import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
from collections import deque
from copy import deepcopy
def main():
n, m = map(int, input().split())
edges = {e: [] for e in range(n + 1)}
for _ in range(m):
a, b = map(int, input().split())
edges[a].append(b)
edges[... | false | 22.222222 | [
"+import sys",
"+",
"+read = sys.stdin.read",
"+readlines = sys.stdin.readlines",
"+from collections import deque",
"- global flags, edges",
"- n, m = list(map(int, input().split()))",
"- flags = {e: [n + 1, n + 1] for e in range(1, n + 1)}",
"- flags[1][1] = 0",
"- edges = {e: set(... | false | 0.049637 | 0.03849 | 1.289621 | [
"s977940732",
"s462554673"
] |
u058240079 | p03557 | python | s714860079 | s643680102 | 352 | 300 | 24,024 | 17,708 | Accepted | Accepted | 14.77 | n = int(input())
al = list(map(int, input().split()))
bl = list(map(int, input().split()))
cl = list(map(int, input().split()))
al.sort()
bl.sort()
cl.sort()
l = [(0,0) for _ in range(n)]
p = 0
for i, b in enumerate(bl):
while p < n and cl[p] <= b:
p += 1
l[i] = (b, n-p)
p = n-1
s = 0
t =... | n = int(input())
al = list(map(int, input().split()))
bl = list(map(int, input().split()))
cl = list(map(int, input().split()))
al.sort()
bl.sort()
cl.sort()
ap = 0
cp = 0
t = 0
for b in bl:
while ap < n and al[ap] < b:
ap += 1
while cp < n and cl[cp] <= b:
cp += 1
t += ap * (... | 22 | 17 | 435 | 335 | n = int(input())
al = list(map(int, input().split()))
bl = list(map(int, input().split()))
cl = list(map(int, input().split()))
al.sort()
bl.sort()
cl.sort()
l = [(0, 0) for _ in range(n)]
p = 0
for i, b in enumerate(bl):
while p < n and cl[p] <= b:
p += 1
l[i] = (b, n - p)
p = n - 1
s = 0
t = 0
for a i... | n = int(input())
al = list(map(int, input().split()))
bl = list(map(int, input().split()))
cl = list(map(int, input().split()))
al.sort()
bl.sort()
cl.sort()
ap = 0
cp = 0
t = 0
for b in bl:
while ap < n and al[ap] < b:
ap += 1
while cp < n and cl[cp] <= b:
cp += 1
t += ap * (n - cp)
print(t... | false | 22.727273 | [
"-l = [(0, 0) for _ in range(n)]",
"-p = 0",
"-for i, b in enumerate(bl):",
"- while p < n and cl[p] <= b:",
"- p += 1",
"- l[i] = (b, n - p)",
"-p = n - 1",
"-s = 0",
"+ap = 0",
"+cp = 0",
"-for a in al[::-1]:",
"- while p >= 0 and l[p][0] > a:",
"- s += l[p][1]",
"... | false | 0.038675 | 0.038384 | 1.007583 | [
"s714860079",
"s643680102"
] |
u312025627 | p02714 | python | s857295388 | s577637206 | 219 | 176 | 74,156 | 68,196 | Accepted | Accepted | 19.63 | def main():
N = int(input())
S = input()
from collections import Counter
c = Counter(S)
ans = c["R"]*c["G"]*c["B"]
less = 0
for d in range(1, N+1):
for i in range(N):
# 差dで三つが異なるなら条件を満たさないので取り除く
if i+d < N and i+2*d < N and \
S[i... | def main():
N = int(eval(input()))
S = eval(input())
RGB = [0]*3
for s in S:
if s == "R":
RGB[0] += 1
elif s == "G":
RGB[1] += 1
else:
RGB[2] += 1
ans = RGB[0] * RGB[1] * RGB[2]
for d in range(1, N):
for i in range(... | 18 | 23 | 471 | 531 | def main():
N = int(input())
S = input()
from collections import Counter
c = Counter(S)
ans = c["R"] * c["G"] * c["B"]
less = 0
for d in range(1, N + 1):
for i in range(N):
# 差dで三つが異なるなら条件を満たさないので取り除く
if (
i + d < N
and i + 2 *... | def main():
N = int(eval(input()))
S = eval(input())
RGB = [0] * 3
for s in S:
if s == "R":
RGB[0] += 1
elif s == "G":
RGB[1] += 1
else:
RGB[2] += 1
ans = RGB[0] * RGB[1] * RGB[2]
for d in range(1, N):
for i in range(N - d + 1):... | false | 21.73913 | [
"- N = int(input())",
"- S = input()",
"- from collections import Counter",
"-",
"- c = Counter(S)",
"- ans = c[\"R\"] * c[\"G\"] * c[\"B\"]",
"- less = 0",
"- for d in range(1, N + 1):",
"- for i in range(N):",
"- # 差dで三つが異なるなら条件を満たさないので取り除く",
"- ... | false | 0.039107 | 0.041276 | 0.947433 | [
"s857295388",
"s577637206"
] |
u002459665 | p03835 | python | s511720936 | s284354670 | 1,852 | 1,578 | 2,940 | 2,940 | Accepted | Accepted | 14.79 | K, S = list(map(int, input().split()))
ans = 0
for x in range(K + 1):
for y in range(K + 1):
z = S - x - y
if z >= 0 and z <= K:
ans += 1
print(ans)
| K, S = list(map(int, input().split()))
cnt = 0
for i in range(K+1):
for j in range(K+1):
x = S - i - j
if 0 <= x <= K:
cnt += 1
print(cnt)
| 10 | 9 | 186 | 174 | K, S = list(map(int, input().split()))
ans = 0
for x in range(K + 1):
for y in range(K + 1):
z = S - x - y
if z >= 0 and z <= K:
ans += 1
print(ans)
| K, S = list(map(int, input().split()))
cnt = 0
for i in range(K + 1):
for j in range(K + 1):
x = S - i - j
if 0 <= x <= K:
cnt += 1
print(cnt)
| false | 10 | [
"-ans = 0",
"-for x in range(K + 1):",
"- for y in range(K + 1):",
"- z = S - x - y",
"- if z >= 0 and z <= K:",
"- ans += 1",
"-print(ans)",
"+cnt = 0",
"+for i in range(K + 1):",
"+ for j in range(K + 1):",
"+ x = S - i - j",
"+ if 0 <= x <= K:",
... | false | 0.05049 | 0.047518 | 1.062536 | [
"s511720936",
"s284354670"
] |
u185486509 | p02258 | python | s609194344 | s139783183 | 890 | 210 | 13,584 | 19,828 | Accepted | Accepted | 76.4 | N =int(eval(input()))
R = []
for i in range(N):
R.append(int(eval(input())))
maxv=-2000000000
minv=R[0]
for i in range(1,N):
maxv=max(maxv,R[i]-minv)
minv=min(minv,R[i])
print(maxv) | import sys
i=input
n =int(i())
r0=int(i())
r1=int(i())
maxv=r1-r0
minv=min(r1,r0)
for i in map(int,sys.stdin.readlines()):
maxv=max(maxv,i-minv)
minv=min(minv,i)
print(maxv) | 10 | 11 | 194 | 191 | N = int(eval(input()))
R = []
for i in range(N):
R.append(int(eval(input())))
maxv = -2000000000
minv = R[0]
for i in range(1, N):
maxv = max(maxv, R[i] - minv)
minv = min(minv, R[i])
print(maxv)
| import sys
i = input
n = int(i())
r0 = int(i())
r1 = int(i())
maxv = r1 - r0
minv = min(r1, r0)
for i in map(int, sys.stdin.readlines()):
maxv = max(maxv, i - minv)
minv = min(minv, i)
print(maxv)
| false | 9.090909 | [
"-N = int(eval(input()))",
"-R = []",
"-for i in range(N):",
"- R.append(int(eval(input())))",
"-maxv = -2000000000",
"-minv = R[0]",
"-for i in range(1, N):",
"- maxv = max(maxv, R[i] - minv)",
"- minv = min(minv, R[i])",
"+import sys",
"+",
"+i = input",
"+n = int(i())",
"+r0 = ... | false | 0.04047 | 0.044637 | 0.906645 | [
"s609194344",
"s139783183"
] |
u743383679 | p03457 | python | s513064516 | s916899402 | 305 | 252 | 22,580 | 9,128 | Accepted | Accepted | 17.38 | # coding: utf-8
import math
n = int(eval(input()))
t = 0
x = 0
y = 0
txy = []
for i in range(n):
ti, xi, yi = list(map(int, input().split()))
txy.append((ti, xi, yi))
for ti, xi, yi in txy:
if abs(xi - x) + abs(yi - y) > abs(ti - t):
print("No")
exit()
elif (abs(xi - x) +... | # coding: utf-8
import math
n = int(eval(input()))
t = 0
x = 0
y = 0
# txy = []
# for i in range(n):
# ti, xi, yi = list(map(int, input().split()))
# txy.append((ti, xi, yi))
for i in range(n):
ti, xi, yi = list(map(int, input().split()))
if abs(xi - x) + abs(yi - y) > abs(ti - t):
... | 23 | 23 | 462 | 508 | # coding: utf-8
import math
n = int(eval(input()))
t = 0
x = 0
y = 0
txy = []
for i in range(n):
ti, xi, yi = list(map(int, input().split()))
txy.append((ti, xi, yi))
for ti, xi, yi in txy:
if abs(xi - x) + abs(yi - y) > abs(ti - t):
print("No")
exit()
elif (abs(xi - x) + abs(yi - y) - ... | # coding: utf-8
import math
n = int(eval(input()))
t = 0
x = 0
y = 0
# txy = []
# for i in range(n):
# ti, xi, yi = list(map(int, input().split()))
# txy.append((ti, xi, yi))
for i in range(n):
ti, xi, yi = list(map(int, input().split()))
if abs(xi - x) + abs(yi - y) > abs(ti - t):
print("No")
... | false | 0 | [
"-txy = []",
"+# txy = []",
"+# for i in range(n):",
"+# ti, xi, yi = list(map(int, input().split()))",
"+# txy.append((ti, xi, yi))",
"- txy.append((ti, xi, yi))",
"-for ti, xi, yi in txy:"
] | false | 0.048138 | 0.057671 | 0.834699 | [
"s513064516",
"s916899402"
] |
u186838327 | p03457 | python | s335507635 | s331994699 | 536 | 377 | 44,904 | 3,064 | Accepted | Accepted | 29.66 | n = int(eval(input()))
t0 = 0
x0 = 0
y0 = 0
for i in range(n):
t, x, y = list(map(int, input().split()))
if (x-x0)+(y-y0) <= t-t0 and(t-t0)%2 == ((x-x0)+(y-y0))%2:
t0 = t
x0 = x
y0 = y
else:
print('No')
exit()
else:
print('Yes')
| n = int(eval(input()))
t_ = 0
x_ = 0
y_ = 0
for i in range(n):
t, x, y = list(map(int, input().split()))
if abs(x-x_)+abs(y-y_) > t-t_:
print('No')
exit()
else:
r = (t-t_) - abs(x-x_)-abs(y-y_)
if r%2 == 0:
t_ = t
x_ = x
y_ = ... | 18 | 20 | 266 | 394 | n = int(eval(input()))
t0 = 0
x0 = 0
y0 = 0
for i in range(n):
t, x, y = list(map(int, input().split()))
if (x - x0) + (y - y0) <= t - t0 and (t - t0) % 2 == ((x - x0) + (y - y0)) % 2:
t0 = t
x0 = x
y0 = y
else:
print("No")
exit()
else:
print("Yes")
| n = int(eval(input()))
t_ = 0
x_ = 0
y_ = 0
for i in range(n):
t, x, y = list(map(int, input().split()))
if abs(x - x_) + abs(y - y_) > t - t_:
print("No")
exit()
else:
r = (t - t_) - abs(x - x_) - abs(y - y_)
if r % 2 == 0:
t_ = t
x_ = x
y... | false | 10 | [
"-t0 = 0",
"-x0 = 0",
"-y0 = 0",
"+t_ = 0",
"+x_ = 0",
"+y_ = 0",
"- if (x - x0) + (y - y0) <= t - t0 and (t - t0) % 2 == ((x - x0) + (y - y0)) % 2:",
"- t0 = t",
"- x0 = x",
"- y0 = y",
"- else:",
"+ if abs(x - x_) + abs(y - y_) > t - t_:",
"+ else:",
"+ ... | false | 0.074132 | 0.07705 | 0.962134 | [
"s335507635",
"s331994699"
] |
u141610915 | p03305 | python | s015345635 | s832165292 | 1,996 | 1,838 | 143,364 | 132,336 | Accepted | Accepted | 7.92 | import sys
from collections import defaultdict as dd
import heapq
input = sys.stdin.readline
n, m, s, t = list(map(int, input().split()))
e = dd(list)
money = 10 ** 15
for _ in range(m):
u, v, a, b = list(map(int, input().split()))
e[u].append((v, a))
e[v].append((u, a))
e[u + n].append((v + n, b))
... | import sys
from collections import defaultdict as dd
input = sys.stdin.readline
N, M, s, t = list(map(int, input().split()))
e = dd(list)
ee = dd(list)
for i in range(M):
u, v, a, b = list(map(int, input().split()))
e[u].append((v, a))
e[v].append((u, a))
ee[u].append((v, b))
ee[v].append((u, b))
... | 53 | 46 | 1,363 | 1,184 | import sys
from collections import defaultdict as dd
import heapq
input = sys.stdin.readline
n, m, s, t = list(map(int, input().split()))
e = dd(list)
money = 10**15
for _ in range(m):
u, v, a, b = list(map(int, input().split()))
e[u].append((v, a))
e[v].append((u, a))
e[u + n].append((v + n, b))
e... | import sys
from collections import defaultdict as dd
input = sys.stdin.readline
N, M, s, t = list(map(int, input().split()))
e = dd(list)
ee = dd(list)
for i in range(M):
u, v, a, b = list(map(int, input().split()))
e[u].append((v, a))
e[v].append((u, a))
ee[u].append((v, b))
ee[v].append((u, b))
i... | false | 13.207547 | [
"-import heapq",
"-n, m, s, t = list(map(int, input().split()))",
"+N, M, s, t = list(map(int, input().split()))",
"-money = 10**15",
"-for _ in range(m):",
"+ee = dd(list)",
"+for i in range(M):",
"- e[u + n].append((v + n, b))",
"- e[v + n].append((u + n, b))",
"-\"\"\"",
"-for i in rang... | false | 0.078768 | 0.079521 | 0.990534 | [
"s015345635",
"s832165292"
] |
u600402037 | p03076 | python | s124328021 | s178851257 | 165 | 17 | 13,092 | 3,060 | Accepted | Accepted | 89.7 | # coding: utf-8
import sys
import numpy as np
sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
A = np.zeros(5, np.int32)
for i in range(5):
A[i] = ir()
remain = A % 10
remain = remain[remain>0]
ceil10 = (np.ceil(A/10) * 10).astype(np.int32)... | # coding: utf-8
import sys
sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
A = [ir() for _ in range(5)]
ceil_time = [(x+9)//10*10 for x in A]
can_save = [y - x for y, x in zip(ceil_time, A)]
answer = sum(ceil_time) - max(can_save)
print(answer)
| 20 | 12 | 433 | 318 | # coding: utf-8
import sys
import numpy as np
sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
A = np.zeros(5, np.int32)
for i in range(5):
A[i] = ir()
remain = A % 10
remain = remain[remain > 0]
ceil10 = (np.ceil(A / 10) * 10).astype(np.int32)
answer = ce... | # coding: utf-8
import sys
sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
A = [ir() for _ in range(5)]
ceil_time = [(x + 9) // 10 * 10 for x in A]
can_save = [y - x for y, x in zip(ceil_time, A)]
answer = sum(ceil_time) - max(can_save)
print(answer)
| false | 40 | [
"-import numpy as np",
"-A = np.zeros(5, np.int32)",
"-for i in range(5):",
"- A[i] = ir()",
"-remain = A % 10",
"-remain = remain[remain > 0]",
"-ceil10 = (np.ceil(A / 10) * 10).astype(np.int32)",
"-answer = ceil10.sum()",
"-if len(remain) != 0:",
"- minus = 10 - remain.min()",
"- answ... | false | 0.411475 | 0.03632 | 11.329202 | [
"s124328021",
"s178851257"
] |
u677312543 | p03239 | python | s819400426 | s629101128 | 24 | 18 | 2,940 | 2,940 | Accepted | Accepted | 25 | import math
N, T = list(map(int, input().split()))
c_list = []
for i in range(N):
c1, t1=[int(i) for i in input().split()]
if t1 <= T:
c_list.append(c1)
if not c_list:
print('TLE')
else:
print((min(c_list)))
| n, T = list(map(int, input().split()))
ans = 1003
for _ in range(n):
c, t = list(map(int, input().split()))
if t <= T:
ans = min(ans, c)
print(('TLE' if ans == 1003 else ans))
| 14 | 8 | 240 | 186 | import math
N, T = list(map(int, input().split()))
c_list = []
for i in range(N):
c1, t1 = [int(i) for i in input().split()]
if t1 <= T:
c_list.append(c1)
if not c_list:
print("TLE")
else:
print((min(c_list)))
| n, T = list(map(int, input().split()))
ans = 1003
for _ in range(n):
c, t = list(map(int, input().split()))
if t <= T:
ans = min(ans, c)
print(("TLE" if ans == 1003 else ans))
| false | 42.857143 | [
"-import math",
"-",
"-N, T = list(map(int, input().split()))",
"-c_list = []",
"-for i in range(N):",
"- c1, t1 = [int(i) for i in input().split()]",
"- if t1 <= T:",
"- c_list.append(c1)",
"-if not c_list:",
"- print(\"TLE\")",
"-else:",
"- print((min(c_list)))",
"+n, T ... | false | 0.082716 | 0.060383 | 1.369844 | [
"s819400426",
"s629101128"
] |
u278356323 | p02952 | python | s532769231 | s078551421 | 55 | 47 | 2,940 | 2,940 | Accepted | Accepted | 14.55 | # ABC136b
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
n = int(eval(input()))
c = 0
for i in range(1, n+1):
if (len(str(i)) % 2 == 1):
c += 1
print(c) | def main():
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
# map(int, input().split())
n = int(eval(input()))
ans = 0
for i in range(1, n + 1):
if len(str(i)) % 2 == 1:
ans += 1
print(ans)
if __name__ == '__main__':
main()
| 12 | 16 | 191 | 311 | # ABC136b
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
n = int(eval(input()))
c = 0
for i in range(1, n + 1):
if len(str(i)) % 2 == 1:
c += 1
print(c)
| def main():
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
# map(int, input().split())
n = int(eval(input()))
ans = 0
for i in range(1, n + 1):
if len(str(i)) % 2 == 1:
ans += 1
print(ans)
if __name__ == "__main__":
main()
| false | 25 | [
"-# ABC136b",
"-import sys",
"+def main():",
"+ import sys",
"-input = sys.stdin.readline",
"-sys.setrecursionlimit(10**6)",
"-n = int(eval(input()))",
"-c = 0",
"-for i in range(1, n + 1):",
"- if len(str(i)) % 2 == 1:",
"- c += 1",
"-print(c)",
"+ input = sys.stdin.readline... | false | 0.055377 | 0.108226 | 0.511678 | [
"s532769231",
"s078551421"
] |
u076917070 | p04020 | python | s784826215 | s904652193 | 91 | 73 | 3,060 | 3,060 | Accepted | Accepted | 19.78 | import sys
input = sys.stdin.readline
def main():
N = int(eval(input()))
carry = 0
ans = 0
for i in range(N):
x = int(eval(input()))
if carry and x > 0:
ans += 1 # carry を優先して処理
d, m = divmod(x - 1, 2)
ans += d
carry = m
... | import sys
input = sys.stdin.readline
# 解説AC
def main():
N = int(eval(input()))
ans = 0
x = 0
for i in range(N):
a = int(eval(input()))
if a == 0:
ans += x//2
x = 0
else:
x += a
ans += x//2
print(ans)
if __name__... | 24 | 22 | 459 | 336 | import sys
input = sys.stdin.readline
def main():
N = int(eval(input()))
carry = 0
ans = 0
for i in range(N):
x = int(eval(input()))
if carry and x > 0:
ans += 1 # carry を優先して処理
d, m = divmod(x - 1, 2)
ans += d
carry = m
else:
... | import sys
input = sys.stdin.readline
# 解説AC
def main():
N = int(eval(input()))
ans = 0
x = 0
for i in range(N):
a = int(eval(input()))
if a == 0:
ans += x // 2
x = 0
else:
x += a
ans += x // 2
print(ans)
if __name__ == "__main__":
... | false | 8.333333 | [
"-",
"-",
"+# 解説AC",
"- carry = 0",
"+ x = 0",
"- x = int(eval(input()))",
"- if carry and x > 0:",
"- ans += 1 # carry を優先して処理",
"- d, m = divmod(x - 1, 2)",
"- ans += d",
"- carry = m",
"+ a = int(eval(input()))",
"+ ... | false | 0.046017 | 0.046793 | 0.983416 | [
"s784826215",
"s904652193"
] |
u323680411 | p03288 | python | s121382791 | s031486305 | 19 | 17 | 2,940 | 2,940 | Accepted | Accepted | 10.53 | R = int(eval(input()))
if R < 1200:
print("ABC")
elif R < 2800:
print("ARC")
else:
print("AGC") | R = int(eval(input()))
print((
"ABC" if R < 1200 else "ARC" if R < 2800 else "AGC"
)) | 8 | 5 | 109 | 90 | R = int(eval(input()))
if R < 1200:
print("ABC")
elif R < 2800:
print("ARC")
else:
print("AGC")
| R = int(eval(input()))
print(("ABC" if R < 1200 else "ARC" if R < 2800 else "AGC"))
| false | 37.5 | [
"-if R < 1200:",
"- print(\"ABC\")",
"-elif R < 2800:",
"- print(\"ARC\")",
"-else:",
"- print(\"AGC\")",
"+print((\"ABC\" if R < 1200 else \"ARC\" if R < 2800 else \"AGC\"))"
] | false | 0.129985 | 0.053566 | 2.426635 | [
"s121382791",
"s031486305"
] |
u556589653 | p02779 | python | s419619402 | s496855320 | 177 | 94 | 26,808 | 31,036 | Accepted | Accepted | 46.89 | N = int(eval(input()))
A = list(map(int,input().split()))
flag = 0
A.sort()
for i in range(len(A)-1):
if A[i] == A[i+1]:
flag += 1
print("NO")
break
else:
continue
if flag == 0:
print("YES") | N = int(eval(input()))
A = list(map(int,input().split()))
S = set(A)
if len(A) == len(S):
print("YES")
else:
print("NO") | 13 | 7 | 240 | 124 | N = int(eval(input()))
A = list(map(int, input().split()))
flag = 0
A.sort()
for i in range(len(A) - 1):
if A[i] == A[i + 1]:
flag += 1
print("NO")
break
else:
continue
if flag == 0:
print("YES")
| N = int(eval(input()))
A = list(map(int, input().split()))
S = set(A)
if len(A) == len(S):
print("YES")
else:
print("NO")
| false | 46.153846 | [
"-flag = 0",
"-A.sort()",
"-for i in range(len(A) - 1):",
"- if A[i] == A[i + 1]:",
"- flag += 1",
"- print(\"NO\")",
"- break",
"- else:",
"- continue",
"-if flag == 0:",
"+S = set(A)",
"+if len(A) == len(S):",
"+else:",
"+ print(\"NO\")"
] | false | 0.045659 | 0.044938 | 1.016037 | [
"s419619402",
"s496855320"
] |
u488127128 | p02971 | python | s953676719 | s015711180 | 458 | 296 | 26,620 | 14,100 | Accepted | Accepted | 35.37 | n = int(eval(input()))
data = [int(eval(input())) for k in range(n)]
m1,m2 = sorted(data, reverse=1)[:2]
b = [m2 if x==m1 else m1 for x in data]
print(('\n'.join(map(str,b)))) | import sys
input = sys.stdin.readline
n = int(eval(input()))
numbers = [int(eval(input())) for i in range(n)]
m1,m2 = sorted(numbers, reverse=1)[:2]
b = [m2 if x==m1 else m1 for x in numbers]
for s in b:
print(s) | 5 | 12 | 165 | 219 | n = int(eval(input()))
data = [int(eval(input())) for k in range(n)]
m1, m2 = sorted(data, reverse=1)[:2]
b = [m2 if x == m1 else m1 for x in data]
print(("\n".join(map(str, b))))
| import sys
input = sys.stdin.readline
n = int(eval(input()))
numbers = [int(eval(input())) for i in range(n)]
m1, m2 = sorted(numbers, reverse=1)[:2]
b = [m2 if x == m1 else m1 for x in numbers]
for s in b:
print(s)
| false | 58.333333 | [
"+import sys",
"+",
"+input = sys.stdin.readline",
"-data = [int(eval(input())) for k in range(n)]",
"-m1, m2 = sorted(data, reverse=1)[:2]",
"-b = [m2 if x == m1 else m1 for x in data]",
"-print((\"\\n\".join(map(str, b))))",
"+numbers = [int(eval(input())) for i in range(n)]",
"+m1, m2 = sorted(nu... | false | 0.04348 | 0.127533 | 0.340928 | [
"s953676719",
"s015711180"
] |
u670567845 | p04044 | python | s310151472 | s662286231 | 71 | 63 | 62,192 | 62,328 | Accepted | Accepted | 11.27 | N, L = list(map(int, input().split()))
d = [eval(input()) for _ in range(N)]
print(("".join(sorted(d)))) | n, l = list(map(int, input().split()))
s = [eval(input()) for _ in range(n)]
s.sort()
print(("".join(s))) | 3 | 4 | 92 | 94 | N, L = list(map(int, input().split()))
d = [eval(input()) for _ in range(N)]
print(("".join(sorted(d))))
| n, l = list(map(int, input().split()))
s = [eval(input()) for _ in range(n)]
s.sort()
print(("".join(s)))
| false | 25 | [
"-N, L = list(map(int, input().split()))",
"-d = [eval(input()) for _ in range(N)]",
"-print((\"\".join(sorted(d))))",
"+n, l = list(map(int, input().split()))",
"+s = [eval(input()) for _ in range(n)]",
"+s.sort()",
"+print((\"\".join(s)))"
] | false | 0.0803 | 0.069075 | 1.162507 | [
"s310151472",
"s662286231"
] |
u077291787 | p02630 | python | s778457441 | s400215373 | 210 | 143 | 43,936 | 43,852 | Accepted | Accepted | 31.9 | # D - Replacing
from collections import defaultdict
def main():
N, *X = list(map(int, open(0).read().split()))
A, BC = X[:N], X[N + 1 :]
cnt = defaultdict(int)
for a in A:
cnt[a] += 1
total = sum(A)
res = []
for b, c in zip(*[iter(BC)] * 2):
total += (c - b) * ... | # D - Replacing
def main():
N, *X = list(map(int, open(0).read().split()))
A, BC = X[:N], X[N + 1 :]
cnt = [0] * (10 ** 5 + 1)
for a in A:
cnt[a] += 1
total = sum(A)
res = []
for b, c in zip(*[iter(BC)] * 2):
total += (c - b) * cnt[b]
res.append(total)
... | 22 | 19 | 475 | 437 | # D - Replacing
from collections import defaultdict
def main():
N, *X = list(map(int, open(0).read().split()))
A, BC = X[:N], X[N + 1 :]
cnt = defaultdict(int)
for a in A:
cnt[a] += 1
total = sum(A)
res = []
for b, c in zip(*[iter(BC)] * 2):
total += (c - b) * cnt[b]
... | # D - Replacing
def main():
N, *X = list(map(int, open(0).read().split()))
A, BC = X[:N], X[N + 1 :]
cnt = [0] * (10**5 + 1)
for a in A:
cnt[a] += 1
total = sum(A)
res = []
for b, c in zip(*[iter(BC)] * 2):
total += (c - b) * cnt[b]
res.append(total)
cnt[c] +=... | false | 13.636364 | [
"-from collections import defaultdict",
"-",
"-",
"- cnt = defaultdict(int)",
"+ cnt = [0] * (10**5 + 1)"
] | false | 0.044927 | 0.037217 | 1.207167 | [
"s778457441",
"s400215373"
] |
u387774811 | p02788 | python | s863618571 | s882605081 | 1,728 | 1,174 | 72,784 | 69,772 | Accepted | Accepted | 32.06 | def nibun_right(a, x):
lo, hi = 0, len(a)
while lo < hi:
mid = (lo+hi)//2
if x < a[mid][0]: hi = mid
else: lo = mid+1
return lo
N,D,A=list(map(int,input().split()))
lst=[0]*N
for i in range(N):
lst[i]=list(map(int,input().split()))
lst[i][1]=int((lst[i][1]-1)/A)+1
lst.sort()
DMG=[0]*(N+1)
ans=0... | import sys
input = sys.stdin.readline
def nibun_right(a, x):
lo, hi = 0, len(a)
while lo < hi:
mid = (lo+hi)//2
if x < a[mid][0]: hi = mid
else: lo = mid+1
return lo
N,D,A=list(map(int,input().split()))
lst=[0]*N
for i in range(N):
lst[i]=list(map(int,input().split()))
lst[i][1]=int((lst[i][1]-1... | 23 | 25 | 470 | 510 | def nibun_right(a, x):
lo, hi = 0, len(a)
while lo < hi:
mid = (lo + hi) // 2
if x < a[mid][0]:
hi = mid
else:
lo = mid + 1
return lo
N, D, A = list(map(int, input().split()))
lst = [0] * N
for i in range(N):
lst[i] = list(map(int, input().split()))
... | import sys
input = sys.stdin.readline
def nibun_right(a, x):
lo, hi = 0, len(a)
while lo < hi:
mid = (lo + hi) // 2
if x < a[mid][0]:
hi = mid
else:
lo = mid + 1
return lo
N, D, A = list(map(int, input().split()))
lst = [0] * N
for i in range(N):
lst[... | false | 8 | [
"+import sys",
"+",
"+input = sys.stdin.readline",
"+",
"+"
] | false | 0.043038 | 0.110197 | 0.390551 | [
"s863618571",
"s882605081"
] |
u863370423 | p03945 | python | s027573322 | s827850169 | 44 | 35 | 3,188 | 5,892 | Accepted | Accepted | 20.45 | board = eval(input())
changes = 1
currSeq = board[0]
for i in range(1, len(board)):
current = board[i]
if current != currSeq:
changes += 1
currSeq = current
print((changes - 1)) | x = input()
out = 0
curchar = x[0]
for d in range(0, len(x)):
if curchar != x[d]:
curchar = x[d]
out += 1
print(out) | 12 | 8 | 189 | 132 | board = eval(input())
changes = 1
currSeq = board[0]
for i in range(1, len(board)):
current = board[i]
if current != currSeq:
changes += 1
currSeq = current
print((changes - 1))
| x = input()
out = 0
curchar = x[0]
for d in range(0, len(x)):
if curchar != x[d]:
curchar = x[d]
out += 1
print(out)
| false | 33.333333 | [
"-board = eval(input())",
"-changes = 1",
"-currSeq = board[0]",
"-for i in range(1, len(board)):",
"- current = board[i]",
"- if current != currSeq:",
"- changes += 1",
"- currSeq = current",
"-print((changes - 1))",
"+x = input()",
"+out = 0",
"+curchar = x[0]",
"+for d... | false | 0.036919 | 0.03606 | 1.023837 | [
"s027573322",
"s827850169"
] |
u619144316 | p02837 | python | s247644949 | s222033093 | 1,489 | 719 | 3,064 | 3,064 | Accepted | Accepted | 51.71 | N = int(eval(input()))
honest = [[] for _ in range(N)]
unkind = [[] for _ in range(N)]
MAX = 0
for i in range(0,N):
A = int(eval(input()))
for _ in range(A):
x, y =list(map(int,input().split(' ')))
if y == 0:
unkind[i].append(x-1)
else:
honest[i].append... |
def main():
N = int(eval(input()))
A = []
for i in range(N):
a = int(eval(input()))
XY = []
for _ in range(a):
x,y = list(map(int,input().split()))
XY.append((x-1,y))
A.append(XY)
# print(A)
MAX = 0
for i in range(2**N):... | 31 | 37 | 800 | 799 | N = int(eval(input()))
honest = [[] for _ in range(N)]
unkind = [[] for _ in range(N)]
MAX = 0
for i in range(0, N):
A = int(eval(input()))
for _ in range(A):
x, y = list(map(int, input().split(" ")))
if y == 0:
unkind[i].append(x - 1)
else:
honest[i].append(x - 1... | def main():
N = int(eval(input()))
A = []
for i in range(N):
a = int(eval(input()))
XY = []
for _ in range(a):
x, y = list(map(int, input().split()))
XY.append((x - 1, y))
A.append(XY)
# print(A)
MAX = 0
for i in range(2**N):
# prin... | false | 16.216216 | [
"-N = int(eval(input()))",
"-honest = [[] for _ in range(N)]",
"-unkind = [[] for _ in range(N)]",
"-MAX = 0",
"-for i in range(0, N):",
"- A = int(eval(input()))",
"- for _ in range(A):",
"- x, y = list(map(int, input().split(\" \")))",
"- if y == 0:",
"- unkind[i].... | false | 0.054355 | 0.047381 | 1.147175 | [
"s247644949",
"s222033093"
] |
u143051858 | p03937 | python | s253486255 | s812408827 | 29 | 26 | 9,076 | 8,992 | Accepted | Accepted | 10.34 | H,W = list(map(int,input().split()))
res = ''
for i in range(H):
res += eval(input())
if res.count('#') == H+W-1:
print('Possible')
else:
print('Impossible')
| H,W = list(map(int,input().split()))
res = 0
for i in range(H):
res += input().count('#')
if res == H+W-1:
print('Possible')
else:
print('Impossible') | 8 | 11 | 165 | 169 | H, W = list(map(int, input().split()))
res = ""
for i in range(H):
res += eval(input())
if res.count("#") == H + W - 1:
print("Possible")
else:
print("Impossible")
| H, W = list(map(int, input().split()))
res = 0
for i in range(H):
res += input().count("#")
if res == H + W - 1:
print("Possible")
else:
print("Impossible")
| false | 27.272727 | [
"-res = \"\"",
"+res = 0",
"- res += eval(input())",
"-if res.count(\"#\") == H + W - 1:",
"+ res += input().count(\"#\")",
"+if res == H + W - 1:"
] | false | 0.049349 | 0.049036 | 1.006383 | [
"s253486255",
"s812408827"
] |
u969850098 | p03457 | python | s314788665 | s213008562 | 378 | 175 | 3,064 | 3,064 | Accepted | Accepted | 53.7 | N = int(eval(input()))
t, x, y = 0, 0, 0
for _ in range(N):
ti, xi, yi = list(map(int, input().split()))
dt, dx, dy = ti - t, abs(xi - x), abs(yi - y)
t, x, y = ti, xi, yi
# print(dt, dx, dy)
# print((dt - (dx + dy)) % 2)
if ((dt - (dx + dy)) % 2 != 0) or (dx + dy > dt):
print... | import sys
readline = sys.stdin.readline
def main():
N = int(readline())
res = 'Yes'
pre_x, pre_y = 0, 0
pre = 0
for _ in range(N):
t, x, y = list(map(int, readline().rstrip().split()))
cost = abs(x - pre_x) + abs(y - pre_y)
if (t - pre) - cost >= 0 and ((t - pre)... | 14 | 21 | 346 | 491 | N = int(eval(input()))
t, x, y = 0, 0, 0
for _ in range(N):
ti, xi, yi = list(map(int, input().split()))
dt, dx, dy = ti - t, abs(xi - x), abs(yi - y)
t, x, y = ti, xi, yi
# print(dt, dx, dy)
# print((dt - (dx + dy)) % 2)
if ((dt - (dx + dy)) % 2 != 0) or (dx + dy > dt):
print("No")
... | import sys
readline = sys.stdin.readline
def main():
N = int(readline())
res = "Yes"
pre_x, pre_y = 0, 0
pre = 0
for _ in range(N):
t, x, y = list(map(int, readline().rstrip().split()))
cost = abs(x - pre_x) + abs(y - pre_y)
if (t - pre) - cost >= 0 and ((t - pre) - cost) ... | false | 33.333333 | [
"-N = int(eval(input()))",
"-t, x, y = 0, 0, 0",
"-for _ in range(N):",
"- ti, xi, yi = list(map(int, input().split()))",
"- dt, dx, dy = ti - t, abs(xi - x), abs(yi - y)",
"- t, x, y = ti, xi, yi",
"- # print(dt, dx, dy)",
"- # print((dt - (dx + dy)) % 2)",
"- if ((dt - (dx + dy))... | false | 0.064067 | 0.037712 | 1.698839 | [
"s314788665",
"s213008562"
] |
u816872429 | p02960 | python | s280094293 | s928157983 | 896 | 487 | 44,524 | 44,396 | Accepted | Accepted | 45.65 | s = eval(input())
frommap = []
for d in range(10):
frommap.append([0] * 13)
for m in range(13):
m2 = (m * 10 + d) % 13
frommap[d][m2] = m
dp = [1] + [0] * 12
for c in s:
if c == '?':
dp = [sum(dp[f] for f in fromlist) % 1000000007 for fromlist in zip(*frommap)]
els... | s = eval(input())
frommap = []
for d in range(10):
frommap.append([0] * 13)
for m in range(13):
m2 = (m * 10 + d) % 13
frommap[d][m2] = m
transmap = list(zip(*frommap))
dp = [1] + [0] * 12
for c in s:
if c == '?':
dp = [sum(dp[f] for f in fromlist) % 1000000007 for fro... | 17 | 18 | 379 | 406 | s = eval(input())
frommap = []
for d in range(10):
frommap.append([0] * 13)
for m in range(13):
m2 = (m * 10 + d) % 13
frommap[d][m2] = m
dp = [1] + [0] * 12
for c in s:
if c == "?":
dp = [sum(dp[f] for f in fromlist) % 1000000007 for fromlist in zip(*frommap)]
else:
dp =... | s = eval(input())
frommap = []
for d in range(10):
frommap.append([0] * 13)
for m in range(13):
m2 = (m * 10 + d) % 13
frommap[d][m2] = m
transmap = list(zip(*frommap))
dp = [1] + [0] * 12
for c in s:
if c == "?":
dp = [sum(dp[f] for f in fromlist) % 1000000007 for fromlist in transm... | false | 5.555556 | [
"+transmap = list(zip(*frommap))",
"- dp = [sum(dp[f] for f in fromlist) % 1000000007 for fromlist in zip(*frommap)]",
"+ dp = [sum(dp[f] for f in fromlist) % 1000000007 for fromlist in transmap]"
] | false | 0.036723 | 0.099976 | 0.367319 | [
"s280094293",
"s928157983"
] |
u385792265 | p03163 | python | s321323561 | s354911258 | 1,778 | 1,632 | 7,736 | 7,736 | Accepted | Accepted | 8.21 | import sys
n, we = list(map(int, input().split()))
cf=[(0, 0)]*n
cf = sorted(tuple( int(x) for x in sys.stdin.readline().split()) for _ in range(n))
dp=[0]*(we+1)
best=0
cnt=1
lim=0
for w,c in cf:
cnt=cnt+w
lim=min(cnt, we-w)
for j in range(lim, -1, -1):
if dp[j+w]<(dp[j] + c... | import sys
n, we = list(map(int, input().split()))
cf=[(0, 0)]*n
cf = sorted( [[int(x) for x in sys.stdin.readline().split()] for _ in range(n)] )
dp=[0]*(we+1)
best=0
cnt=1
lim=0
for w,c in cf:
cnt=cnt+w
lim=min(cnt, we-w)
for j in range(lim, -1, -1):
if dp[j+w]<(dp[j] + c) ... | 21 | 21 | 353 | 351 | import sys
n, we = list(map(int, input().split()))
cf = [(0, 0)] * n
cf = sorted(tuple(int(x) for x in sys.stdin.readline().split()) for _ in range(n))
dp = [0] * (we + 1)
best = 0
cnt = 1
lim = 0
for w, c in cf:
cnt = cnt + w
lim = min(cnt, we - w)
for j in range(lim, -1, -1):
if dp[j + w] < (dp[j... | import sys
n, we = list(map(int, input().split()))
cf = [(0, 0)] * n
cf = sorted([[int(x) for x in sys.stdin.readline().split()] for _ in range(n)])
dp = [0] * (we + 1)
best = 0
cnt = 1
lim = 0
for w, c in cf:
cnt = cnt + w
lim = min(cnt, we - w)
for j in range(lim, -1, -1):
if dp[j + w] < (dp[j] +... | false | 0 | [
"-cf = sorted(tuple(int(x) for x in sys.stdin.readline().split()) for _ in range(n))",
"+cf = sorted([[int(x) for x in sys.stdin.readline().split()] for _ in range(n)])"
] | false | 0.044665 | 0.044781 | 0.997404 | [
"s321323561",
"s354911258"
] |
u165318982 | p02570 | python | s537879103 | s239952309 | 35 | 28 | 9,152 | 9,076 | Accepted | Accepted | 20 | D, T, S = list(map(int, input().split()))
distance = T * S
if D > distance:
print('No')
else:
print('Yes') | D, T, S = list(map(int, input().split()))
distance = T * S
if D <= distance:
print('Yes')
else:
print('No') | 8 | 8 | 119 | 120 | D, T, S = list(map(int, input().split()))
distance = T * S
if D > distance:
print("No")
else:
print("Yes")
| D, T, S = list(map(int, input().split()))
distance = T * S
if D <= distance:
print("Yes")
else:
print("No")
| false | 0 | [
"-if D > distance:",
"+if D <= distance:",
"+ print(\"Yes\")",
"+else:",
"-else:",
"- print(\"Yes\")"
] | false | 0.086099 | 0.107757 | 0.799013 | [
"s537879103",
"s239952309"
] |
u124498235 | p03424 | python | s039152012 | s913340921 | 21 | 17 | 3,316 | 2,940 | Accepted | Accepted | 19.05 | from collections import Counter
n = int(eval(input()))
s = list(map(str, input().split()))
if len(Counter(s)) == 4:
print ("Four")
else:
print ("Three") | n = int(eval(input()))
s = list(map(str, input().split()))
ss = set(s)
if len(ss) == 3:
print ("Three")
else:
print ("Four") | 7 | 7 | 154 | 126 | from collections import Counter
n = int(eval(input()))
s = list(map(str, input().split()))
if len(Counter(s)) == 4:
print("Four")
else:
print("Three")
| n = int(eval(input()))
s = list(map(str, input().split()))
ss = set(s)
if len(ss) == 3:
print("Three")
else:
print("Four")
| false | 0 | [
"-from collections import Counter",
"-",
"-if len(Counter(s)) == 4:",
"+ss = set(s)",
"+if len(ss) == 3:",
"+ print(\"Three\")",
"+else:",
"-else:",
"- print(\"Three\")"
] | false | 0.046647 | 0.046652 | 0.999888 | [
"s039152012",
"s913340921"
] |
u143492911 | p03478 | python | s833376801 | s470565914 | 37 | 33 | 3,060 | 3,060 | Accepted | Accepted | 10.81 | n,a,b=list(map(int,input().split()))
ans=0
for i in range(n+1):
l=[int(x) for x in list(str(i))]
if a<=sum(l)<=b:
ans+=i
print(ans) | n,a,b=list(map(int,input().split()))
total=0
for i in range(n+1):
ans=list(str(i))
ans_2=sum(map(int,ans))
if a<=ans_2<=b:
total+=i
print(total) | 7 | 8 | 151 | 165 | n, a, b = list(map(int, input().split()))
ans = 0
for i in range(n + 1):
l = [int(x) for x in list(str(i))]
if a <= sum(l) <= b:
ans += i
print(ans)
| n, a, b = list(map(int, input().split()))
total = 0
for i in range(n + 1):
ans = list(str(i))
ans_2 = sum(map(int, ans))
if a <= ans_2 <= b:
total += i
print(total)
| false | 12.5 | [
"-ans = 0",
"+total = 0",
"- l = [int(x) for x in list(str(i))]",
"- if a <= sum(l) <= b:",
"- ans += i",
"-print(ans)",
"+ ans = list(str(i))",
"+ ans_2 = sum(map(int, ans))",
"+ if a <= ans_2 <= b:",
"+ total += i",
"+print(total)"
] | false | 0.036114 | 0.082562 | 0.437423 | [
"s833376801",
"s470565914"
] |
u541610817 | p03624 | python | s565859352 | s934996842 | 20 | 17 | 3,188 | 3,188 | Accepted | Accepted | 15 | s_in = eval(input())
s = set(s_in)
lst = [ord(i) - ord('a') for i in s]
lst.sort()
for i in range(26):
if not i in lst:
print((chr(i + ord('a'))))
break
elif i == 25:
print('None')
| s = eval(input())
for i in range(ord('a'), ord('z') + 1):
if not chr(i) in s:
print((chr(i)))
break
if i == ord('z'):
print('None')
| 10 | 7 | 214 | 146 | s_in = eval(input())
s = set(s_in)
lst = [ord(i) - ord("a") for i in s]
lst.sort()
for i in range(26):
if not i in lst:
print((chr(i + ord("a"))))
break
elif i == 25:
print("None")
| s = eval(input())
for i in range(ord("a"), ord("z") + 1):
if not chr(i) in s:
print((chr(i)))
break
if i == ord("z"):
print("None")
| false | 30 | [
"-s_in = eval(input())",
"-s = set(s_in)",
"-lst = [ord(i) - ord(\"a\") for i in s]",
"-lst.sort()",
"-for i in range(26):",
"- if not i in lst:",
"- print((chr(i + ord(\"a\"))))",
"+s = eval(input())",
"+for i in range(ord(\"a\"), ord(\"z\") + 1):",
"+ if not chr(i) in s:",
"+ ... | false | 0.086574 | 0.008518 | 10.163419 | [
"s565859352",
"s934996842"
] |
u373047809 | p03078 | python | s784878275 | s703068507 | 48 | 42 | 10,836 | 10,448 | Accepted | Accepted | 12.5 | #!/usr/bin/env python3
(x, y, z, k), a, b, c = [[*list(map(int, o.split()))] for o in open(0)]
a.sort(); b.sort(); c.sort()
p = a[-1] + b[-1] + c[-1]
s, h = {(p, -1, -1, -1)}, [(-p, -1, -1, -1)]
from heapq import*
def push(i, j, k):
global s, h
try:
t = a[i] + b[j] + c[k]
except IndexE... | #!/usr/bin/env python3
(x, y, z, k), a, b, c = [[*list(map(int, o.split()))] for o in open(0)]
a.sort(); b.sort(); c.sort()
h = [(-(a[-1] + b[-1] + c[-1]), -1, -1, -1)]
s = set(h)
from heapq import*
def push(i, j, k):
global s, h
try:
t = (- (a[i] + b[j] + c[k]), i, j, k)
except IndexE... | 24 | 24 | 565 | 531 | #!/usr/bin/env python3
(x, y, z, k), a, b, c = [[*list(map(int, o.split()))] for o in open(0)]
a.sort()
b.sort()
c.sort()
p = a[-1] + b[-1] + c[-1]
s, h = {(p, -1, -1, -1)}, [(-p, -1, -1, -1)]
from heapq import *
def push(i, j, k):
global s, h
try:
t = a[i] + b[j] + c[k]
except IndexError:
... | #!/usr/bin/env python3
(x, y, z, k), a, b, c = [[*list(map(int, o.split()))] for o in open(0)]
a.sort()
b.sort()
c.sort()
h = [(-(a[-1] + b[-1] + c[-1]), -1, -1, -1)]
s = set(h)
from heapq import *
def push(i, j, k):
global s, h
try:
t = (-(a[i] + b[j] + c[k]), i, j, k)
except IndexError:
... | false | 0 | [
"-p = a[-1] + b[-1] + c[-1]",
"-s, h = {(p, -1, -1, -1)}, [(-p, -1, -1, -1)]",
"+h = [(-(a[-1] + b[-1] + c[-1]), -1, -1, -1)]",
"+s = set(h)",
"- t = a[i] + b[j] + c[k]",
"+ t = (-(a[i] + b[j] + c[k]), i, j, k)",
"- if (t, i, j, k) not in s:",
"- heappush(h, (-t, i, j, k))",
... | false | 0.033349 | 0.033997 | 0.980931 | [
"s784878275",
"s703068507"
] |
u944325914 | p02681 | python | s128733823 | s727884202 | 22 | 20 | 8,960 | 8,972 | Accepted | Accepted | 9.09 | s=eval(input())
t=eval(input())
if t[:-1]==s:
print("Yes")
else:
print("No") | s=list(eval(input()))
t=list(eval(input()))
if s==t[:-1]:
print("Yes")
else:
print("No") | 6 | 6 | 73 | 85 | s = eval(input())
t = eval(input())
if t[:-1] == s:
print("Yes")
else:
print("No")
| s = list(eval(input()))
t = list(eval(input()))
if s == t[:-1]:
print("Yes")
else:
print("No")
| false | 0 | [
"-s = eval(input())",
"-t = eval(input())",
"-if t[:-1] == s:",
"+s = list(eval(input()))",
"+t = list(eval(input()))",
"+if s == t[:-1]:"
] | false | 0.035548 | 0.035224 | 1.009181 | [
"s128733823",
"s727884202"
] |
u761320129 | p03806 | python | s319001790 | s128261336 | 597 | 493 | 25,092 | 4,852 | Accepted | Accepted | 17.42 | N,MA,MB = list(map(int,input().split()))
src = []
sum_a = sum_b = 0
for i in range(N):
a,b,c = list(map(int,input().split()))
src.append((a,b,c))
sum_a += a
sum_b += b
INF = 10**9
dp = [[[INF for b in range(sum_b+1)] for a in range(sum_a+1)] for i in range(N+1)]
dp[0][0][0] = 0
for i in range(N):... | N,MA,MB = list(map(int,input().split()))
src = [tuple(map(int,input().split())) for i in range(N)]
INF = 10**9
dp = [[INF for j in range(401)] for i in range(401)]
dp[0][0] = 0
maxa = maxb = 0
for a,b,c in src:
for ai in range(maxa,-1,-1):
for bi in range(maxb,-1,-1):
dp[ai+a][bi+b] =... | 30 | 19 | 734 | 527 | N, MA, MB = list(map(int, input().split()))
src = []
sum_a = sum_b = 0
for i in range(N):
a, b, c = list(map(int, input().split()))
src.append((a, b, c))
sum_a += a
sum_b += b
INF = 10**9
dp = [[[INF for b in range(sum_b + 1)] for a in range(sum_a + 1)] for i in range(N + 1)]
dp[0][0][0] = 0
for i in ra... | N, MA, MB = list(map(int, input().split()))
src = [tuple(map(int, input().split())) for i in range(N)]
INF = 10**9
dp = [[INF for j in range(401)] for i in range(401)]
dp[0][0] = 0
maxa = maxb = 0
for a, b, c in src:
for ai in range(maxa, -1, -1):
for bi in range(maxb, -1, -1):
dp[ai + a][bi + b... | false | 36.666667 | [
"-src = []",
"-sum_a = sum_b = 0",
"-for i in range(N):",
"- a, b, c = list(map(int, input().split()))",
"- src.append((a, b, c))",
"- sum_a += a",
"- sum_b += b",
"+src = [tuple(map(int, input().split())) for i in range(N)]",
"-dp = [[[INF for b in range(sum_b + 1)] for a in range(sum_a... | false | 0.04367 | 0.049511 | 0.882026 | [
"s319001790",
"s128261336"
] |
u352394527 | p00336 | python | s231710266 | s454837386 | 860 | 640 | 29,296 | 5,568 | Accepted | Accepted | 25.58 | """
dp[x][y] ... tのx文字目までで, y文字一致した場合の数
dp[x][y] = dp[x - 1][y] + dp[x - 1][y - 1] * (t[x] == b[y])
"""
MOD = 1000000007
t = eval(input())
b = eval(input())
lent = len(t)
lenb = len(b)
dp = [[0] * (lenb + 1) for _ in range(lent + 1)]
for i in range(lent + 1):
dp[i][0] = 1
for x in range(1, lent + 1):
... | MOD = 1000000007
t = eval(input())
b = eval(input())
lent = len(t)
lenb = len(b)
dp = [0] * (lenb + 1)
dp[0] = 1
for x in range(1, lent + 1):
ct = t[x - 1]
for y in range(lenb, 0, -1):
if ct == b[y - 1]:
dp[y] += dp[y - 1]
dp[y] %= MOD
print((dp[lenb]))
| 17 | 14 | 443 | 273 | """
dp[x][y] ... tのx文字目までで, y文字一致した場合の数
dp[x][y] = dp[x - 1][y] + dp[x - 1][y - 1] * (t[x] == b[y])
"""
MOD = 1000000007
t = eval(input())
b = eval(input())
lent = len(t)
lenb = len(b)
dp = [[0] * (lenb + 1) for _ in range(lent + 1)]
for i in range(lent + 1):
dp[i][0] = 1
for x in range(1, lent + 1):
for y in r... | MOD = 1000000007
t = eval(input())
b = eval(input())
lent = len(t)
lenb = len(b)
dp = [0] * (lenb + 1)
dp[0] = 1
for x in range(1, lent + 1):
ct = t[x - 1]
for y in range(lenb, 0, -1):
if ct == b[y - 1]:
dp[y] += dp[y - 1]
dp[y] %= MOD
print((dp[lenb]))
| false | 17.647059 | [
"-\"\"\"",
"-dp[x][y] ... tのx文字目までで, y文字一致した場合の数",
"-dp[x][y] = dp[x - 1][y] + dp[x - 1][y - 1] * (t[x] == b[y])",
"-\"\"\"",
"-dp = [[0] * (lenb + 1) for _ in range(lent + 1)]",
"-for i in range(lent + 1):",
"- dp[i][0] = 1",
"+dp = [0] * (lenb + 1)",
"+dp[0] = 1",
"- for y in range(1, lenb... | false | 0.036557 | 0.035982 | 1.01597 | [
"s231710266",
"s454837386"
] |
u983918956 | p03219 | python | s742536578 | s012497161 | 19 | 17 | 2,940 | 2,940 | Accepted | Accepted | 10.53 | X,Y = list(map(int,input().split()))
print((int(X + Y/2))) | X, Y = list(map(int,input().split()))
ans = X + Y//2
print(ans) | 2 | 3 | 51 | 59 | X, Y = list(map(int, input().split()))
print((int(X + Y / 2)))
| X, Y = list(map(int, input().split()))
ans = X + Y // 2
print(ans)
| false | 33.333333 | [
"-print((int(X + Y / 2)))",
"+ans = X + Y // 2",
"+print(ans)"
] | false | 0.074062 | 0.062902 | 1.177422 | [
"s742536578",
"s012497161"
] |
u359358631 | p03814 | python | s468838145 | s147667871 | 33 | 30 | 9,256 | 9,128 | Accepted | Accepted | 9.09 | def main():
s = eval(input())
n = len(s)
start = -1
end = n
for i in range(0, n, 1):
if s[i] == "A":
start = i
break
for i in range(n - 1, -1, -1):
if s[i] == "Z":
end = i
break
print((end - start + 1))
if __name__ == "__main__":
main() | def main():
s = eval(input())
n = len(s)
start = -1
end = n
start = s.index("A")
end = s.rindex("Z")
print((end - start + 1))
if __name__ == "__main__":
main() | 24 | 17 | 288 | 187 | def main():
s = eval(input())
n = len(s)
start = -1
end = n
for i in range(0, n, 1):
if s[i] == "A":
start = i
break
for i in range(n - 1, -1, -1):
if s[i] == "Z":
end = i
break
print((end - start + 1))
if __name__ == "__main_... | def main():
s = eval(input())
n = len(s)
start = -1
end = n
start = s.index("A")
end = s.rindex("Z")
print((end - start + 1))
if __name__ == "__main__":
main()
| false | 29.166667 | [
"- for i in range(0, n, 1):",
"- if s[i] == \"A\":",
"- start = i",
"- break",
"- for i in range(n - 1, -1, -1):",
"- if s[i] == \"Z\":",
"- end = i",
"- break",
"+ start = s.index(\"A\")",
"+ end = s.rindex(\"Z\")"
] | false | 0.048496 | 0.048732 | 0.995159 | [
"s468838145",
"s147667871"
] |
u888092736 | p03074 | python | s016324890 | s410187179 | 164 | 149 | 18,236 | 17,796 | Accepted | Accepted | 9.15 | def compress(S):
res = []
prev = "aa"
for c in S:
if c != prev:
res.append([c, 1])
else:
res[-1][1] += 1
prev = c
return res
N, K = list(map(int, input().split()))
S = list(map(int, eval(input())))
S_comp = compress(S)
M = len(S_comp)
ans... | def run_length_compress(S):
res = [[S[0], 1]]
for c in S[1:]:
if c == res[-1][0]:
res[-1][1] += 1
else:
res.append([c, 1])
return res
N, K = list(map(int, input().split()))
S = eval(input())
cs = run_length_compress(S)
M = len(cs)
ans = 0
tot = 0
r... | 32 | 36 | 728 | 699 | def compress(S):
res = []
prev = "aa"
for c in S:
if c != prev:
res.append([c, 1])
else:
res[-1][1] += 1
prev = c
return res
N, K = list(map(int, input().split()))
S = list(map(int, eval(input())))
S_comp = compress(S)
M = len(S_comp)
ans = 0
total = 0
r... | def run_length_compress(S):
res = [[S[0], 1]]
for c in S[1:]:
if c == res[-1][0]:
res[-1][1] += 1
else:
res.append([c, 1])
return res
N, K = list(map(int, input().split()))
S = eval(input())
cs = run_length_compress(S)
M = len(cs)
ans = 0
tot = 0
right = 0
zeros = 0... | false | 11.111111 | [
"-def compress(S):",
"- res = []",
"- prev = \"aa\"",
"- for c in S:",
"- if c != prev:",
"+def run_length_compress(S):",
"+ res = [[S[0], 1]]",
"+ for c in S[1:]:",
"+ if c == res[-1][0]:",
"+ res[-1][1] += 1",
"+ else:",
"- else:",
"- ... | false | 0.037656 | 0.166447 | 0.226236 | [
"s016324890",
"s410187179"
] |
u696805736 | p03436 | python | s965345679 | s954065706 | 311 | 27 | 43,500 | 3,440 | Accepted | Accepted | 91.32 | from collections import deque
INF = 10101010
def main():
h,w = list(map(int,input().split()))
s = []
for i in range(h):
s.append(eval(input()))
d = [[INF for j in range(w)] for i in range(h)]
d[0][0] = 0
que = deque()
que.append((0,0))
while len(que):
y,... | from collections import deque
INF = 10101010
def main():
h,w = list(map(int,input().split()))
s = []
for i in range(h):
s.append(eval(input()))
ans = 0
for i in range(h):
ans += s[i].count('.')
d = [[INF for j in range(w)] for i in range(h)]
d[0][0] = 0
... | 35 | 34 | 850 | 808 | from collections import deque
INF = 10101010
def main():
h, w = list(map(int, input().split()))
s = []
for i in range(h):
s.append(eval(input()))
d = [[INF for j in range(w)] for i in range(h)]
d[0][0] = 0
que = deque()
que.append((0, 0))
while len(que):
y, x = que.pop... | from collections import deque
INF = 10101010
def main():
h, w = list(map(int, input().split()))
s = []
for i in range(h):
s.append(eval(input()))
ans = 0
for i in range(h):
ans += s[i].count(".")
d = [[INF for j in range(w)] for i in range(h)]
d[0][0] = 0
que = deque()... | false | 2.857143 | [
"+ ans = 0",
"+ for i in range(h):",
"+ ans += s[i].count(\".\")",
"- while len(que):",
"+ while que:",
"+ if (y, x) == (h - 1, w - 1):",
"+ return ans - (d[h - 1][w - 1] + 1)",
"- que.append((ny, nx))",
"- if d[h - 1][w - 1] == INF:",
"- ... | false | 0.036593 | 0.034571 | 1.058483 | [
"s965345679",
"s954065706"
] |
u392319141 | p03330 | python | s796591381 | s020803380 | 1,002 | 197 | 5,620 | 3,436 | Accepted | Accepted | 80.34 | N, C = list(map(int, input().split()))
D = []
c = []
for i in range(C) :
line = list(map(int, input().split()))
D.append(line)
for i in range(N) :
line = list(map(int, input().split()))
c.append(line)
colorCount = [[0 for _ in range(C + 1)] for _ in range(3)] # colorCount[index][color]
... | from collections import defaultdict
from itertools import product
N, C = list(map(int, input().split()))
D = [tuple(map(int, input().split())) for _ in range(C)]
colors = defaultdict(lambda : defaultdict(int))
for h in range(1, N + 1):
for w, c in enumerate(map(int, input().split()), start=1):
... | 32 | 30 | 1,059 | 785 | N, C = list(map(int, input().split()))
D = []
c = []
for i in range(C):
line = list(map(int, input().split()))
D.append(line)
for i in range(N):
line = list(map(int, input().split()))
c.append(line)
colorCount = [[0 for _ in range(C + 1)] for _ in range(3)] # colorCount[index][color]
for i in range(N):... | from collections import defaultdict
from itertools import product
N, C = list(map(int, input().split()))
D = [tuple(map(int, input().split())) for _ in range(C)]
colors = defaultdict(lambda: defaultdict(int))
for h in range(1, N + 1):
for w, c in enumerate(map(int, input().split()), start=1):
colors[(h + w... | false | 6.25 | [
"+from collections import defaultdict",
"+from itertools import product",
"+",
"-D = []",
"-c = []",
"-for i in range(C):",
"- line = list(map(int, input().split()))",
"- D.append(line)",
"-for i in range(N):",
"- line = list(map(int, input().split()))",
"- c.append(line)",
"-color... | false | 0.087419 | 0.0353 | 2.476468 | [
"s796591381",
"s020803380"
] |
u970197315 | p03331 | python | s886573680 | s914187097 | 370 | 282 | 3,064 | 9,080 | Accepted | Accepted | 23.78 | # B
si = lambda: eval(input())
ni = lambda: int(eval(input()))
nm = lambda: list(map(int, input().split()))
nl = lambda: list(map(int, input().split()))
def calc(a,b):
sa=list(str(a))
sb=list(str(b))
res=0
for aa in sa:
res+=int(aa)
for bb in sb:
res+=int(bb)
return... | n=int(eval(input()))
ans=10**18
for a in range(1,n):
b=n-a
tmp=0
for aa in str(a):
tmp+=int(aa)
for bb in str(b):
tmp+=int(bb)
ans=min(ans,tmp)
print(ans) | 24 | 11 | 421 | 176 | # B
si = lambda: eval(input())
ni = lambda: int(eval(input()))
nm = lambda: list(map(int, input().split()))
nl = lambda: list(map(int, input().split()))
def calc(a, b):
sa = list(str(a))
sb = list(str(b))
res = 0
for aa in sa:
res += int(aa)
for bb in sb:
res += int(bb)
return ... | n = int(eval(input()))
ans = 10**18
for a in range(1, n):
b = n - a
tmp = 0
for aa in str(a):
tmp += int(aa)
for bb in str(b):
tmp += int(bb)
ans = min(ans, tmp)
print(ans)
| false | 54.166667 | [
"-# B",
"-si = lambda: eval(input())",
"-ni = lambda: int(eval(input()))",
"-nm = lambda: list(map(int, input().split()))",
"-nl = lambda: list(map(int, input().split()))",
"-",
"-",
"-def calc(a, b):",
"- sa = list(str(a))",
"- sb = list(str(b))",
"- res = 0",
"- for aa in sa:",
... | false | 0.133382 | 0.190133 | 0.701522 | [
"s886573680",
"s914187097"
] |
u494927057 | p04031 | python | s345562926 | s444729271 | 23 | 19 | 2,940 | 2,940 | Accepted | Accepted | 17.39 | N = int(eval(input()))
a = list(map(int, input().split()))
def get_cost(now, target):
return (now - target) * (now - target)
ans = 10000000
for i in range(min(a), max(a) + 1):
cost_sum = 0
for j in a:
cost_sum += get_cost(j, i)
if cost_sum < ans:
ans = cost_sum
print(a... | N = int(eval(input()))
a = list(map(int, input().split()))
mean = int(round(sum(a) / len(a)))
ans = 0
for i in range(len(a)):
ans += (a[i] - mean) ** 2
print(ans)
| 16 | 9 | 318 | 171 | N = int(eval(input()))
a = list(map(int, input().split()))
def get_cost(now, target):
return (now - target) * (now - target)
ans = 10000000
for i in range(min(a), max(a) + 1):
cost_sum = 0
for j in a:
cost_sum += get_cost(j, i)
if cost_sum < ans:
ans = cost_sum
print(ans)
| N = int(eval(input()))
a = list(map(int, input().split()))
mean = int(round(sum(a) / len(a)))
ans = 0
for i in range(len(a)):
ans += (a[i] - mean) ** 2
print(ans)
| false | 43.75 | [
"-",
"-",
"-def get_cost(now, target):",
"- return (now - target) * (now - target)",
"-",
"-",
"-ans = 10000000",
"-for i in range(min(a), max(a) + 1):",
"- cost_sum = 0",
"- for j in a:",
"- cost_sum += get_cost(j, i)",
"- if cost_sum < ans:",
"- ans = cost_sum",
... | false | 0.105518 | 0.034276 | 3.07851 | [
"s345562926",
"s444729271"
] |
u608088992 | p02887 | python | s227621894 | s303095409 | 41 | 32 | 3,316 | 3,316 | Accepted | Accepted | 21.95 | N = int(eval(input()))
S = eval(input())
now = ""
ans = 0
for i in range(N):
if S[i] != now:
ans += 1
now = S[i]
print(ans)
| import sys
def solve():
input = sys.stdin.readline
N = int(eval(input()))
S = input().strip("\n")
S += "0"
count = 0
nowCol = S[0]
for i in range(1, N + 1):
if S[i] != nowCol:
count += 1
nowCol = S[i]
print(count)
return 0
if __name... | 9 | 19 | 140 | 344 | N = int(eval(input()))
S = eval(input())
now = ""
ans = 0
for i in range(N):
if S[i] != now:
ans += 1
now = S[i]
print(ans)
| import sys
def solve():
input = sys.stdin.readline
N = int(eval(input()))
S = input().strip("\n")
S += "0"
count = 0
nowCol = S[0]
for i in range(1, N + 1):
if S[i] != nowCol:
count += 1
nowCol = S[i]
print(count)
return 0
if __name__ == "__main__"... | false | 52.631579 | [
"-N = int(eval(input()))",
"-S = eval(input())",
"-now = \"\"",
"-ans = 0",
"-for i in range(N):",
"- if S[i] != now:",
"- ans += 1",
"- now = S[i]",
"-print(ans)",
"+import sys",
"+",
"+",
"+def solve():",
"+ input = sys.stdin.readline",
"+ N = int(eval(input()))"... | false | 0.038534 | 0.042514 | 0.906388 | [
"s227621894",
"s303095409"
] |
u633068244 | p01283 | python | s349945055 | s978007725 | 17,590 | 15,600 | 4,452 | 4,448 | Accepted | Accepted | 11.31 | import math
M = 256
while 1:
N = int(input())
if N == 0: break
H = 1e10
l = list(map(int,input().split()))
ans = [0,0,0]
for S in range(16):
for A in range(16):
for C in range(16):
R = S
O = [0]*N
for i in range(N):... | import math
M = 256
while 1:
N = int(input())
if N == 0: break
H = 1e10
l = list(map(int,input().split()))
ans = [0,0,0]
for S in range(16):
for A in range(16):
for C in range(16):
R = S
O = [0]*256
for i in range(N... | 23 | 21 | 675 | 610 | import math
M = 256
while 1:
N = int(input())
if N == 0:
break
H = 1e10
l = list(map(int, input().split()))
ans = [0, 0, 0]
for S in range(16):
for A in range(16):
for C in range(16):
R = S
O = [0] * N
for i in range(N)... | import math
M = 256
while 1:
N = int(input())
if N == 0:
break
H = 1e10
l = list(map(int, input().split()))
ans = [0, 0, 0]
for S in range(16):
for A in range(16):
for C in range(16):
R = S
O = [0] * 256
for i in range(... | false | 8.695652 | [
"- O = [0] * N",
"+ O = [0] * 256",
"- O[i] = (l[i] + R) % M",
"- L = [0] * 256",
"- for i in O:",
"- L[i] += 1",
"+ O[(l[i] + R) % M] += 1",
"- float(i) / N * math.l... | false | 0.41385 | 0.365265 | 1.133014 | [
"s349945055",
"s978007725"
] |
u934442292 | p03240 | python | s837940819 | s048835635 | 317 | 38 | 9,156 | 9,036 | Accepted | Accepted | 88.01 | import sys
from itertools import product
input = sys.stdin.readline
def main():
N = int(eval(input()))
X = [0] * N
Y = [0] * N
H = [0] * N
for i in range(N):
X[i], Y[i], H[i] = list(map(int, input().split()))
for Cx, Cy in product(list(range(101)), repeat=2):
C... | import sys
input = sys.stdin.readline
def main():
N = int(eval(input()))
xyh = [None] * N
for i in range(N):
xyh[i] = tuple(map(int, input().split()))
for i in range(N):
if xyh[i][2] > 0:
Bx, By, Bh = xyh[i]
break
for Cx in range(0, 101):
... | 36 | 31 | 793 | 708 | import sys
from itertools import product
input = sys.stdin.readline
def main():
N = int(eval(input()))
X = [0] * N
Y = [0] * N
H = [0] * N
for i in range(N):
X[i], Y[i], H[i] = list(map(int, input().split()))
for Cx, Cy in product(list(range(101)), repeat=2):
Ch = set()
... | import sys
input = sys.stdin.readline
def main():
N = int(eval(input()))
xyh = [None] * N
for i in range(N):
xyh[i] = tuple(map(int, input().split()))
for i in range(N):
if xyh[i][2] > 0:
Bx, By, Bh = xyh[i]
break
for Cx in range(0, 101):
for Cy in ... | false | 13.888889 | [
"-from itertools import product",
"- X = [0] * N",
"- Y = [0] * N",
"- H = [0] * N",
"+ xyh = [None] * N",
"- X[i], Y[i], H[i] = list(map(int, input().split()))",
"- for Cx, Cy in product(list(range(101)), repeat=2):",
"- Ch = set()",
"- Ch_upper = float(\"inf\")"... | false | 0.100299 | 0.048015 | 2.088896 | [
"s837940819",
"s048835635"
] |
u191874006 | p03045 | python | s958722150 | s225482844 | 804 | 643 | 123,664 | 90,160 | Accepted | Accepted | 20.02 | #!/usr/bin/env python3
#abc126 e
import sys
sys.setrecursionlimit(1000000)
N,M = list(map(int,input().split()))
XYZ = [list(map(int,input().split())) for _ in range(M)]
G = [[] for _ in range(N)]
for i in XYZ:
G[i[0]-1].append(i[1])
G[i[1]-1].append(i[0])
check = [False for _ in range(N)]#各頂点を... | #!/usr/bin/env python3
import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(1000000)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from co... | 27 | 60 | 542 | 1,239 | #!/usr/bin/env python3
# abc126 e
import sys
sys.setrecursionlimit(1000000)
N, M = list(map(int, input().split()))
XYZ = [list(map(int, input().split())) for _ in range(M)]
G = [[] for _ in range(N)]
for i in XYZ:
G[i[0] - 1].append(i[1])
G[i[1] - 1].append(i[0])
check = [False for _ in range(N)] # 各頂点を訪問したかど... | #!/usr/bin/env python3
import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(1000000)
from heapq import heappush, heappop, heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections ... | false | 55 | [
"-# abc126 e",
"+import math",
"+from bisect import bisect_right as br",
"+from bisect import bisect_left as bl",
"-N, M = list(map(int, input().split()))",
"-XYZ = [list(map(int, input().split())) for _ in range(M)]",
"-G = [[] for _ in range(N)]",
"-for i in XYZ:",
"- G[i[0] - 1].append(i[1])",... | false | 0.058289 | 0.153817 | 0.378954 | [
"s958722150",
"s225482844"
] |
u970197315 | p03329 | python | s544731047 | s305253995 | 614 | 439 | 3,864 | 9,380 | Accepted | Accepted | 28.5 | n=int(eval(input()))
m=[int(pow(6,i)) for i in range(7)]
m9=[int(pow(9,i)) for i in range(1,6)]
m+=m9
m.sort(reverse=True)
# print(m)
dp=[10**18 for i in range(n+1)]
dp[0]=0
for i in range(1,n+1):
for j in m:
if i-j>=0:
dp[i]=min(dp[i],dp[i-j]+1)
# print(dp)
print((dp[n])) | n=int(eval(input()))
l6=[6**i for i in range(7)]
l9=[9**i for i in range(1,6)]
m=l6+l9
m.sort()
inf=float("inf")
dp=[inf]*(10**5+1)
dp[0]=0
dp[1]=1
for i in range(1,n+1):
for mi in m:
if i-mi>=0:
dp[i]=min(dp[i-mi]+1,dp[i])
print((dp[n]))
| 14 | 14 | 290 | 256 | n = int(eval(input()))
m = [int(pow(6, i)) for i in range(7)]
m9 = [int(pow(9, i)) for i in range(1, 6)]
m += m9
m.sort(reverse=True)
# print(m)
dp = [10**18 for i in range(n + 1)]
dp[0] = 0
for i in range(1, n + 1):
for j in m:
if i - j >= 0:
dp[i] = min(dp[i], dp[i - j] + 1)
# print(dp)
print(... | n = int(eval(input()))
l6 = [6**i for i in range(7)]
l9 = [9**i for i in range(1, 6)]
m = l6 + l9
m.sort()
inf = float("inf")
dp = [inf] * (10**5 + 1)
dp[0] = 0
dp[1] = 1
for i in range(1, n + 1):
for mi in m:
if i - mi >= 0:
dp[i] = min(dp[i - mi] + 1, dp[i])
print((dp[n]))
| false | 0 | [
"-m = [int(pow(6, i)) for i in range(7)]",
"-m9 = [int(pow(9, i)) for i in range(1, 6)]",
"-m += m9",
"-m.sort(reverse=True)",
"-# print(m)",
"-dp = [10**18 for i in range(n + 1)]",
"+l6 = [6**i for i in range(7)]",
"+l9 = [9**i for i in range(1, 6)]",
"+m = l6 + l9",
"+m.sort()",
"+inf = float(... | false | 0.092493 | 0.090876 | 1.017798 | [
"s544731047",
"s305253995"
] |
u033524082 | p02768 | python | s497142329 | s063186467 | 1,508 | 142 | 3,060 | 3,064 | Accepted | Accepted | 90.58 | def cmb(n, r, mod):
c=1
for i in range(1, r+1):
c = (c * (n-i+1) * pow(i, mod-2, mod)) % mod
return c
n, a, b = list(map(int, input().split()))
MOD = 10**9 + 7
print(((pow(2, n, MOD) - cmb(n, a, MOD) - cmb(n, b, MOD) - 1) % MOD)) | n,a,b=list(map(int,input().split()))
mod=10**9+7
def comb(n,r):
P=1
R=1
for i in range(r):
P=P*(n-i)%mod
R=R*(r-i)%mod
return P*pow(R,mod-2,mod)%mod
combN=pow(2,n,mod)-1
print(((combN-comb(n,a)-comb(n,b))%mod)) | 9 | 13 | 250 | 248 | def cmb(n, r, mod):
c = 1
for i in range(1, r + 1):
c = (c * (n - i + 1) * pow(i, mod - 2, mod)) % mod
return c
n, a, b = list(map(int, input().split()))
MOD = 10**9 + 7
print(((pow(2, n, MOD) - cmb(n, a, MOD) - cmb(n, b, MOD) - 1) % MOD))
| n, a, b = list(map(int, input().split()))
mod = 10**9 + 7
def comb(n, r):
P = 1
R = 1
for i in range(r):
P = P * (n - i) % mod
R = R * (r - i) % mod
return P * pow(R, mod - 2, mod) % mod
combN = pow(2, n, mod) - 1
print(((combN - comb(n, a) - comb(n, b)) % mod))
| false | 30.769231 | [
"-def cmb(n, r, mod):",
"- c = 1",
"- for i in range(1, r + 1):",
"- c = (c * (n - i + 1) * pow(i, mod - 2, mod)) % mod",
"- return c",
"+n, a, b = list(map(int, input().split()))",
"+mod = 10**9 + 7",
"-n, a, b = list(map(int, input().split()))",
"-MOD = 10**9 + 7",
"-print(((pow(... | false | 1.010849 | 0.148882 | 6.789591 | [
"s497142329",
"s063186467"
] |
u502731482 | p02743 | python | s055895983 | s422802372 | 35 | 17 | 5,076 | 2,940 | Accepted | Accepted | 51.43 | from math import sqrt
from decimal import *
a, b, c = list(map(int, input().split()))
"""
print(sqrt(a), sqrt(b))
print(Decimal(sqrt(a)), sqrt(b))
"""
print(("Yes" if Decimal(a).sqrt() + Decimal(b).sqrt() < Decimal(c).sqrt() else "No")) | from math import sqrt
a, b, c = list(map(int, input().split()))
print(("Yes" if 4 * a * b < (c - a - b) ** 2 and c - a - b > 0 else "No")) | 10 | 4 | 239 | 134 | from math import sqrt
from decimal import *
a, b, c = list(map(int, input().split()))
"""
print(sqrt(a), sqrt(b))
print(Decimal(sqrt(a)), sqrt(b))
"""
print(("Yes" if Decimal(a).sqrt() + Decimal(b).sqrt() < Decimal(c).sqrt() else "No"))
| from math import sqrt
a, b, c = list(map(int, input().split()))
print(("Yes" if 4 * a * b < (c - a - b) ** 2 and c - a - b > 0 else "No"))
| false | 60 | [
"-from decimal import *",
"-\"\"\"",
"-print(sqrt(a), sqrt(b))",
"-print(Decimal(sqrt(a)), sqrt(b))",
"-\"\"\"",
"-print((\"Yes\" if Decimal(a).sqrt() + Decimal(b).sqrt() < Decimal(c).sqrt() else \"No\"))",
"+print((\"Yes\" if 4 * a * b < (c - a - b) ** 2 and c - a - b > 0 else \"No\"))"
] | false | 0.057586 | 0.052174 | 1.103722 | [
"s055895983",
"s422802372"
] |
u968166680 | p02947 | python | s509178663 | s080735300 | 239 | 145 | 162,316 | 29,544 | Accepted | Accepted | 39.33 | import sys
from collections import defaultdict
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007
def main():
N = int(readline())
S = [0] * N
for i in range(N):
S[i] = readline().strip()
... | import sys
from collections import defaultdict
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007
def main():
N = int(readline())
S = [0] * N
for i in range(N):
S[i] = readline().strip()
... | 35 | 32 | 638 | 572 | import sys
from collections import defaultdict
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10**9)
INF = 1 << 60
MOD = 1000000007
def main():
N = int(readline())
S = [0] * N
for i in range(N):
S[i] = readline().strip()
d = defaultdi... | import sys
from collections import defaultdict
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10**9)
INF = 1 << 60
MOD = 1000000007
def main():
N = int(readline())
S = [0] * N
for i in range(N):
S[i] = readline().strip()
d = defaultdi... | false | 8.571429 | [
"- c = [0] * 26",
"- for l in s:",
"- c[ord(l) - 97] += 1",
"- d[tuple(c)] += 1",
"+ d[\"\".join(sorted(s))] += 1"
] | false | 0.006812 | 0.041231 | 0.165208 | [
"s509178663",
"s080735300"
] |
u037430802 | p03157 | python | s331992792 | s982727776 | 1,178 | 921 | 86,712 | 22,192 | Accepted | Accepted | 21.82 | from collections import defaultdict
H,W = list(map(int, input().split()))
S = [eval(input()) for _ in range(H)]
es = defaultdict(list)
for i in range(H):
for j in range(W):
# 横
if j != W-1 and S[i][j] != S[i][j+1]:
es[(i,j)].append((i,j+1))
es[(i,j+1)].append((i,... | from collections import Counter
H,W = list(map(int, input().split()))
S = [eval(input()) for _ in range(H)]
class UnionFind:
def __init__(self,N):
self.parent = [i for i in range(N)]
self.rank = [0] * N
self.count = 0
def root(self,a):
if self.parent[a] == a:
... | 61 | 65 | 1,299 | 1,511 | from collections import defaultdict
H, W = list(map(int, input().split()))
S = [eval(input()) for _ in range(H)]
es = defaultdict(list)
for i in range(H):
for j in range(W):
# 横
if j != W - 1 and S[i][j] != S[i][j + 1]:
es[(i, j)].append((i, j + 1))
es[(i, j + 1)].append((i,... | from collections import Counter
H, W = list(map(int, input().split()))
S = [eval(input()) for _ in range(H)]
class UnionFind:
def __init__(self, N):
self.parent = [i for i in range(N)]
self.rank = [0] * N
self.count = 0
def root(self, a):
if self.parent[a] == a:
r... | false | 6.153846 | [
"-from collections import defaultdict",
"+from collections import Counter",
"-es = defaultdict(list)",
"+",
"+",
"+class UnionFind:",
"+ def __init__(self, N):",
"+ self.parent = [i for i in range(N)]",
"+ self.rank = [0] * N",
"+ self.count = 0",
"+",
"+ def root(se... | false | 0.04591 | 0.045958 | 0.998944 | [
"s331992792",
"s982727776"
] |
u531603069 | p02803 | python | s267681124 | s097533599 | 632 | 427 | 12,048 | 3,316 | Accepted | Accepted | 32.44 | import sys
import numpy as np
from collections import deque
h, w = list(map(int, input().split()))
maze = [list(eval(input())) for _ in range(h)]
direction = [(1, 0), (0, 1), (-1, 0), (0, -1)]
max_step = 0
for i in range(h):
for j in range(w):
largest_step = 0
# print("start: ", i, j)
... | from collections import deque
h, w = list(map(int, input().split()))
maze = [list(eval(input())) for _ in range(h)]
direction = [(1, 0), (0, 1), (-1, 0), (0, -1)]
max_step = 0
for i in range(h):
for j in range(w):
largest_step = 0
# print("start: ", i, j)
if maze[i][j] == "#":
... | 41 | 33 | 1,446 | 1,142 | import sys
import numpy as np
from collections import deque
h, w = list(map(int, input().split()))
maze = [list(eval(input())) for _ in range(h)]
direction = [(1, 0), (0, 1), (-1, 0), (0, -1)]
max_step = 0
for i in range(h):
for j in range(w):
largest_step = 0
# print("start: ", i, j)
... | from collections import deque
h, w = list(map(int, input().split()))
maze = [list(eval(input())) for _ in range(h)]
direction = [(1, 0), (0, 1), (-1, 0), (0, -1)]
max_step = 0
for i in range(h):
for j in range(w):
largest_step = 0
# print("start: ", i, j)
if maze[i][j] == "#":
... | false | 19.512195 | [
"-import sys",
"-import numpy as np",
"- distance = [[-1] * w for _ in range(h)]",
"- step = 0",
"+ step = 1",
"- distance[i][j] = step",
"- # print(\" \", x, y, step)",
"- # if step > largest_step:",
"- # largest_step = ste... | false | 0.298856 | 0.091651 | 3.260798 | [
"s267681124",
"s097533599"
] |
u083960235 | p03612 | python | s150331056 | s565067006 | 84 | 74 | 15,928 | 14,568 | Accepted | Accepted | 11.9 | import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii... | import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii... | 43 | 46 | 1,122 | 1,086 | import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_upper... | import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_upper... | false | 6.521739 | [
"-from fractions import gcd",
"-from heapq import heappop, heapify, heappush",
"+cnt = 0",
"-# if A[i] == i + 1:",
"+# if i + 1 == A[i]:",
"-# if i < N - 1:",
"-# if A[i + 1] == i + 2:",
"-# tmp += 1",
"-# ans -= 1",
"+# cnt += 1"... | false | 0.078392 | 0.120708 | 0.649437 | [
"s150331056",
"s565067006"
] |
u340500592 | p02393 | python | s086613226 | s487506227 | 30 | 20 | 7,672 | 7,612 | Accepted | Accepted | 33.33 | a, b, c = list(map(int, input().split()))
if a <= b <= c:
print((a, b, c))
elif a <= c <= b:
print((a, c, b))
elif b <= a <= c:
print((b, a, c))
elif b <= c <= a:
print((b, c, a))
elif c <= a <= b:
print((c, a, b))
elif c <= b <= a:
print((c, b, a)) | a, b, c = list(map(int, input().split()))
[x, y, z] = sorted([a, b, c])
print((x, y, z)) | 14 | 3 | 251 | 82 | a, b, c = list(map(int, input().split()))
if a <= b <= c:
print((a, b, c))
elif a <= c <= b:
print((a, c, b))
elif b <= a <= c:
print((b, a, c))
elif b <= c <= a:
print((b, c, a))
elif c <= a <= b:
print((c, a, b))
elif c <= b <= a:
print((c, b, a))
| a, b, c = list(map(int, input().split()))
[x, y, z] = sorted([a, b, c])
print((x, y, z))
| false | 78.571429 | [
"-if a <= b <= c:",
"- print((a, b, c))",
"-elif a <= c <= b:",
"- print((a, c, b))",
"-elif b <= a <= c:",
"- print((b, a, c))",
"-elif b <= c <= a:",
"- print((b, c, a))",
"-elif c <= a <= b:",
"- print((c, a, b))",
"-elif c <= b <= a:",
"- print((c, b, a))",
"+[x, y, z] ... | false | 0.155349 | 0.046878 | 3.313878 | [
"s086613226",
"s487506227"
] |
u437351386 | p02573 | python | s370642288 | s567829685 | 764 | 648 | 83,692 | 20,112 | Accepted | Accepted | 15.18 | n,m=list(map(int,input().split()))
par=[i for i in range(n)] #親
rank=[1]*n #深さ
size=[1]*n #iを根とするグループのサイズ
#親を見つける
def find(x):
if par[x]==x:
return x
else:
return find(par[x])
#xの属するグループとyの属するグループを併合
def unite(x,y):
x=find(x)
y=find(y)
if x==y:
return
if rank[x]<rank[y]:
... | n,m=list(map(int,input().split()))
#Union-Find木
#par[i]:iの親 deep[i]:iの深さ size[i]:iの大きさ
par=[i for i in range(n)]
deep=[1]*n
size=[1]*n
#親を見つける
def find(x):
if par[x]==x:
return x
else:
return find(par[x])
#二つのグループを統合する
def unite(x,y):
x=find(x)
y=find(y)
if x==y:
return
i... | 41 | 47 | 684 | 641 | n, m = list(map(int, input().split()))
par = [i for i in range(n)] # 親
rank = [1] * n # 深さ
size = [1] * n # iを根とするグループのサイズ
# 親を見つける
def find(x):
if par[x] == x:
return x
else:
return find(par[x])
# xの属するグループとyの属するグループを併合
def unite(x, y):
x = find(x)
y = find(y)
if x == y:
... | n, m = list(map(int, input().split()))
# Union-Find木
# par[i]:iの親 deep[i]:iの深さ size[i]:iの大きさ
par = [i for i in range(n)]
deep = [1] * n
size = [1] * n
# 親を見つける
def find(x):
if par[x] == x:
return x
else:
return find(par[x])
# 二つのグループを統合する
def unite(x, y):
x = find(x)
y = find(y)
if... | false | 12.765957 | [
"-par = [i for i in range(n)] # 親",
"-rank = [1] * n # 深さ",
"-size = [1] * n # iを根とするグループのサイズ",
"+# Union-Find木",
"+# par[i]:iの親 deep[i]:iの深さ size[i]:iの大きさ",
"+par = [i for i in range(n)]",
"+deep = [1] * n",
"+size = [1] * n",
"-# xの属するグループとyの属するグループを併合",
"+# 二つのグループを統合する",
"- if rank[x] ... | false | 0.032117 | 0.033508 | 0.958493 | [
"s370642288",
"s567829685"
] |
u679439110 | p02947 | python | s615902348 | s637657792 | 712 | 299 | 24,968 | 25,036 | Accepted | Accepted | 58.01 | import math as m
qt = int(eval(input()))
sl = [eval(input()) for i in range(qt)]
d = {}
count = 0
for s in sl:
s = "".join(sorted(s))
if s in d:
d[s] += 1
else:
d[s] = 1
for e in list(d.values()):
if e > 1:
count += m.factorial(e) // (m.factorial(e - 2) * 2)
... |
qt = int(eval(input()))
sl = [eval(input()) for i in range(qt)]
d = {}
count = 0
for s in sl:
s = "".join(sorted(s))
if s in d:
d[s] += 1
else:
d[s] = 1
for e in list(d.values()):
if e > 1:
count += e * (e - 1) // 2
print(count)
| 20 | 18 | 318 | 272 | import math as m
qt = int(eval(input()))
sl = [eval(input()) for i in range(qt)]
d = {}
count = 0
for s in sl:
s = "".join(sorted(s))
if s in d:
d[s] += 1
else:
d[s] = 1
for e in list(d.values()):
if e > 1:
count += m.factorial(e) // (m.factorial(e - 2) * 2)
print(count)
| qt = int(eval(input()))
sl = [eval(input()) for i in range(qt)]
d = {}
count = 0
for s in sl:
s = "".join(sorted(s))
if s in d:
d[s] += 1
else:
d[s] = 1
for e in list(d.values()):
if e > 1:
count += e * (e - 1) // 2
print(count)
| false | 10 | [
"-import math as m",
"-",
"- count += m.factorial(e) // (m.factorial(e - 2) * 2)",
"+ count += e * (e - 1) // 2"
] | false | 0.039487 | 0.068721 | 0.574596 | [
"s615902348",
"s637657792"
] |
u527993431 | p02983 | python | s861137037 | s615526808 | 512 | 42 | 3,060 | 3,060 | Accepted | Accepted | 91.8 | L,R = list(map(int,input().split()))
sa = R - L
ans = 2020
if sa > 2019:
print("0")
else:
for i in range (L,R):
for j in range (i+1,R+1):
tmp = (i * j) % 2019
if ans > tmp:
ans = tmp
print(ans) | L,R = list(map(int,input().split()))
sa = R - L
ans = 2020
if sa > 673:
print("0")
else:
for i in range (L,R):
for j in range (i+1,R+1):
tmp = (i * j) % 2019
if ans > tmp:
ans = tmp
print(ans) | 12 | 12 | 213 | 212 | L, R = list(map(int, input().split()))
sa = R - L
ans = 2020
if sa > 2019:
print("0")
else:
for i in range(L, R):
for j in range(i + 1, R + 1):
tmp = (i * j) % 2019
if ans > tmp:
ans = tmp
print(ans)
| L, R = list(map(int, input().split()))
sa = R - L
ans = 2020
if sa > 673:
print("0")
else:
for i in range(L, R):
for j in range(i + 1, R + 1):
tmp = (i * j) % 2019
if ans > tmp:
ans = tmp
print(ans)
| false | 0 | [
"-if sa > 2019:",
"+if sa > 673:"
] | false | 0.09286 | 0.039822 | 2.331858 | [
"s861137037",
"s615526808"
] |
u531436689 | p02735 | python | s571821714 | s086594274 | 363 | 330 | 69,740 | 69,740 | Accepted | Accepted | 9.09 | import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque
sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7
DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): r... | import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque
sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7
DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): r... | 47 | 53 | 1,407 | 1,572 | import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools
from collections import deque
sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7
DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]
def LI():
return [int(x) for x in sys.stdin.readline().split()]
def ... | import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools
from collections import deque
sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7
DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]
def LI():
return [int(x) for x in sys.stdin.readline().split()]
def ... | false | 11.320755 | [
"+ if r == 0 and c == 0:",
"+ if g[r][c] == \"#\":",
"+ dp[r][c] = 1",
"+ else:",
"+ dp[r][c] = 0"
] | false | 0.049679 | 0.050671 | 0.980431 | [
"s571821714",
"s086594274"
] |
u593567568 | p02769 | python | s991159864 | s239557433 | 1,660 | 576 | 28,044 | 56,144 | Accepted | Accepted | 65.3 | import sys
import numpy as np
sys.setrecursionlimit(10 ** 7)
# Wrong Answer
# WA
N, K = list(map(int, input().split()))
MOD = 10 ** 9 + 7
# 階乗、Combinationコンビネーション(numpyを使う)
def cumprod(arr, MOD):
L = len(arr)
Lsq = int(L**.5+1)
arr = np.resize(arr, Lsq**2).reshape(Lsq, Lsq)
for n... | import sys
import numpy as np
sys.setrecursionlimit(10 ** 7)
N, K = list(map(int, input().split()))
MOD = 10 ** 9 + 7
# 階乗、Combinationコンビネーション(numpyを使う)
def cumprod(arr, MOD):
L = len(arr)
Lsq = int(L**.5+1)
arr = np.resize(arr, Lsq**2).reshape(Lsq, Lsq)
for n in range(1, Lsq):
... | 71 | 68 | 1,469 | 1,498 | import sys
import numpy as np
sys.setrecursionlimit(10**7)
# Wrong Answer
# WA
N, K = list(map(int, input().split()))
MOD = 10**9 + 7
# 階乗、Combinationコンビネーション(numpyを使う)
def cumprod(arr, MOD):
L = len(arr)
Lsq = int(L**0.5 + 1)
arr = np.resize(arr, Lsq**2).reshape(Lsq, Lsq)
for n in range(1, Lsq):
... | import sys
import numpy as np
sys.setrecursionlimit(10**7)
N, K = list(map(int, input().split()))
MOD = 10**9 + 7
# 階乗、Combinationコンビネーション(numpyを使う)
def cumprod(arr, MOD):
L = len(arr)
Lsq = int(L**0.5 + 1)
arr = np.resize(arr, Lsq**2).reshape(Lsq, Lsq)
for n in range(1, Lsq):
arr[:, n] *= arr[... | false | 4.225352 | [
"-# Wrong Answer",
"-# WA",
"+fact, fact_inv = fact.tolist(), fact_inv.tolist()"
] | false | 0.452686 | 0.272456 | 1.661501 | [
"s991159864",
"s239557433"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.