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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
u408071652 | p02584 | python | s270800273 | s925808388 | 75 | 31 | 61,852 | 9,144 | Accepted | Accepted | 58.67 | import sys
def input():
return sys.stdin.readline().rstrip()
def main():
X,K,D =list(map(int,input().split()))
ans =10**19
if X >= K*D:
print((X-K*D))
elif -X>= K*D:
print((-X - K*D))
else:
X =abs(X)
c =X//D
if (K-c)%2 ==0:
... | import sys
def input():
return sys.stdin.readline().rstrip()
def main():
X,K,D =list(map(int,input().split()))
X= abs(X)
if X >= K*D:
print((X-K*D))
else:
c =X//D
if (K-c)%2 ==0:
print((X-c*D))
else:
print((D*(c+1)-X))
... | 32 | 29 | 429 | 363 | import sys
def input():
return sys.stdin.readline().rstrip()
def main():
X, K, D = list(map(int, input().split()))
ans = 10**19
if X >= K * D:
print((X - K * D))
elif -X >= K * D:
print((-X - K * D))
else:
X = abs(X)
c = X // D
if (K - c) % 2 == 0:
... | import sys
def input():
return sys.stdin.readline().rstrip()
def main():
X, K, D = list(map(int, input().split()))
X = abs(X)
if X >= K * D:
print((X - K * D))
else:
c = X // D
if (K - c) % 2 == 0:
print((X - c * D))
else:
print((D * (c + 1... | false | 9.375 | [
"- ans = 10**19",
"+ X = abs(X)",
"- elif -X >= K * D:",
"- print((-X - K * D))",
"- X = abs(X)"
] | false | 0.034157 | 0.035486 | 0.962557 | [
"s270800273",
"s925808388"
] |
u263830634 | p03332 | python | s397380060 | s349522414 | 827 | 696 | 42,948 | 26,796 | Accepted | Accepted | 15.84 | import numpy as np
MOD = 998244353
class Factorial:
def __init__(self, n, mod):
self.f = [1]
self.mod = mod
for j in range(1, n + 1):
self.f.append(self.f[-1] * j % mod)
self.i = [pow(self.f[-1], mod - 2, mod)]
for j in range(n, 0, -1):
sel... | class Factorial:
def __init__(self, n, mod):
self.f = [1]
self.mod = mod
for j in range(1, n + 1):
self.f.append(self.f[-1] * j % mod)
self.i = [pow(self.f[-1], mod - 2, mod)]
for j in range(n, 0, -1):
self.i.append(self.i[-1] * j % mod)
... | 69 | 34 | 1,557 | 892 | import numpy as np
MOD = 998244353
class Factorial:
def __init__(self, n, mod):
self.f = [1]
self.mod = mod
for j in range(1, n + 1):
self.f.append(self.f[-1] * j % mod)
self.i = [pow(self.f[-1], mod - 2, mod)]
for j in range(n, 0, -1):
self.i.appen... | class Factorial:
def __init__(self, n, mod):
self.f = [1]
self.mod = mod
for j in range(1, n + 1):
self.f.append(self.f[-1] * j % mod)
self.i = [pow(self.f[-1], mod - 2, mod)]
for j in range(n, 0, -1):
self.i.append(self.i[-1] * j % mod)
self.i... | false | 50.724638 | [
"-import numpy as np",
"-",
"-MOD = 998244353",
"-",
"-",
"-def gcd(a, b):",
"- if a > b:",
"- a, b = b, a",
"- if b % a == 0:",
"- return a",
"- return gcd(b % a, a)",
"-",
"-",
"-if A < B:",
"- A, B = B, A",
"-# n = 2 * min(K // A + 2, N + 1) + 3",
"-n = m... | false | 0.106429 | 0.068631 | 1.55075 | [
"s397380060",
"s349522414"
] |
u416011173 | p03371 | python | s272340878 | s030515905 | 119 | 91 | 9,144 | 9,184 | Accepted | Accepted | 23.53 | # -*- coding: utf-8 -*-
import sys
# 標準入力を取得
A, B, C, X, Y = list(map(int, input().split()))
# 求解処理
ans = sys.maxsize
max_c = 2 * max(X, Y)
for c in range(0, max_c + 1, 2):
a = max(X - c // 2, 0)
b = max(Y - c // 2, 0)
price = a * A + b * B + c * C
ans = min(ans, price)
# 結果出力
print(a... | # -*- coding: utf-8 -*-
import sys
def get_input() -> tuple:
"""
標準入力を取得する.
Returns:\n
tuple: 標準入力
"""
A, B, C, X, Y = list(map(int, input().split()))
return A, B, C, X, Y
def main(A: int, B: int, C: int, X: int, Y: int) -> None:
"""
メイン処理.
Args:\n
... | 17 | 46 | 324 | 843 | # -*- coding: utf-8 -*-
import sys
# 標準入力を取得
A, B, C, X, Y = list(map(int, input().split()))
# 求解処理
ans = sys.maxsize
max_c = 2 * max(X, Y)
for c in range(0, max_c + 1, 2):
a = max(X - c // 2, 0)
b = max(Y - c // 2, 0)
price = a * A + b * B + c * C
ans = min(ans, price)
# 結果出力
print(ans)
| # -*- coding: utf-8 -*-
import sys
def get_input() -> tuple:
"""
標準入力を取得する.
Returns:\n
tuple: 標準入力
"""
A, B, C, X, Y = list(map(int, input().split()))
return A, B, C, X, Y
def main(A: int, B: int, C: int, X: int, Y: int) -> None:
"""
メイン処理.
Args:\n
A (int): Aピザの値段... | false | 63.043478 | [
"-# 標準入力を取得",
"-A, B, C, X, Y = list(map(int, input().split()))",
"-# 求解処理",
"-ans = sys.maxsize",
"-max_c = 2 * max(X, Y)",
"-for c in range(0, max_c + 1, 2):",
"- a = max(X - c // 2, 0)",
"- b = max(Y - c // 2, 0)",
"- price = a * A + b * B + c * C",
"- ans = min(ans, price)",
"-# ... | false | 0.055719 | 0.068624 | 0.811942 | [
"s272340878",
"s030515905"
] |
u573754721 | p02923 | python | s119258756 | s090085188 | 239 | 76 | 63,856 | 14,224 | Accepted | Accepted | 68.2 | N = int(eval(input()))
lis_h = list(map(int, input().split()))
count = 0
max_move = 0
before = 0
for i in lis_h:
if i <= before:
count += 1
if max_move < count:
max_move = count
else:
count = 0
before = i
print(max_move)
... | n = int(eval(input()))
L = list(map(int,input().split()))
c = 0
mc = 0
for i in range(1,n):
if L[i - 1] >= L[i]:
c += 1
if c >= mc:
mc = c
else:
c = 0
print(mc)
| 17 | 13 | 317 | 234 | N = int(eval(input()))
lis_h = list(map(int, input().split()))
count = 0
max_move = 0
before = 0
for i in lis_h:
if i <= before:
count += 1
if max_move < count:
max_move = count
else:
count = 0
before = i
print(max_move)
| n = int(eval(input()))
L = list(map(int, input().split()))
c = 0
mc = 0
for i in range(1, n):
if L[i - 1] >= L[i]:
c += 1
if c >= mc:
mc = c
else:
c = 0
print(mc)
| false | 23.529412 | [
"-N = int(eval(input()))",
"-lis_h = list(map(int, input().split()))",
"-count = 0",
"-max_move = 0",
"-before = 0",
"-for i in lis_h:",
"- if i <= before:",
"- count += 1",
"- if max_move < count:",
"- max_move = count",
"+n = int(eval(input()))",
"+L = list(map(in... | false | 0.037072 | 0.037134 | 0.998325 | [
"s119258756",
"s090085188"
] |
u077291787 | p03420 | python | s843189680 | s005561373 | 70 | 61 | 3,060 | 3,060 | Accepted | Accepted | 12.86 | # ARC091D - Remainder Reminder
def main():
# a, b := b ≥ K + 1
N, K = tuple(map(int, input().split()))
ans = 0
for b in range(K + 1, N + 1):
ans += N // b * (b - K)
if K:
ans += max(0, (N % b) - K + 1)
else:
ans += N % b
print(ans)
if _... | # ARC091D - Remainder Reminder
def main():
N, K = tuple(map(int, input().split()))
if K == 0:
print((N ** 2))
else:
ans = sum(
N // i * (i - K) + max(0, (N % i) - K + 1) for i in range(K + 1, N + 1)
)
print(ans)
if __name__ == "__main__":
main() | 16 | 14 | 354 | 318 | # ARC091D - Remainder Reminder
def main():
# a, b := b ≥ K + 1
N, K = tuple(map(int, input().split()))
ans = 0
for b in range(K + 1, N + 1):
ans += N // b * (b - K)
if K:
ans += max(0, (N % b) - K + 1)
else:
ans += N % b
print(ans)
if __name__ == "__... | # ARC091D - Remainder Reminder
def main():
N, K = tuple(map(int, input().split()))
if K == 0:
print((N**2))
else:
ans = sum(
N // i * (i - K) + max(0, (N % i) - K + 1) for i in range(K + 1, N + 1)
)
print(ans)
if __name__ == "__main__":
main()
| false | 12.5 | [
"- # a, b := b ≥ K + 1",
"- ans = 0",
"- for b in range(K + 1, N + 1):",
"- ans += N // b * (b - K)",
"- if K:",
"- ans += max(0, (N % b) - K + 1)",
"- else:",
"- ans += N % b",
"- print(ans)",
"+ if K == 0:",
"+ print((N**2))",
... | false | 0.037854 | 0.041254 | 0.917585 | [
"s843189680",
"s005561373"
] |
u968166680 | p03557 | python | s708385761 | s935043296 | 479 | 348 | 92,968 | 24,052 | Accepted | Accepted | 27.35 | from sys import stdin
def input():
return stdin.readline().strip()
def main():
N = int(eval(input()))
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
A.sort()
B.sort()
C.sort()
nums = [0] * (N + 1)
... | from sys import stdin
from bisect import bisect_left
def input():
return stdin.readline().strip()
def main():
N = int(eval(input()))
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
A.sort()
B.sort()
C.sort()... | 52 | 39 | 948 | 698 | from sys import stdin
def input():
return stdin.readline().strip()
def main():
N = int(eval(input()))
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
A.sort()
B.sort()
C.sort()
nums = [0] * (N + 1)
ng = -1
for i,... | from sys import stdin
from bisect import bisect_left
def input():
return stdin.readline().strip()
def main():
N = int(eval(input()))
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
A.sort()
B.sort()
C.sort()
nums = [0] *... | false | 25 | [
"+from bisect import bisect_left",
"- ng = -1",
"+ pos = 0",
"- ok = N",
"- while abs(ok - ng) > 1:",
"- mid = (ok + ng) // 2",
"- if C[mid] > b:",
"- ok = mid",
"- else:",
"- ng = mid",
"- nums[i] = N - ok... | false | 0.041418 | 0.033704 | 1.228865 | [
"s708385761",
"s935043296"
] |
u347640436 | p02912 | python | s478414509 | s253138474 | 212 | 188 | 14,180 | 14,180 | Accepted | Accepted | 11.32 | from heapq import heappush, heappop, heapify
N, M = list(map(int, input().split()))
a = [-int(a) for a in input().split()]
heapify(a)
for _ in range(M):
heappush(a, heappop(a) / 2)
print((-sum(int(x) for x in a)))
| from heapq import heappush, heappop, heapify
N, M = list(map(int, input().split()))
a = [-int(a) for a in input().split()]
heapify(a)
for _ in range(M):
heappush(a, heappop(a) / 2)
print((sum(int(-x) for x in a)))
| 7 | 7 | 214 | 214 | from heapq import heappush, heappop, heapify
N, M = list(map(int, input().split()))
a = [-int(a) for a in input().split()]
heapify(a)
for _ in range(M):
heappush(a, heappop(a) / 2)
print((-sum(int(x) for x in a)))
| from heapq import heappush, heappop, heapify
N, M = list(map(int, input().split()))
a = [-int(a) for a in input().split()]
heapify(a)
for _ in range(M):
heappush(a, heappop(a) / 2)
print((sum(int(-x) for x in a)))
| false | 0 | [
"-print((-sum(int(x) for x in a)))",
"+print((sum(int(-x) for x in a)))"
] | false | 0.104497 | 0.007865 | 13.286714 | [
"s478414509",
"s253138474"
] |
u047796752 | p02712 | python | s892240984 | s805946936 | 84 | 77 | 67,656 | 64,636 | Accepted | Accepted | 8.33 | from collections import *
N = int(eval(input()))
ans = 0
for i in range(1, N+1):
if i%3!=0 and i%5!=0:
ans += i
print(ans) | N = int(eval(input()))
ans = 0
for i in range(1, N+1):
if i%3!=0 and i%5!=0:
ans += i
print(ans) | 10 | 8 | 140 | 111 | from collections import *
N = int(eval(input()))
ans = 0
for i in range(1, N + 1):
if i % 3 != 0 and i % 5 != 0:
ans += i
print(ans)
| N = int(eval(input()))
ans = 0
for i in range(1, N + 1):
if i % 3 != 0 and i % 5 != 0:
ans += i
print(ans)
| false | 20 | [
"-from collections import *",
"-"
] | false | 0.143548 | 0.120639 | 1.189898 | [
"s892240984",
"s805946936"
] |
u562935282 | p03286 | python | s548506615 | s619129641 | 19 | 17 | 2,940 | 2,940 | Accepted | Accepted | 10.53 | n = int(eval(input()))
ans = ''
if n == 0:
ans = '0'
while n!= 0:
if n % 2 == 0:
ans = '0' + ans
else:
ans = '1' + ans
n -= 1
n //= -2
print(ans) | N = int(eval(input()))
t = N
ans = ''
while t != 0:
q, r = divmod(t, 2)
ans = str(r) + ans
t = -q
print((ans if ans else '0'))
| 12 | 9 | 190 | 140 | n = int(eval(input()))
ans = ""
if n == 0:
ans = "0"
while n != 0:
if n % 2 == 0:
ans = "0" + ans
else:
ans = "1" + ans
n -= 1
n //= -2
print(ans)
| N = int(eval(input()))
t = N
ans = ""
while t != 0:
q, r = divmod(t, 2)
ans = str(r) + ans
t = -q
print((ans if ans else "0"))
| false | 25 | [
"-n = int(eval(input()))",
"+N = int(eval(input()))",
"+t = N",
"-if n == 0:",
"- ans = \"0\"",
"-while n != 0:",
"- if n % 2 == 0:",
"- ans = \"0\" + ans",
"- else:",
"- ans = \"1\" + ans",
"- n -= 1",
"- n //= -2",
"-print(ans)",
"+while t != 0:",
"+ ... | false | 0.039438 | 0.03974 | 0.992385 | [
"s548506615",
"s619129641"
] |
u335406314 | p02718 | python | s963027627 | s549947022 | 122 | 32 | 26,584 | 9,040 | Accepted | Accepted | 73.77 | import numpy as np
N, M = list(map(int,input('').split(' ')))
A = np.array(sorted(list(map(int,input('').split(' '))), reverse=True))
pts = np.sum(A)
if A[M-1]>=(pts/(4*M)):
print('Yes')
else:
print('No') | N, M = list(map(int,input('').split(' ')))
A = sorted(list(map(int,input('').split(' '))), reverse=True)
pts = sum(A)
if A[M-1]>=(pts/(4*M)):
print('Yes')
else:
print('No') | 8 | 7 | 215 | 182 | import numpy as np
N, M = list(map(int, input("").split(" ")))
A = np.array(sorted(list(map(int, input("").split(" "))), reverse=True))
pts = np.sum(A)
if A[M - 1] >= (pts / (4 * M)):
print("Yes")
else:
print("No")
| N, M = list(map(int, input("").split(" ")))
A = sorted(list(map(int, input("").split(" "))), reverse=True)
pts = sum(A)
if A[M - 1] >= (pts / (4 * M)):
print("Yes")
else:
print("No")
| false | 12.5 | [
"-import numpy as np",
"-",
"-A = np.array(sorted(list(map(int, input(\"\").split(\" \"))), reverse=True))",
"-pts = np.sum(A)",
"+A = sorted(list(map(int, input(\"\").split(\" \"))), reverse=True)",
"+pts = sum(A)"
] | false | 1.13535 | 0.070646 | 16.071063 | [
"s963027627",
"s549947022"
] |
u489959379 | p03848 | python | s033544125 | s208317606 | 227 | 76 | 52,844 | 20,332 | Accepted | Accepted | 66.52 | import sys
sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7
def resolve():
n = int(eval(input()))
A = sorted(list(map(int, input().split())))
if n % 2 != 0:
for i in range(n):
if i == 0:
if A[i] != 0:
print((0))
... | import sys
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7
def resolve():
n = int(eval(input()))
A = sorted(list(map(int, input().split())))
if n % 2 == 0:
num = 1
for i in range(0, n - 1, 2):
if A[i] != num or A[i... | 51 | 35 | 1,277 | 753 | import sys
sys.setrecursionlimit(10**7)
f_inf = float("inf")
mod = 10**9 + 7
def resolve():
n = int(eval(input()))
A = sorted(list(map(int, input().split())))
if n % 2 != 0:
for i in range(n):
if i == 0:
if A[i] != 0:
print((0))
... | import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline
f_inf = float("inf")
mod = 10**9 + 7
def resolve():
n = int(eval(input()))
A = sorted(list(map(int, input().split())))
if n % 2 == 0:
num = 1
for i in range(0, n - 1, 2):
if A[i] != num or A[i + 1] != num:
... | false | 31.372549 | [
"+input = sys.stdin.readline",
"- if n % 2 != 0:",
"- for i in range(n):",
"- if i == 0:",
"- if A[i] != 0:",
"- print((0))",
"- break",
"- else:",
"- if i % 2 != 0:",
"- if A[i] ... | false | 0.045718 | 0.042056 | 1.087067 | [
"s033544125",
"s208317606"
] |
u088372268 | p02398 | python | s702344491 | s076852822 | 70 | 30 | 7,688 | 7,716 | Accepted | Accepted | 57.14 | x = list(input().split(" "))
c = int(x[2])
divisors = 0
for i in range(int(x[0]), int(x[1])+1):
if c % i == 0:
divisors += 1
print(divisors) | x = list(input().split(" "))
a = int(x[0])
b = int(x[1])
c = int(x[2])
divisors = 0
for i in range(a, b+1):
if c % i == 0:
divisors += 1
print(divisors) | 7 | 9 | 158 | 172 | x = list(input().split(" "))
c = int(x[2])
divisors = 0
for i in range(int(x[0]), int(x[1]) + 1):
if c % i == 0:
divisors += 1
print(divisors)
| x = list(input().split(" "))
a = int(x[0])
b = int(x[1])
c = int(x[2])
divisors = 0
for i in range(a, b + 1):
if c % i == 0:
divisors += 1
print(divisors)
| false | 22.222222 | [
"+a = int(x[0])",
"+b = int(x[1])",
"-for i in range(int(x[0]), int(x[1]) + 1):",
"+for i in range(a, b + 1):"
] | false | 0.037445 | 0.037594 | 0.996031 | [
"s702344491",
"s076852822"
] |
u844646164 | p03408 | python | s875644210 | s308664138 | 171 | 70 | 38,640 | 65,492 | Accepted | Accepted | 59.06 | from collections import Counter
n = int(eval(input()))
s = [eval(input()) for _ in range(n)]
m = int(eval(input()))
t = [eval(input()) for _ in range(m)]
cs = Counter(s)
ct = Counter(t)
ans = 0
for k, v in list(cs.items()):
if k in list(ct.keys()):
ans = max(ans, v-ct[k])
else:
an... | from collections import Counter
N = int(eval(input()))
s = [eval(input()) for _ in range(N)]
M = int(eval(input()))
t = [eval(input()) for _ in range(M)]
cs = Counter(s)
ct = Counter(t)
ans = 0
for k, v in list(cs.items()):
tmp = v
if k in list(ct.keys()):
tmp -= ct[k]
ans = max(ans,... | 16 | 17 | 313 | 304 | from collections import Counter
n = int(eval(input()))
s = [eval(input()) for _ in range(n)]
m = int(eval(input()))
t = [eval(input()) for _ in range(m)]
cs = Counter(s)
ct = Counter(t)
ans = 0
for k, v in list(cs.items()):
if k in list(ct.keys()):
ans = max(ans, v - ct[k])
else:
ans = max(ans,... | from collections import Counter
N = int(eval(input()))
s = [eval(input()) for _ in range(N)]
M = int(eval(input()))
t = [eval(input()) for _ in range(M)]
cs = Counter(s)
ct = Counter(t)
ans = 0
for k, v in list(cs.items()):
tmp = v
if k in list(ct.keys()):
tmp -= ct[k]
ans = max(ans, tmp)
print(ans... | false | 5.882353 | [
"-n = int(eval(input()))",
"-s = [eval(input()) for _ in range(n)]",
"-m = int(eval(input()))",
"-t = [eval(input()) for _ in range(m)]",
"+N = int(eval(input()))",
"+s = [eval(input()) for _ in range(N)]",
"+M = int(eval(input()))",
"+t = [eval(input()) for _ in range(M)]",
"+ tmp = v",
"- ... | false | 0.072171 | 0.035819 | 2.014859 | [
"s875644210",
"s308664138"
] |
u409064224 | p02969 | python | s311234678 | s779855779 | 21 | 17 | 3,316 | 2,940 | Accepted | Accepted | 19.05 | print((3*int(eval(input()))**2)) | a = int(eval(input()))
print((3*a**2)) | 1 | 2 | 24 | 31 | print((3 * int(eval(input())) ** 2))
| a = int(eval(input()))
print((3 * a**2))
| false | 50 | [
"-print((3 * int(eval(input())) ** 2))",
"+a = int(eval(input()))",
"+print((3 * a**2))"
] | false | 0.143654 | 0.174666 | 0.822451 | [
"s311234678",
"s779855779"
] |
u588341295 | p03287 | python | s353225787 | s919367586 | 153 | 88 | 14,912 | 17,424 | Accepted | Accepted | 42.48 | # -*- coding: utf-8 -*-
"""
参考:https://img.atcoder.jp/abc105/editorial.pdf
http://drken1215.hatenablog.com/entry/2018/08/13/125300
https://www.hamayanhamayan.com/entry/2018/08/12/010816
・左端固定で右端動かすループの累積和だけ取れば、
(右端の累積和)-(左端-1の累積和)で、どこでも分かるようになる。
・B-AがMの倍数 → BとAのmod Mが等しい(やってみれば分かる)
・余りの数を全部集計してから、各余りの数... | # -*- coding: utf-8 -*-
import sys
from itertools import accumulate
from collections import Counter
def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e)... | 32 | 34 | 726 | 1,006 | # -*- coding: utf-8 -*-
"""
参考:https://img.atcoder.jp/abc105/editorial.pdf
http://drken1215.hatenablog.com/entry/2018/08/13/125300
https://www.hamayanhamayan.com/entry/2018/08/12/010816
・左端固定で右端動かすループの累積和だけ取れば、
(右端の累積和)-(左端-1の累積和)で、どこでも分かるようになる。
・B-AがMの倍数 → BとAのmod Mが等しい(やってみれば分かる)
・余りの数を全部集計してから、各余りの数について2つ選ぶ組み... | # -*- coding: utf-8 -*-
import sys
from itertools import accumulate
from collections import Counter
def input():
return sys.stdin.readline().strip()
def list2d(a, b, c):
return [[c] * b for i in range(a)]
def list3d(a, b, c, d):
return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b,... | false | 5.882353 | [
"-\"\"\"",
"-参考:https://img.atcoder.jp/abc105/editorial.pdf",
"- http://drken1215.hatenablog.com/entry/2018/08/13/125300",
"- https://www.hamayanhamayan.com/entry/2018/08/12/010816",
"-・左端固定で右端動かすループの累積和だけ取れば、",
"- (右端の累積和)-(左端-1の累積和)で、どこでも分かるようになる。",
"-・B-AがMの倍数 → BとAのmod Mが等しい(やってみれば分かる)",
"-・余り... | false | 0.037106 | 0.035316 | 1.050692 | [
"s353225787",
"s919367586"
] |
u094191970 | p03355 | python | s955750755 | s734081017 | 1,359 | 43 | 9,140 | 10,284 | Accepted | Accepted | 96.84 | s=eval(input())
k=int(eval(input()))
abc='abcdefghijklmnopqrstuvwxyz'
def dfs(keta,ns):
global cnt
if ns in s:
cnt+=1
if cnt==k:
print(ns)
exit()
if keta==k:
return
for i in abc:
dfs(keta+1,ns+i)
cnt=0
for i in abc:
if i not in s:
continue
dfs(1,i) | s=eval(input())
k=int(eval(input()))
sub=set()
for i in range(k):
for j in range(len(s)-i):
sub.add(s[j:j+i+1])
sub=list(sub)
sub.sort()
print((sub[k-1])) | 23 | 11 | 300 | 158 | s = eval(input())
k = int(eval(input()))
abc = "abcdefghijklmnopqrstuvwxyz"
def dfs(keta, ns):
global cnt
if ns in s:
cnt += 1
if cnt == k:
print(ns)
exit()
if keta == k:
return
for i in abc:
dfs(keta + 1, ns + i)
cnt = 0
for i in abc:
if i not in s:
... | s = eval(input())
k = int(eval(input()))
sub = set()
for i in range(k):
for j in range(len(s) - i):
sub.add(s[j : j + i + 1])
sub = list(sub)
sub.sort()
print((sub[k - 1]))
| false | 52.173913 | [
"-abc = \"abcdefghijklmnopqrstuvwxyz\"",
"-",
"-",
"-def dfs(keta, ns):",
"- global cnt",
"- if ns in s:",
"- cnt += 1",
"- if cnt == k:",
"- print(ns)",
"- exit()",
"- if keta == k:",
"- return",
"- for i in abc:",
"- dfs(keta + 1, ns + i)... | false | 0.038247 | 0.039869 | 0.959322 | [
"s955750755",
"s734081017"
] |
u614320306 | p02947 | python | s900569267 | s056450422 | 478 | 384 | 26,308 | 19,404 | Accepted | Accepted | 19.67 | N = int(eval(input()))
s = list(list(eval(input())) for i in range(N))
for i in range(N):
s[i].sort()
s.sort()
ans = 0
same = 1
for i in range(1,N):
if s[i] == s[i-1]:
ans += same
same += 1
else:
same = 1
print(ans) | N = int(eval(input()))
S = []
for _ in range(N):
S.append(''.join(sorted(eval(input()))))
D = {}
count = 0
for i in S:
if i in D:
count += D[i]
D[i] += 1
else:
D[i] = 1
print(count) | 14 | 13 | 252 | 217 | N = int(eval(input()))
s = list(list(eval(input())) for i in range(N))
for i in range(N):
s[i].sort()
s.sort()
ans = 0
same = 1
for i in range(1, N):
if s[i] == s[i - 1]:
ans += same
same += 1
else:
same = 1
print(ans)
| N = int(eval(input()))
S = []
for _ in range(N):
S.append("".join(sorted(eval(input()))))
D = {}
count = 0
for i in S:
if i in D:
count += D[i]
D[i] += 1
else:
D[i] = 1
print(count)
| false | 7.142857 | [
"-s = list(list(eval(input())) for i in range(N))",
"-for i in range(N):",
"- s[i].sort()",
"-s.sort()",
"-ans = 0",
"-same = 1",
"-for i in range(1, N):",
"- if s[i] == s[i - 1]:",
"- ans += same",
"- same += 1",
"+S = []",
"+for _ in range(N):",
"+ S.append(\"\".join... | false | 0.03559 | 0.037707 | 0.943855 | [
"s900569267",
"s056450422"
] |
u392319141 | p03141 | python | s379306821 | s400107130 | 526 | 390 | 25,828 | 21,300 | Accepted | Accepted | 25.86 | from functools import lru_cache
N = int(eval(input()))
A = []
B = []
food = []
for i in range(N):
a, b = list(map(int, input().split()))
A.append(a)
B.append(b)
food.append((a + b, i))
food.sort(reverse=True)
X = 0
Y = 0
cnt = 0
for _, i in food:
if cnt % 2 == 0:
X +=... | N = int(eval(input()))
AB = [tuple(map(int, input().split())) for _ in range(N)]
AB.sort(key=lambda a: a[0] + a[1], reverse=True)
ans = 0
for i in range(N):
if i % 2 == 0:
ans += AB[i][0]
else:
ans -= AB[i][1]
print(ans)
| 26 | 11 | 373 | 250 | from functools import lru_cache
N = int(eval(input()))
A = []
B = []
food = []
for i in range(N):
a, b = list(map(int, input().split()))
A.append(a)
B.append(b)
food.append((a + b, i))
food.sort(reverse=True)
X = 0
Y = 0
cnt = 0
for _, i in food:
if cnt % 2 == 0:
X += A[i]
else:
... | N = int(eval(input()))
AB = [tuple(map(int, input().split())) for _ in range(N)]
AB.sort(key=lambda a: a[0] + a[1], reverse=True)
ans = 0
for i in range(N):
if i % 2 == 0:
ans += AB[i][0]
else:
ans -= AB[i][1]
print(ans)
| false | 57.692308 | [
"-from functools import lru_cache",
"-",
"-A = []",
"-B = []",
"-food = []",
"+AB = [tuple(map(int, input().split())) for _ in range(N)]",
"+AB.sort(key=lambda a: a[0] + a[1], reverse=True)",
"+ans = 0",
"- a, b = list(map(int, input().split()))",
"- A.append(a)",
"- B.append(b)",
"- ... | false | 0.033266 | 0.039973 | 0.832196 | [
"s379306821",
"s400107130"
] |
u281610856 | p03208 | python | s419044103 | s643354271 | 242 | 111 | 8,280 | 7,384 | Accepted | Accepted | 54.13 | N, K = list(map(int, input().split()))
H = [int(eval(input())) for _ in range(N)]
H_sort = sorted(H)
ans = H_sort[K-1] - H_sort[0]
for j in range(K, N):
h_diff = H_sort[j] - H_sort[j + 1 -K]
ans = min(ans, h_diff)
print(ans) | import sys
input = sys.stdin.readline
INF = float("inf")
def main():
n, k = list(map(int, input().split()))
h = [int(eval(input())) for _ in range(n)]
h.sort()
ans = INF
for i in range(n - k + 1):
ans = min(ans, h[i+k-1] - h[i])
print(ans)
if __name__ == '__main__':
... | 8 | 17 | 227 | 317 | N, K = list(map(int, input().split()))
H = [int(eval(input())) for _ in range(N)]
H_sort = sorted(H)
ans = H_sort[K - 1] - H_sort[0]
for j in range(K, N):
h_diff = H_sort[j] - H_sort[j + 1 - K]
ans = min(ans, h_diff)
print(ans)
| import sys
input = sys.stdin.readline
INF = float("inf")
def main():
n, k = list(map(int, input().split()))
h = [int(eval(input())) for _ in range(n)]
h.sort()
ans = INF
for i in range(n - k + 1):
ans = min(ans, h[i + k - 1] - h[i])
print(ans)
if __name__ == "__main__":
main()
| false | 52.941176 | [
"-N, K = list(map(int, input().split()))",
"-H = [int(eval(input())) for _ in range(N)]",
"-H_sort = sorted(H)",
"-ans = H_sort[K - 1] - H_sort[0]",
"-for j in range(K, N):",
"- h_diff = H_sort[j] - H_sort[j + 1 - K]",
"- ans = min(ans, h_diff)",
"-print(ans)",
"+import sys",
"+",
"+input ... | false | 0.044509 | 0.036587 | 1.21653 | [
"s419044103",
"s643354271"
] |
u935840914 | p02947 | python | s078065984 | s912997548 | 492 | 385 | 19,400 | 19,404 | Accepted | Accepted | 21.75 | n = int(eval(input()))
s = ["".join(sorted(str(eval(input())))) for _ in range(n)]
for i in range(n):
s[i] = ''.join(sorted(s[i]))
t = {}
for i in range(n):
if s[i] in t:
t[s[i]] += 1
else:
t[s[i]] = 1
print((sum(t[k] * (t[k] -1) // 2 for k in t))) | n = int(eval(input()))
s = ["".join(sorted(str(eval(input())))) for _ in range(n)]
t = {}
for i in range(n):
if s[i] in t:
t[s[i]] += 1
else:
t[s[i]] = 1
print((sum(t[k] * (t[k] -1) // 2 for k in t))) | 11 | 10 | 258 | 208 | n = int(eval(input()))
s = ["".join(sorted(str(eval(input())))) for _ in range(n)]
for i in range(n):
s[i] = "".join(sorted(s[i]))
t = {}
for i in range(n):
if s[i] in t:
t[s[i]] += 1
else:
t[s[i]] = 1
print((sum(t[k] * (t[k] - 1) // 2 for k in t)))
| n = int(eval(input()))
s = ["".join(sorted(str(eval(input())))) for _ in range(n)]
t = {}
for i in range(n):
if s[i] in t:
t[s[i]] += 1
else:
t[s[i]] = 1
print((sum(t[k] * (t[k] - 1) // 2 for k in t)))
| false | 9.090909 | [
"-for i in range(n):",
"- s[i] = \"\".join(sorted(s[i]))"
] | false | 0.039546 | 0.044047 | 0.897817 | [
"s078065984",
"s912997548"
] |
u863370423 | p02731 | python | s991391931 | s516382462 | 20 | 17 | 3,188 | 2,940 | Accepted | Accepted | 15 | def short(S):
a = S/3
return (a **3)
S =int(eval(input()))
print((short(S))) | n=int(eval(input()))
k=3123432442
print(("{:.12f}".format((n/3)**3))) | 7 | 3 | 84 | 63 | def short(S):
a = S / 3
return a**3
S = int(eval(input()))
print((short(S)))
| n = int(eval(input()))
k = 3123432442
print(("{:.12f}".format((n / 3) ** 3)))
| false | 57.142857 | [
"-def short(S):",
"- a = S / 3",
"- return a**3",
"-",
"-",
"-S = int(eval(input()))",
"-print((short(S)))",
"+n = int(eval(input()))",
"+k = 3123432442",
"+print((\"{:.12f}\".format((n / 3) ** 3)))"
] | false | 0.063447 | 0.065851 | 0.963493 | [
"s991391931",
"s516382462"
] |
u499381410 | p02936 | python | s834669990 | s370090780 | 1,963 | 847 | 101,140 | 124,620 | Accepted | Accepted | 56.85 | from collections import deque
n, q = list(map(int, input().split()))
graph = [[] for i in range(n)]
for i in range(n - 1):
a, b = list(map(int, input().split()))
graph[a - 1] += [b - 1]
graph[b - 1] += [a - 1]
cost = [0] * n
for j in range(q):
p, x = list(map(int, input().split()))
... | from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, ... | 33 | 64 | 594 | 1,423 | from collections import deque
n, q = list(map(int, input().split()))
graph = [[] for i in range(n)]
for i in range(n - 1):
a, b = list(map(int, input().split()))
graph[a - 1] += [b - 1]
graph[b - 1] += [a - 1]
cost = [0] * n
for j in range(q):
p, x = list(map(int, input().split()))
cost[p - 1] += x... | from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor
fro... | false | 48.4375 | [
"-from collections import deque",
"+from collections import defaultdict, deque, Counter",
"+from heapq import heappush, heappop, heapify",
"+import math",
"+import bisect",
"+import random",
"+from itertools import permutations, accumulate, combinations, product",
"+import sys",
"+import string",
... | false | 0.037869 | 0.037776 | 1.002451 | [
"s834669990",
"s370090780"
] |
u595289165 | p02991 | python | s151450178 | s573469306 | 1,207 | 457 | 109,920 | 42,656 | Accepted | Accepted | 62.14 | from collections import deque
n, m = list(map(int, input().split()))
graph = [[[] for _ in range(3)] for _ in range(n+1)]
for _ in range(m):
u, v = list(map(int, input().split()))
graph[u][0].append([v, 1])
graph[u][1].append([v, 2])
graph[u][2].append([v, 0])
s, t = list(map(int, input().sp... | from collections import deque
n, m = list(map(int, input().split()))
graph = [[] for _ in range(n+1)]
for _ in range(m):
u, v = list(map(int, input().split()))
graph[u].append(v)
s, t = list(map(int, input().split()))
dist = [[-3] * 3 for _ in range(n+1)]
dist[s][0] = 0
q = deque([(s, 0)])
w... | 26 | 25 | 695 | 540 | from collections import deque
n, m = list(map(int, input().split()))
graph = [[[] for _ in range(3)] for _ in range(n + 1)]
for _ in range(m):
u, v = list(map(int, input().split()))
graph[u][0].append([v, 1])
graph[u][1].append([v, 2])
graph[u][2].append([v, 0])
s, t = list(map(int, input().split()))
q... | from collections import deque
n, m = list(map(int, input().split()))
graph = [[] for _ in range(n + 1)]
for _ in range(m):
u, v = list(map(int, input().split()))
graph[u].append(v)
s, t = list(map(int, input().split()))
dist = [[-3] * 3 for _ in range(n + 1)]
dist[s][0] = 0
q = deque([(s, 0)])
while q:
now... | false | 3.846154 | [
"-graph = [[[] for _ in range(3)] for _ in range(n + 1)]",
"+graph = [[] for _ in range(n + 1)]",
"- graph[u][0].append([v, 1])",
"- graph[u][1].append([v, 2])",
"- graph[u][2].append([v, 0])",
"+ graph[u].append(v)",
"-q = deque([[s, 0]])",
"-visited = [[False] * 3 for _ in range(n + 1)]"... | false | 0.077089 | 0.14521 | 0.530877 | [
"s151450178",
"s573469306"
] |
u670180528 | p03973 | python | s147886657 | s598118757 | 86 | 68 | 14,332 | 14,332 | Accepted | Accepted | 20.93 | n,*a=list(map(int,open(0).read().split()))
cur=1
ans=a[0]-1
a[0]=1
for x in a:
if x<=cur:
pass
elif x==cur+1:
cur=x
else:
ans+=0--(x-cur-1)//(cur+1)
print(ans) | def main():
n, *a = list(map(int, open(0).read().split()))
cur = 1
ans = a[0] - 1
a[0] = 1
for x in a:
if x <= cur:
pass
elif x == cur + 1:
cur = x
else:
ans += 0 - -(x - cur - 1) // (cur + 1)
print(ans)
if __name__=="__main__":
main() | 12 | 16 | 173 | 267 | n, *a = list(map(int, open(0).read().split()))
cur = 1
ans = a[0] - 1
a[0] = 1
for x in a:
if x <= cur:
pass
elif x == cur + 1:
cur = x
else:
ans += 0 - -(x - cur - 1) // (cur + 1)
print(ans)
| def main():
n, *a = list(map(int, open(0).read().split()))
cur = 1
ans = a[0] - 1
a[0] = 1
for x in a:
if x <= cur:
pass
elif x == cur + 1:
cur = x
else:
ans += 0 - -(x - cur - 1) // (cur + 1)
print(ans)
if __name__ == "__main__":
... | false | 25 | [
"-n, *a = list(map(int, open(0).read().split()))",
"-cur = 1",
"-ans = a[0] - 1",
"-a[0] = 1",
"-for x in a:",
"- if x <= cur:",
"- pass",
"- elif x == cur + 1:",
"- cur = x",
"- else:",
"- ans += 0 - -(x - cur - 1) // (cur + 1)",
"-print(ans)",
"+def main():",
... | false | 0.046246 | 0.035578 | 1.299857 | [
"s147886657",
"s598118757"
] |
u415905784 | p03287 | python | s298756033 | s428902879 | 129 | 82 | 16,392 | 17,368 | Accepted | Accepted | 36.43 | N, M = list(map(int, input().split()))
A = [0] * N
cnt = 0
for i, x in enumerate(input().split()):
A[i] = int(x) % M
sumA = 0
for i in range(N):
sumA += A[i]
sumA %= M
A[i] = sumA
A += [0]
index = {}
for i in set(set(A)):
index[i] = 0
for a in A:
index[a] += 1
for i in list(index.values()):
... | from collections import Counter
from itertools import accumulate
N, M = list(map(int, input().split()))
A = [int(x) for x in input().split()]
C = Counter([0] + [a % M for a in accumulate(A)])
cnt = 0
for c in list(C.values()):
cnt += c * (c - 1) // 2
print(cnt) | 19 | 9 | 346 | 259 | N, M = list(map(int, input().split()))
A = [0] * N
cnt = 0
for i, x in enumerate(input().split()):
A[i] = int(x) % M
sumA = 0
for i in range(N):
sumA += A[i]
sumA %= M
A[i] = sumA
A += [0]
index = {}
for i in set(set(A)):
index[i] = 0
for a in A:
index[a] += 1
for i in list(index.values()):
... | from collections import Counter
from itertools import accumulate
N, M = list(map(int, input().split()))
A = [int(x) for x in input().split()]
C = Counter([0] + [a % M for a in accumulate(A)])
cnt = 0
for c in list(C.values()):
cnt += c * (c - 1) // 2
print(cnt)
| false | 52.631579 | [
"+from collections import Counter",
"+from itertools import accumulate",
"+",
"-A = [0] * N",
"+A = [int(x) for x in input().split()]",
"+C = Counter([0] + [a % M for a in accumulate(A)])",
"-for i, x in enumerate(input().split()):",
"- A[i] = int(x) % M",
"-sumA = 0",
"-for i in range(N):",
... | false | 0.035876 | 0.042848 | 0.837298 | [
"s298756033",
"s428902879"
] |
u235837041 | p02547 | python | s065097734 | s823351008 | 30 | 25 | 9,032 | 9,096 | Accepted | Accepted | 16.67 | def judge():
cnt = 0 # 今何連続でゾロ目が出ているか記録しておきます
for _ in range(N):
x, y = list(map(int, input().split()))
if x == y:
# ゾロ目ストリークが1増えました
cnt += 1
else:
# ゾロ目ストリークが切れました
cnt = 0
if cnt == 3:
# 3連続になった瞬間、return... | def judge():
count = 0
for _ in range(x):
d1, d2 = list(map(int, input().split()))
if d1 == d2:
count += 1
else:
count = 0
if count == 3:
return True
return False
x = int(eval(input()))
if judge():
print("Ye... | 27 | 20 | 518 | 336 | def judge():
cnt = 0 # 今何連続でゾロ目が出ているか記録しておきます
for _ in range(N):
x, y = list(map(int, input().split()))
if x == y:
# ゾロ目ストリークが1増えました
cnt += 1
else:
# ゾロ目ストリークが切れました
cnt = 0
if cnt == 3:
# 3連続になった瞬間、return True していいです
... | def judge():
count = 0
for _ in range(x):
d1, d2 = list(map(int, input().split()))
if d1 == d2:
count += 1
else:
count = 0
if count == 3:
return True
return False
x = int(eval(input()))
if judge():
print("Yes")
else:
print("No")
| false | 25.925926 | [
"- cnt = 0 # 今何連続でゾロ目が出ているか記録しておきます",
"- for _ in range(N):",
"- x, y = list(map(int, input().split()))",
"- if x == y:",
"- # ゾロ目ストリークが1増えました",
"- cnt += 1",
"+ count = 0",
"+ for _ in range(x):",
"+ d1, d2 = list(map(int, input().split()))",
... | false | 0.05848 | 0.054751 | 1.068101 | [
"s065097734",
"s823351008"
] |
u990900604 | p02392 | python | s449625938 | s190489209 | 40 | 10 | 9,848 | 4,628 | Accepted | Accepted | 75 | import sys
if __name__ == '__main__':
import doctest
doctest.testmod()
a, b, c = list(map(int, sys.stdin.read().split()))
if a < b < c:
print("Yes")
else:
print("No")
| #!/usr/bin/env python
#-*- coding: utf-8 -*-
# http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_2_B
if __name__ == '__main__':
a, b, c = list(map(int, input().split()))
if a < b < c:
print("Yes")
else:
print("No")
| 10 | 11 | 205 | 263 | import sys
if __name__ == "__main__":
import doctest
doctest.testmod()
a, b, c = list(map(int, sys.stdin.read().split()))
if a < b < c:
print("Yes")
else:
print("No")
| #!/usr/bin/env python
# -*- coding: utf-8 -*-
# http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_2_B
if __name__ == "__main__":
a, b, c = list(map(int, input().split()))
if a < b < c:
print("Yes")
else:
print("No")
| false | 9.090909 | [
"-import sys",
"-",
"+#!/usr/bin/env python",
"+# -*- coding: utf-8 -*-",
"+# http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_2_B",
"- import doctest",
"-",
"- doctest.testmod()",
"- a, b, c = list(map(int, sys.stdin.read().split()))",
"+ a, b, c = list(map(int, input().s... | false | 0.104928 | 0.036673 | 2.861179 | [
"s449625938",
"s190489209"
] |
u905582793 | p03053 | python | s501668963 | s260749490 | 792 | 716 | 154,204 | 163,932 | Accepted | Accepted | 9.6 | from collections import deque
import sys
input = sys.stdin.readline
h,w=list(map(int, input().split(' ')))
a = [eval(input()) for i in range(h)]
nl = [[] for i in range(h)]
q = deque()
for i in range(h):
for j in range(w):
if a[i][j] == "#":
nl[i].append(0)
q.append([i,j,0... | from collections import deque
import sys
input = sys.stdin.readline
h,w = list(map(int,input().split()))
a = [list(input().rstrip()) for i in range(h)]
q = deque()
for i in range(h):
for j in range(w):
if a[i][j] == "#":
a[i][j] = 0
q.append((i,j,0))
else:
a[i][j] = -1
while q:
... | 32 | 24 | 850 | 591 | from collections import deque
import sys
input = sys.stdin.readline
h, w = list(map(int, input().split(" ")))
a = [eval(input()) for i in range(h)]
nl = [[] for i in range(h)]
q = deque()
for i in range(h):
for j in range(w):
if a[i][j] == "#":
nl[i].append(0)
q.append([i, j, 0])
... | from collections import deque
import sys
input = sys.stdin.readline
h, w = list(map(int, input().split()))
a = [list(input().rstrip()) for i in range(h)]
q = deque()
for i in range(h):
for j in range(w):
if a[i][j] == "#":
a[i][j] = 0
q.append((i, j, 0))
else:
a[... | false | 25 | [
"-h, w = list(map(int, input().split(\" \")))",
"-a = [eval(input()) for i in range(h)]",
"-nl = [[] for i in range(h)]",
"+h, w = list(map(int, input().split()))",
"+a = [list(input().rstrip()) for i in range(h)]",
"- nl[i].append(0)",
"- q.append([i, j, 0])",
"+ a[i]... | false | 0.036836 | 0.033019 | 1.115596 | [
"s501668963",
"s260749490"
] |
u673361376 | p03014 | python | s439509127 | s664785048 | 1,366 | 882 | 220,424 | 99,800 | Accepted | Accepted | 35.43 | import sys
H,W = list(map(int,input().split()))
grids = [[s for s in sys.stdin.readline()] for _ in range(H)]
col_cnt = [[0 for _ in range(W)]for _ in range(H)]
for i in range(W):
tmp_cnt = 0
prvjj = 0
for j in range(H):
if grids[j][i] == '.':
tmp_cnt += 1
else:
col_cnt[j][i] = ... | import copy
def make_empty_nums():
under_empty_nums = [[0 for _ in range(W)] for _ in range(H)]
for h in range(H - 1, -1, -1):
for w in range(W):
if grids[h][w] == '#':
under_empty_nums[h][w] = 0
else:
if h == H - 1:
... | 38 | 43 | 841 | 1,400 | import sys
H, W = list(map(int, input().split()))
grids = [[s for s in sys.stdin.readline()] for _ in range(H)]
col_cnt = [[0 for _ in range(W)] for _ in range(H)]
for i in range(W):
tmp_cnt = 0
prvjj = 0
for j in range(H):
if grids[j][i] == ".":
tmp_cnt += 1
else:
c... | import copy
def make_empty_nums():
under_empty_nums = [[0 for _ in range(W)] for _ in range(H)]
for h in range(H - 1, -1, -1):
for w in range(W):
if grids[h][w] == "#":
under_empty_nums[h][w] = 0
else:
if h == H - 1:
under_emp... | false | 11.627907 | [
"-import sys",
"+import copy",
"+",
"+",
"+def make_empty_nums():",
"+ under_empty_nums = [[0 for _ in range(W)] for _ in range(H)]",
"+ for h in range(H - 1, -1, -1):",
"+ for w in range(W):",
"+ if grids[h][w] == \"#\":",
"+ under_empty_nums[h][w] = 0",
"... | false | 0.042337 | 0.03723 | 1.137175 | [
"s439509127",
"s664785048"
] |
u936985471 | p03805 | python | s122680402 | s124077703 | 47 | 36 | 3,064 | 9,100 | Accepted | Accepted | 23.4 | import sys
readline = sys.stdin.readline
N,M = list(map(int,readline().split()))
G = [[] for i in range(N)]
for i in range(M):
a,b = list(map(int,readline().split()))
G[a-1].append(b-1)
G[b-1].append(a-1)
ans = 0
stack = []
stack.append([0,set()])
while stack:
v,visited = stack.pop()
if v... | import sys
readline = sys.stdin.readline
N,M = list(map(int,readline().split()))
G = [[] for i in range(N)]
for i in range(M):
a,b = list(map(int,readline().split()))
G[a - 1].append(b - 1)
G[b - 1].append(a - 1)
stack = []
stack.append([0, set()])
ans = 0
while stack:
v, visited = stack.pop()... | 27 | 27 | 508 | 529 | import sys
readline = sys.stdin.readline
N, M = list(map(int, readline().split()))
G = [[] for i in range(N)]
for i in range(M):
a, b = list(map(int, readline().split()))
G[a - 1].append(b - 1)
G[b - 1].append(a - 1)
ans = 0
stack = []
stack.append([0, set()])
while stack:
v, visited = stack.pop()
... | import sys
readline = sys.stdin.readline
N, M = list(map(int, readline().split()))
G = [[] for i in range(N)]
for i in range(M):
a, b = list(map(int, readline().split()))
G[a - 1].append(b - 1)
G[b - 1].append(a - 1)
stack = []
stack.append([0, set()])
ans = 0
while stack:
v, visited = stack.pop()
... | false | 0 | [
"-ans = 0",
"+ans = 0",
"- if v in visited:",
"- continue",
"- visited2 = visited.copy()",
"- visited2.add(v)",
"- if len(visited2) == N:",
"+ visited.add(v)",
"+ if len(visited) == N:",
"- stack.append([child, visited2])",
"+ if child in visited:",
"+ ... | false | 0.037116 | 0.037651 | 0.985808 | [
"s122680402",
"s124077703"
] |
u069172538 | p03048 | python | s742064499 | s211942663 | 1,897 | 274 | 3,060 | 40,428 | Accepted | Accepted | 85.56 | R,G,B,N=(int(i) for i in input().split())
import math
answer=0
for r in range(0,math.floor(N/R)+1):
for g in range(math.floor(N/G)+1):
sss=R*r+G*g
if sss>N:
break
if (N-sss)%B==0:
answer+=1
print(answer)
| R,G,B,N=(int(i) for i in input().split())
import math
answer=0
for r in range(0,math.floor(N/R)+1):
for g in range(math.floor(N/G)+1):
if R*r+G*g>N:
break
if (N-R*r-G*g)%B==0:
answer+=1
print(answer)
| 13 | 13 | 271 | 259 | R, G, B, N = (int(i) for i in input().split())
import math
answer = 0
for r in range(0, math.floor(N / R) + 1):
for g in range(math.floor(N / G) + 1):
sss = R * r + G * g
if sss > N:
break
if (N - sss) % B == 0:
answer += 1
print(answer)
| R, G, B, N = (int(i) for i in input().split())
import math
answer = 0
for r in range(0, math.floor(N / R) + 1):
for g in range(math.floor(N / G) + 1):
if R * r + G * g > N:
break
if (N - R * r - G * g) % B == 0:
answer += 1
print(answer)
| false | 0 | [
"- sss = R * r + G * g",
"- if sss > N:",
"+ if R * r + G * g > N:",
"- if (N - sss) % B == 0:",
"+ if (N - R * r - G * g) % B == 0:"
] | false | 0.060708 | 0.115983 | 0.523418 | [
"s742064499",
"s211942663"
] |
u411353821 | p02720 | python | s676781239 | s290146990 | 124 | 79 | 5,952 | 6,124 | Accepted | Accepted | 36.29 | from collections import deque
def main():
k = int(eval(input()))
if k <= 9:
print(k)
else:
queue = deque()
for i in range(1, 10):
queue.append(i)
flag = 1
cnt_lunlun = 9
while flag:
first_element = queue.popleft()
... | from collections import deque
def main():
k = int(eval(input()))
if k <= 9:
print(k)
else:
queue = deque()
for i in range(1, 10):
queue.append(i)
flag = 1
cnt_lunlun = 9
while flag:
first_element = queue.popleft()
... | 41 | 37 | 1,043 | 862 | from collections import deque
def main():
k = int(eval(input()))
if k <= 9:
print(k)
else:
queue = deque()
for i in range(1, 10):
queue.append(i)
flag = 1
cnt_lunlun = 9
while flag:
first_element = queue.popleft()
lunlun_n... | from collections import deque
def main():
k = int(eval(input()))
if k <= 9:
print(k)
else:
queue = deque()
for i in range(1, 10):
queue.append(i)
flag = 1
cnt_lunlun = 9
while flag:
first_element = queue.popleft()
lunlun_n... | false | 9.756098 | [
"- last_digit = int(str(num)[-1])",
"- if last_digit == 0:",
"- return int(str(num) + \"0\"), int(str(num) + \"1\")",
"- elif last_digit == 9:",
"- return int(str(num) + \"8\"), int(str(num) + \"9\")",
"- else:",
"- return (",
"- int(str(num) + str(last_digi... | false | 0.052754 | 0.052186 | 1.010883 | [
"s676781239",
"s290146990"
] |
u046187684 | p02762 | python | s309511066 | s928727958 | 536 | 484 | 83,944 | 70,376 | Accepted | Accepted | 9.7 | class UnionFind:
def __init__(self, n):
self.t = [-1] * (n + 1)
def flatten(self):
for i, _ in enumerate(self.t):
self.find_root(i)
def union(self, a, b):
ra = self.find_root(a)
rb = self.find_root(b)
if ra != rb:
self.t[max(ra,... | class UnionFind:
def __init__(self, n):
self.t = [-1] * (n + 1)
def flatten(self):
for i, _ in enumerate(self.t):
self.find_root(i)
def union(self, a, b):
ra = self.find_root(a)
rb = self.find_root(b)
if ra != rb:
self.t[max(ra,... | 52 | 49 | 1,395 | 1,324 | class UnionFind:
def __init__(self, n):
self.t = [-1] * (n + 1)
def flatten(self):
for i, _ in enumerate(self.t):
self.find_root(i)
def union(self, a, b):
ra = self.find_root(a)
rb = self.find_root(b)
if ra != rb:
self.t[max(ra, rb)] = min(ra... | class UnionFind:
def __init__(self, n):
self.t = [-1] * (n + 1)
def flatten(self):
for i, _ in enumerate(self.t):
self.find_root(i)
def union(self, a, b):
ra = self.find_root(a)
rb = self.find_root(b)
if ra != rb:
self.t[max(ra, rb)] = min(ra... | false | 5.769231 | [
"- ab, cd = abcd[: 2 * m], abcd[2 * m :]",
"- for a, b in zip(*[iter(ab)] * 2):",
"+ for a, b in zip(*[iter(abcd[: 2 * m])] * 2):",
"- if v < 0:",
"- uf.t[i] = i",
"- mp = {k: [] for k in set(uf.t[1:])}",
"+ uf.t[i] = i if v < 0 else v",
"+ mp = {k: set([]) for ... | false | 0.039124 | 0.085206 | 0.459163 | [
"s309511066",
"s928727958"
] |
u906428167 | p02616 | python | s545297929 | s726581622 | 612 | 396 | 117,056 | 134,960 | Accepted | Accepted | 35.29 | from heapq import heappop, heappush
mod = 10**9+7
n, k = list(map(int, input().split()))
a = [int(x) for x in input().split()]
def sgn(x):
if x >= 0:
return 0
elif x < 0:
return 1
pl = []
mn = []
for x in a:
if x >= 0:
pl.append(x)
elif x < 0:
mn.... | mod = 10**9+7
n, k = list(map(int, input().split()))
a = [int(x) for x in input().split()]
pl = []
mn = []
zr = []
tmp = 1
cnt = 0
for x in a:
if x > 0:
pl.append(x)
elif x < 0:
mn.append(-x)
else:
zr.append(x)
pl = sorted(pl, reverse=True)
mn = sorted(mn, rev... | 92 | 78 | 1,512 | 1,325 | from heapq import heappop, heappush
mod = 10**9 + 7
n, k = list(map(int, input().split()))
a = [int(x) for x in input().split()]
def sgn(x):
if x >= 0:
return 0
elif x < 0:
return 1
pl = []
mn = []
for x in a:
if x >= 0:
pl.append(x)
elif x < 0:
mn.append(-x)
pl = so... | mod = 10**9 + 7
n, k = list(map(int, input().split()))
a = [int(x) for x in input().split()]
pl = []
mn = []
zr = []
tmp = 1
cnt = 0
for x in a:
if x > 0:
pl.append(x)
elif x < 0:
mn.append(-x)
else:
zr.append(x)
pl = sorted(pl, reverse=True)
mn = sorted(mn, reverse=True)
ans = 0
if ... | false | 15.217391 | [
"-from heapq import heappop, heappush",
"-",
"-",
"-",
"-def sgn(x):",
"- if x >= 0:",
"- return 0",
"- elif x < 0:",
"- return 1",
"-",
"-",
"+zr = []",
"+tmp = 1",
"+cnt = 0",
"- if x >= 0:",
"+ if x > 0:",
"+ else:",
"+ zr.append(x)",
"-b = ... | false | 0.035524 | 0.034943 | 1.016618 | [
"s545297929",
"s726581622"
] |
u059210959 | p03632 | python | s061060751 | s770192915 | 50 | 42 | 5,104 | 10,820 | Accepted | Accepted | 16 | # encoding:utf-8
import copy
import random
import bisect #bisect_left これで二部探索の大小検索が行える
import math
A,B,C,D = list(map(int,input().split()))
cnt = 0
for i in range(101):
if A<i<=B and C< i <= D:
cnt += 1
print(cnt)
| #!/usr/bin/env python3
# encoding:utf-8
import copy
import random
import bisect #bisect_left これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math
import sys
import collections
from decimal import Decimal # 10進数で考慮できる
mod = 10**9+7
sys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000
d = collections.de... | 14 | 20 | 236 | 458 | # encoding:utf-8
import copy
import random
import bisect # bisect_left これで二部探索の大小検索が行える
import math
A, B, C, D = list(map(int, input().split()))
cnt = 0
for i in range(101):
if A < i <= B and C < i <= D:
cnt += 1
print(cnt)
| #!/usr/bin/env python3
# encoding:utf-8
import copy
import random
import bisect # bisect_left これで二部探索の大小検索が行える
import fractions # 最小公倍数などはこっち
import math
import sys
import collections
from decimal import Decimal # 10進数で考慮できる
mod = 10**9 + 7
sys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000
d = collections.deque()
... | false | 30 | [
"+#!/usr/bin/env python3",
"+import fractions # 最小公倍数などはこっち",
"+import sys",
"+import collections",
"+from decimal import Decimal # 10進数で考慮できる",
"-A, B, C, D = list(map(int, input().split()))",
"-cnt = 0",
"-for i in range(101):",
"- if A < i <= B and C < i <= D:",
"- cnt += 1",
"-pr... | false | 0.19151 | 0.053606 | 3.572533 | [
"s061060751",
"s770192915"
] |
u762420987 | p03486 | python | s790088753 | s708911835 | 20 | 18 | 2,940 | 2,940 | Accepted | Accepted | 10 | s = sorted(list(eval(input())))
t = sorted(list(eval(input())), reverse=True)
if s < t:
print("Yes")
else:
print("No")
| s = "".join(sorted(eval(input())))
t = "".join(sorted(eval(input()))[::-1])
if s < t:
print("Yes")
else:
print("No") | 7 | 6 | 122 | 117 | s = sorted(list(eval(input())))
t = sorted(list(eval(input())), reverse=True)
if s < t:
print("Yes")
else:
print("No")
| s = "".join(sorted(eval(input())))
t = "".join(sorted(eval(input()))[::-1])
if s < t:
print("Yes")
else:
print("No")
| false | 14.285714 | [
"-s = sorted(list(eval(input())))",
"-t = sorted(list(eval(input())), reverse=True)",
"+s = \"\".join(sorted(eval(input())))",
"+t = \"\".join(sorted(eval(input()))[::-1])"
] | false | 0.03541 | 0.035949 | 0.984986 | [
"s790088753",
"s708911835"
] |
u936985471 | p02837 | python | s645985520 | s663034719 | 283 | 141 | 3,064 | 3,064 | Accepted | Accepted | 50.18 | N=int(eval(input()))
honest=[0 for i in range(N)]
liar=[0 for i in range(N)]
for i in range(N):
a=int(eval(input()))
for j in range(a):
x,y=list(map(int,input().split()))
if y==0:
liar[i]|=(1<<(x-1))
else:
honest[i]|=(1<<(x-1))
ans=0
for i in range(2**N):
ok=True
for j in... | import sys
readline = sys.stdin.readline
N = int(readline())
statement = [[] for i in range(N)]
for i in range(N):
A = int(readline())
for j in range(A):
x,y = list(map(int,readline().split()))
statement[i].append([x - 1,y])
# N人の誰が正直者か、全探索して、矛盾がないパターンはOK
ans = 0
for i in range(2 ** N):
... | 45 | 32 | 823 | 691 | N = int(eval(input()))
honest = [0 for i in range(N)]
liar = [0 for i in range(N)]
for i in range(N):
a = int(eval(input()))
for j in range(a):
x, y = list(map(int, input().split()))
if y == 0:
liar[i] |= 1 << (x - 1)
else:
honest[i] |= 1 << (x - 1)
ans = 0
for i ... | import sys
readline = sys.stdin.readline
N = int(readline())
statement = [[] for i in range(N)]
for i in range(N):
A = int(readline())
for j in range(A):
x, y = list(map(int, readline().split()))
statement[i].append([x - 1, y])
# N人の誰が正直者か、全探索して、矛盾がないパターンはOK
ans = 0
for i in range(2**N):
ok... | false | 28.888889 | [
"-N = int(eval(input()))",
"-honest = [0 for i in range(N)]",
"-liar = [0 for i in range(N)]",
"+import sys",
"+",
"+readline = sys.stdin.readline",
"+N = int(readline())",
"+statement = [[] for i in range(N)]",
"- a = int(eval(input()))",
"- for j in range(a):",
"- x, y = list(map(... | false | 0.073867 | 0.036848 | 2.004656 | [
"s645985520",
"s663034719"
] |
u588341295 | p03495 | python | s096716735 | s841757419 | 229 | 157 | 39,344 | 39,336 | Accepted | Accepted | 31.44 | # -*- coding: utf-8 -*-
from collections import Counter
N, K = list(map(int, input().split()))
num_list = list(map(int, input().split()))
# 各数値ごとに数を集計
num_dict = Counter(num_list)
# 数の少ない順でソート
num_tpl = num_dict.most_common()[::-1]
ans = 0
for i in range(len(num_tpl)):
# 種類数がK以下なら終了
if len(n... | # -*- coding: utf-8 -*-
from collections import Counter
N, K = list(map(int, input().split()))
num_list = list(map(int, input().split()))
# 各数値ごとに数を集計
num_dict = Counter(num_list)
# 数の多い順でソート
num_tpl = num_dict.most_common()
# 種類が少ない時は書き換え0回
if len(num_tpl) <= K:
print((0))
exit()
else:
... | 20 | 23 | 420 | 444 | # -*- coding: utf-8 -*-
from collections import Counter
N, K = list(map(int, input().split()))
num_list = list(map(int, input().split()))
# 各数値ごとに数を集計
num_dict = Counter(num_list)
# 数の少ない順でソート
num_tpl = num_dict.most_common()[::-1]
ans = 0
for i in range(len(num_tpl)):
# 種類数がK以下なら終了
if len(num_tpl) - i <= K:
... | # -*- coding: utf-8 -*-
from collections import Counter
N, K = list(map(int, input().split()))
num_list = list(map(int, input().split()))
# 各数値ごとに数を集計
num_dict = Counter(num_list)
# 数の多い順でソート
num_tpl = num_dict.most_common()
# 種類が少ない時は書き換え0回
if len(num_tpl) <= K:
print((0))
exit()
else:
sum1 = 0
# 残してい... | false | 13.043478 | [
"-# 数の少ない順でソート",
"-num_tpl = num_dict.most_common()[::-1]",
"-ans = 0",
"-for i in range(len(num_tpl)):",
"- # 種類数がK以下なら終了",
"- if len(num_tpl) - i <= K:",
"- print(ans)",
"- exit()",
"- # 数が少ない要素から、答えに追加していく",
"- ans += num_tpl[i][1]",
"+# 数の多い順でソート",
"+num_tpl = num... | false | 0.117651 | 0.045233 | 2.60103 | [
"s096716735",
"s841757419"
] |
u517447467 | p02713 | python | s626499101 | s344586277 | 1,693 | 920 | 71,320 | 72,032 | Accepted | Accepted | 45.66 | import math
N = int(eval(input()))
all_gcd = [math.gcd(math.gcd(i, j), m) for i in range(1, N+1) for j in range(1, N+1) for m in range(1, N+1)]
print((sum(all_gcd)))
| import math
N = int(eval(input()))
GCD = [[math.gcd(i, j) for i in range(1, N+1)] for j in range(1, N+1)]
#print(GCD)
all_gcd = [GCD[GCD[i][j]-1][m] for i in range(N) for j in range(N) for m in range(N)]
print((sum(all_gcd))) | 4 | 6 | 161 | 222 | import math
N = int(eval(input()))
all_gcd = [
math.gcd(math.gcd(i, j), m)
for i in range(1, N + 1)
for j in range(1, N + 1)
for m in range(1, N + 1)
]
print((sum(all_gcd)))
| import math
N = int(eval(input()))
GCD = [[math.gcd(i, j) for i in range(1, N + 1)] for j in range(1, N + 1)]
# print(GCD)
all_gcd = [GCD[GCD[i][j] - 1][m] for i in range(N) for j in range(N) for m in range(N)]
print((sum(all_gcd)))
| false | 33.333333 | [
"-all_gcd = [",
"- math.gcd(math.gcd(i, j), m)",
"- for i in range(1, N + 1)",
"- for j in range(1, N + 1)",
"- for m in range(1, N + 1)",
"-]",
"+GCD = [[math.gcd(i, j) for i in range(1, N + 1)] for j in range(1, N + 1)]",
"+# print(GCD)",
"+all_gcd = [GCD[GCD[i][j] - 1][m] for i in ran... | false | 0.15196 | 0.15182 | 1.000924 | [
"s626499101",
"s344586277"
] |
u077291787 | p03353 | python | s053075721 | s112135850 | 39 | 32 | 5,724 | 4,832 | Accepted | Accepted | 17.95 | # ABC097C - K-th Substring (ARC097C)
from functools import reduce
from operator import or_
def get_substring(a: str, x: int) -> set:
ret = set()
for i in range(N - x + 1):
ret |= {a[i : i + x]}
return ret
def main():
global N
S = eval(input())
K = int(eval(input()))
... | # ABC097C - K-th Substring (ARC097C)
def get_substring(a: str, x: int) -> set:
ret = set()
for i in range(N - x + 1):
ret |= {a[i : i + x]}
return ret
def main():
global N
S = eval(input())
K = int(eval(input()))
N, x = len(S), set()
for i in range(1, K + 1):
... | 24 | 21 | 478 | 424 | # ABC097C - K-th Substring (ARC097C)
from functools import reduce
from operator import or_
def get_substring(a: str, x: int) -> set:
ret = set()
for i in range(N - x + 1):
ret |= {a[i : i + x]}
return ret
def main():
global N
S = eval(input())
K = int(eval(input()))
N = len(S)
... | # ABC097C - K-th Substring (ARC097C)
def get_substring(a: str, x: int) -> set:
ret = set()
for i in range(N - x + 1):
ret |= {a[i : i + x]}
return ret
def main():
global N
S = eval(input())
K = int(eval(input()))
N, x = len(S), set()
for i in range(1, K + 1):
x |= get_s... | false | 12.5 | [
"-from functools import reduce",
"-from operator import or_",
"-",
"-",
"- N = len(S)",
"- x = reduce(or_, [get_substring(S, i) for i in range(1, K + 1)])",
"+ N, x = len(S), set()",
"+ for i in range(1, K + 1):",
"+ x |= get_substring(S, i)"
] | false | 0.052527 | 0.094254 | 0.557297 | [
"s053075721",
"s112135850"
] |
u955248595 | p02959 | python | s894409963 | s648938508 | 148 | 119 | 25,392 | 25,376 | Accepted | Accepted | 19.59 | N = int(eval(input()))
A = [int(x) for x in input().split()]
B = [int(x) for x in input().split()]
St = sum(A)
for T in range(0,N):
if A[T]+A[T+1]<= B[T]:
A[T] = 0
A[T+1] = 0
if A[T]<=B[T]<A[T]+A[T+1]:
A[T+1] = A[T+1]-(B[T]-A[T])
A[T] = 0
if B[T]<A[T]:
A... | N = int(eval(input()))
A = [int(x) for x in input().split()]
B = [int(x) for x in input().split()]
Pre = sum(A)
for T in range(0,N):
if A[T]<=B[T]:
A[T+1] = max(A[T+1]-(B[T]-A[T]),0)
A[T] = 0
else:
A[T] -= B[T]
Aft = sum(A)
print((Pre-Aft)) | 15 | 13 | 348 | 277 | N = int(eval(input()))
A = [int(x) for x in input().split()]
B = [int(x) for x in input().split()]
St = sum(A)
for T in range(0, N):
if A[T] + A[T + 1] <= B[T]:
A[T] = 0
A[T + 1] = 0
if A[T] <= B[T] < A[T] + A[T + 1]:
A[T + 1] = A[T + 1] - (B[T] - A[T])
A[T] = 0
if B[T] < A[T... | N = int(eval(input()))
A = [int(x) for x in input().split()]
B = [int(x) for x in input().split()]
Pre = sum(A)
for T in range(0, N):
if A[T] <= B[T]:
A[T + 1] = max(A[T + 1] - (B[T] - A[T]), 0)
A[T] = 0
else:
A[T] -= B[T]
Aft = sum(A)
print((Pre - Aft))
| false | 13.333333 | [
"-St = sum(A)",
"+Pre = sum(A)",
"- if A[T] + A[T + 1] <= B[T]:",
"+ if A[T] <= B[T]:",
"+ A[T + 1] = max(A[T + 1] - (B[T] - A[T]), 0)",
"- A[T + 1] = 0",
"- if A[T] <= B[T] < A[T] + A[T + 1]:",
"- A[T + 1] = A[T + 1] - (B[T] - A[T])",
"- A[T] = 0",
"- if B[... | false | 0.036918 | 0.044962 | 0.821108 | [
"s894409963",
"s648938508"
] |
u638456847 | p02614 | python | s244484277 | s199232194 | 131 | 55 | 9,268 | 9,208 | Accepted | Accepted | 58.02 | from copy import deepcopy
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
def main():
H,W,K = list(map(int, readline().split()))
C = [list(readline().strip()) for _ in range(H)]
ans = 0
for i in range(2**(H+W)):
c = deepcopy(C)
... | import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
def main():
H,W,K = list(map(int, readline().split()))
C = [readline().strip() for _ in range(H)]
ans = 0
for i in range(2**H):
for j in range(2**W):
cnt = 0
... | 32 | 25 | 764 | 591 | from copy import deepcopy
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
def main():
H, W, K = list(map(int, readline().split()))
C = [list(readline().strip()) for _ in range(H)]
ans = 0
for i in range(2 ** (H + W)):
c = deepcopy(C)
for ... | import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
def main():
H, W, K = list(map(int, readline().split()))
C = [readline().strip() for _ in range(H)]
ans = 0
for i in range(2**H):
for j in range(2**W):
cnt = 0
for s in range... | false | 21.875 | [
"-from copy import deepcopy",
"- C = [list(readline().strip()) for _ in range(H)]",
"+ C = [readline().strip() for _ in range(H)]",
"- for i in range(2 ** (H + W)):",
"- c = deepcopy(C)",
"- for j in range(H + W):",
"- if (i >> j) & 1:",
"- if j < H:",
... | false | 0.04228 | 0.040235 | 1.050819 | [
"s244484277",
"s199232194"
] |
u424240341 | p02820 | python | s177119395 | s040122635 | 80 | 72 | 15,208 | 15,208 | Accepted | Accepted | 10 | n, k = tuple(map(int, input().split(' ')))
r, s, p = tuple(map(int, input().split(' ')))
t = (eval(input()))
def char2int(c):
if c == 'r':
return p
elif c == 's':
return r
else:
return s
st = {i:t[i] for i in range(k)}
ans1 = sum(map(char2int, t[:k]))
ans2 = 0
for i in r... | n, k = tuple(map(int, input().split(' ')))
r, s, p = tuple(map(int, input().split(' ')))
t = (eval(input()))
point = {'r':p, 's':r, 'p':s, 'any':0}
st = {i:t[i] for i in range(k)}
ans1 = sum([point[x] for x in t[:k]])
ans2 = 0
for i in range(k, n):
h = t[i]
m = i%k
if st[m] != h:
ans2 += ... | 22 | 16 | 475 | 401 | n, k = tuple(map(int, input().split(" ")))
r, s, p = tuple(map(int, input().split(" ")))
t = eval(input())
def char2int(c):
if c == "r":
return p
elif c == "s":
return r
else:
return s
st = {i: t[i] for i in range(k)}
ans1 = sum(map(char2int, t[:k]))
ans2 = 0
for i in range(k, n)... | n, k = tuple(map(int, input().split(" ")))
r, s, p = tuple(map(int, input().split(" ")))
t = eval(input())
point = {"r": p, "s": r, "p": s, "any": 0}
st = {i: t[i] for i in range(k)}
ans1 = sum([point[x] for x in t[:k]])
ans2 = 0
for i in range(k, n):
h = t[i]
m = i % k
if st[m] != h:
ans2 += point[... | false | 27.272727 | [
"-",
"-",
"-def char2int(c):",
"- if c == \"r\":",
"- return p",
"- elif c == \"s\":",
"- return r",
"- else:",
"- return s",
"-",
"-",
"+point = {\"r\": p, \"s\": r, \"p\": s, \"any\": 0}",
"-ans1 = sum(map(char2int, t[:k]))",
"+ans1 = sum([point[x] for x in ... | false | 0.039227 | 0.094837 | 0.41362 | [
"s177119395",
"s040122635"
] |
u077898957 | p03273 | python | s608046163 | s677531644 | 69 | 20 | 4,724 | 3,188 | Accepted | Accepted | 71.01 | h,w = map(int,input().split())
A = [list(map(str,input())) for i in range(h)]
for k in range(max(h,w)):
counter = 0
for i in range(h):
if '#' not in A[i-counter]:
del(A[i-counter:i-counter+1])
counter += 1
h -= 1
if i-counter >= h-1:
brea... | h,w=list(map(int,input().split()))
A=[eval(input()) for i in range(h)]
B=[]
for i in range(h):
if '#' in A[i]:
B.append(A[i])
def rot(X):
C=[]
for l in range(len(X[0])):
C_row=[]
for m in X:
C_row.append(m[l])
C.append(C_row)
return C
D=rot(B)
E... | 23 | 22 | 657 | 422 | h, w = map(int, input().split())
A = [list(map(str, input())) for i in range(h)]
for k in range(max(h, w)):
counter = 0
for i in range(h):
if "#" not in A[i - counter]:
del A[i - counter : i - counter + 1]
counter += 1
h -= 1
if i - counter >= h - 1:
... | h, w = list(map(int, input().split()))
A = [eval(input()) for i in range(h)]
B = []
for i in range(h):
if "#" in A[i]:
B.append(A[i])
def rot(X):
C = []
for l in range(len(X[0])):
C_row = []
for m in X:
C_row.append(m[l])
C.append(C_row)
return C
D = rot(B... | false | 4.347826 | [
"-h, w = map(int, input().split())",
"-A = [list(map(str, input())) for i in range(h)]",
"-for k in range(max(h, w)):",
"- counter = 0",
"- for i in range(h):",
"- if \"#\" not in A[i - counter]:",
"- del A[i - counter : i - counter + 1]",
"- counter += 1",
"- ... | false | 0.04441 | 0.037863 | 1.172911 | [
"s608046163",
"s677531644"
] |
u345966487 | p03229 | python | s228491888 | s535440035 | 746 | 94 | 8,120 | 13,420 | Accepted | Accepted | 87.4 | import collections
N = int(eval(input()))
A = []
for i in range(N):
A.append(int(eval(input())))
A.sort()
s = collections.deque([A[0]])
i = 1
j = N-1
while i <= j:
xl = max(abs(s[0]-A[j]), abs(s[-1]-A[j]))
xs = max(abs(s[0]-A[i]), abs(s[-1]-A[i]))
if xl > xs:
x = A[j]
j -... | import sys
sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inm = lambda: map(int, sys.stdin.readline().split())
inl = lambda: list(inm())
ins = lambda: sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))
n = ini()
a = ... | 28 | 36 | 545 | 737 | import collections
N = int(eval(input()))
A = []
for i in range(N):
A.append(int(eval(input())))
A.sort()
s = collections.deque([A[0]])
i = 1
j = N - 1
while i <= j:
xl = max(abs(s[0] - A[j]), abs(s[-1] - A[j]))
xs = max(abs(s[0] - A[i]), abs(s[-1] - A[i]))
if xl > xs:
x = A[j]
j -= 1
... | import sys
sys.setrecursionlimit(10**8)
ini = lambda: int(sys.stdin.readline())
inm = lambda: map(int, sys.stdin.readline().split())
inl = lambda: list(inm())
ins = lambda: sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))
n = ini()
a = [ini() for _ ... | false | 22.222222 | [
"-import collections",
"+import sys",
"-N = int(eval(input()))",
"-A = []",
"-for i in range(N):",
"- A.append(int(eval(input())))",
"-A.sort()",
"-s = collections.deque([A[0]])",
"-i = 1",
"-j = N - 1",
"-while i <= j:",
"- xl = max(abs(s[0] - A[j]), abs(s[-1] - A[j]))",
"- xs = ma... | false | 0.060087 | 0.038572 | 1.557765 | [
"s228491888",
"s535440035"
] |
u936985471 | p03476 | python | s762910100 | s042449060 | 1,218 | 1,073 | 5,876 | 5,876 | Accepted | Accepted | 11.9 | f=[True]*(10**5+1)
like=[False]*(10**5+1)
f[0]=False
f[1]=False
import math
for i in range(2,len(f)):
fact=True
for j in range(2,int(math.sqrt(i))+1):
if i%j==0:
fact=False
break
if fact:
f[i]=True
if i*2-1<len(like):
like[i*2-1]=True
for p in range(i*2,len(f),... | f=[True]*(10**5+1)
like=[False]*(10**5+1)
f[0]=False
f[1]=False
import math
for i in range(2,len(f)):
if not f[i]:
continue
fact=True
for j in range(2,int(math.sqrt(i))+1):
if i%j==0:
fact=False
break
if fact:
f[i]=True
if i*2-1<len(like):
like[i*2-1]=True
... | 35 | 34 | 620 | 608 | f = [True] * (10**5 + 1)
like = [False] * (10**5 + 1)
f[0] = False
f[1] = False
import math
for i in range(2, len(f)):
fact = True
for j in range(2, int(math.sqrt(i)) + 1):
if i % j == 0:
fact = False
break
if fact:
f[i] = True
if i * 2 - 1 < len(like):
... | f = [True] * (10**5 + 1)
like = [False] * (10**5 + 1)
f[0] = False
f[1] = False
import math
for i in range(2, len(f)):
if not f[i]:
continue
fact = True
for j in range(2, int(math.sqrt(i)) + 1):
if i % j == 0:
fact = False
break
if fact:
f[i] = True
... | false | 2.857143 | [
"+ if not f[i]:",
"+ continue",
"- if l > 0:",
"- print((sums[r] - sums[l - 1]))",
"- else:",
"- print((sums[r]))",
"+ print((sums[r] - sums[l - 1]))"
] | false | 0.478578 | 1.045713 | 0.457657 | [
"s762910100",
"s042449060"
] |
u227438830 | p02411 | python | s723782630 | s279501388 | 30 | 20 | 7,680 | 7,668 | Accepted | Accepted | 33.33 | while True:
m,f,r = list(map(int, input().split()))
if m == -1 and f == -1 and r == -1:
break
else:
if m == -1 or f == -1:
print("F")
elif m + f >= 80:
print("A")
elif m + f < 80 and m + f >= 65:
print("B")
elif m + f < 6... | while True:
m,f,r = list(map(int, input().split()))
if m == -1 and f == -1 and r == -1:
break
else:
if m == -1 or f == -1:
print("F")
elif m + f >= 80:
print("A")
elif m + f >= 65:
print("B")
elif m + f >= 50:
... | 19 | 19 | 523 | 480 | while True:
m, f, r = list(map(int, input().split()))
if m == -1 and f == -1 and r == -1:
break
else:
if m == -1 or f == -1:
print("F")
elif m + f >= 80:
print("A")
elif m + f < 80 and m + f >= 65:
print("B")
elif m + f < 65 and m +... | while True:
m, f, r = list(map(int, input().split()))
if m == -1 and f == -1 and r == -1:
break
else:
if m == -1 or f == -1:
print("F")
elif m + f >= 80:
print("A")
elif m + f >= 65:
print("B")
elif m + f >= 50:
print("C... | false | 0 | [
"- elif m + f < 80 and m + f >= 65:",
"+ elif m + f >= 65:",
"- elif m + f < 65 and m + f >= 50:",
"+ elif m + f >= 50:",
"- elif m + f < 50 and m + f >= 30 and r >= 50:",
"+ elif m + f >= 30 and r >= 50:"
] | false | 0.044391 | 0.141946 | 0.31273 | [
"s723782630",
"s279501388"
] |
u196746947 | p02762 | python | s044698466 | s285237366 | 1,988 | 1,693 | 49,084 | 49,072 | Accepted | Accepted | 14.84 | class UnionFind():
def __init__(self, n):
self.n = n
self.parents = [-1] * n
def find(self, x):
if self.parents[x] < 0:
return x
else:
self.parents[x] = self.find(self.parents[x])
return self.parents[x]
def union(self, x, y):
... | class UnionFind():
def __init__(self, n):
self.n = n
self.parents = [-1] * n
def find(self, x):
if self.parents[x] < 0:
return x
else:
self.parents[x] = self.find(self.parents[x])
return self.parents[x]
def union(self, x, y):
... | 75 | 77 | 1,744 | 1,901 | class UnionFind:
def __init__(self, n):
self.n = n
self.parents = [-1] * n
def find(self, x):
if self.parents[x] < 0:
return x
else:
self.parents[x] = self.find(self.parents[x])
return self.parents[x]
def union(self, x, y):
x = se... | class UnionFind:
def __init__(self, n):
self.n = n
self.parents = [-1] * n
def find(self, x):
if self.parents[x] < 0:
return x
else:
self.parents[x] = self.find(self.parents[x])
return self.parents[x]
def union(self, x, y):
x = se... | false | 2.597403 | [
"-n, m, k = list(map(int, input().split()))",
"-uf = UnionFind(n)",
"-block = {}",
"-for i in range(n):",
"- block[i] = [i]",
"-for i in range(m):",
"- a, b = list(map(int, input().split()))",
"- uf.union(a - 1, b - 1)",
"- block[a - 1].append(b - 1)",
"- block[b - 1].append(a - 1)"... | false | 0.037002 | 0.036824 | 1.004849 | [
"s044698466",
"s285237366"
] |
u102461423 | p03030 | python | s086408520 | s850237748 | 21 | 17 | 3,060 | 3,064 | Accepted | Accepted | 19.05 | N = int(eval(input()))
SP = []
for i in range(N):
s,p = input().split()
SP.append((s,-int(p),i+1))
SP.sort()
for s,p,i in SP:
print(i) | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N = int(readline())
SP = [(x.split()[0].decode('utf-8'),int(x.split()[1])) for x in readlines()]
SP = sorted((name,-pt,i+1) for i,(name,pt) in enumerate(SP))
answer = '\n'.join(str(x[2]) for ... | 11 | 12 | 149 | 343 | N = int(eval(input()))
SP = []
for i in range(N):
s, p = input().split()
SP.append((s, -int(p), i + 1))
SP.sort()
for s, p, i in SP:
print(i)
| import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N = int(readline())
SP = [(x.split()[0].decode("utf-8"), int(x.split()[1])) for x in readlines()]
SP = sorted((name, -pt, i + 1) for i, (name, pt) in enumerate(SP))
answer = "\n".join(str(x[2]) for x in ... | false | 8.333333 | [
"-N = int(eval(input()))",
"-SP = []",
"-for i in range(N):",
"- s, p = input().split()",
"- SP.append((s, -int(p), i + 1))",
"-SP.sort()",
"-for s, p, i in SP:",
"- print(i)",
"+import sys",
"+",
"+read = sys.stdin.buffer.read",
"+readline = sys.stdin.buffer.readline",
"+readlines ... | false | 0.049642 | 0.038227 | 1.298606 | [
"s086408520",
"s850237748"
] |
u305366205 | p03592 | python | s324693022 | s954821204 | 341 | 305 | 2,940 | 2,940 | Accepted | Accepted | 10.56 | n, m, k = list(map(int, input().split()))
for i in range(n + 1):
for j in range(m + 1):
if m * i + n * j - i * j * 2 == k:
print('Yes')
exit()
print('No')
| n, m, k = list(map(int, input().split()))
for i in range(n + 1):
for j in range(m + 1):
if i * (m - j) + j * (n - i) == k:
print('Yes')
exit()
print('No')
| 7 | 7 | 191 | 191 | n, m, k = list(map(int, input().split()))
for i in range(n + 1):
for j in range(m + 1):
if m * i + n * j - i * j * 2 == k:
print("Yes")
exit()
print("No")
| n, m, k = list(map(int, input().split()))
for i in range(n + 1):
for j in range(m + 1):
if i * (m - j) + j * (n - i) == k:
print("Yes")
exit()
print("No")
| false | 0 | [
"- if m * i + n * j - i * j * 2 == k:",
"+ if i * (m - j) + j * (n - i) == k:"
] | false | 0.041997 | 0.04592 | 0.914559 | [
"s324693022",
"s954821204"
] |
u017415492 | p02959 | python | s807016813 | s237217443 | 160 | 146 | 18,752 | 18,624 | Accepted | Accepted | 8.75 | n=int(eval(input()))
a=list(map(int,input().split()))
b=list(map(int,input().split()))
count=0
for i in range(n):
if b[i]-a[i]>0:
count+=a[i]
if a[i+1]>(b[i]-a[i]):
a[i+1]-=(b[i]-a[i])
count+=(b[i]-a[i])
elif a[i+1]<=b[i]-a[i]:
count+=a[i+1]
a[i+1]=0
elif b[i]<=a[i]:... | n=int(eval(input()))
a=list(map(int,input().split()))
b=list(map(int,input().split()))
ans=0
for i in range(n):
if b[i]<=a[i]:
ans+=b[i]
else:
if b[i]<=a[i]+a[i+1]:
ans+=b[i]
a[i+1]-=(b[i]-a[i])
if a[i+1]<0:
a[i+1]=0
else:
if b[i]>a[i]+a[i+1]:
ans+=... | 16 | 18 | 348 | 355 | n = int(eval(input()))
a = list(map(int, input().split()))
b = list(map(int, input().split()))
count = 0
for i in range(n):
if b[i] - a[i] > 0:
count += a[i]
if a[i + 1] > (b[i] - a[i]):
a[i + 1] -= b[i] - a[i]
count += b[i] - a[i]
elif a[i + 1] <= b[i] - a[i]:
... | n = int(eval(input()))
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = 0
for i in range(n):
if b[i] <= a[i]:
ans += b[i]
else:
if b[i] <= a[i] + a[i + 1]:
ans += b[i]
a[i + 1] -= b[i] - a[i]
if a[i + 1] < 0:
a[i + ... | false | 11.111111 | [
"-count = 0",
"+ans = 0",
"- if b[i] - a[i] > 0:",
"- count += a[i]",
"- if a[i + 1] > (b[i] - a[i]):",
"+ if b[i] <= a[i]:",
"+ ans += b[i]",
"+ else:",
"+ if b[i] <= a[i] + a[i + 1]:",
"+ ans += b[i]",
"- count += b[i] - a[i]",
"- ... | false | 0.147656 | 0.039974 | 3.693812 | [
"s807016813",
"s237217443"
] |
u905203728 | p02757 | python | s146641748 | s803844479 | 222 | 95 | 50,132 | 83,396 | Accepted | Accepted | 57.21 | from collections import Counter
n,p=list(map(int,input().split()))
s=eval(input())
DP=[0]
ans=0
if p==2 or p==5:
for i,j in enumerate(s):
if int(j)%p==0:
ans +=i+1
else:
num,point=0,1
for i in s[::-1]:
num +=int(i)*point
num %=p
DP.append(num)
... | from collections import Counter
n,p=list(map(int,input().split()))
s=eval(input())
ans=0
if p==2 or p==5:
for i,j in enumerate(s):
if int(j)%p==0:
ans +=i+1
else:
num,point=0,1
A=[0]
for i in s[::-1]:
num +=int(i)*point
num %=p
A.append(num)
... | 23 | 23 | 438 | 437 | from collections import Counter
n, p = list(map(int, input().split()))
s = eval(input())
DP = [0]
ans = 0
if p == 2 or p == 5:
for i, j in enumerate(s):
if int(j) % p == 0:
ans += i + 1
else:
num, point = 0, 1
for i in s[::-1]:
num += int(i) * point
num %= p
DP.a... | from collections import Counter
n, p = list(map(int, input().split()))
s = eval(input())
ans = 0
if p == 2 or p == 5:
for i, j in enumerate(s):
if int(j) % p == 0:
ans += i + 1
else:
num, point = 0, 1
A = [0]
for i in s[::-1]:
num += int(i) * point
num %= p
A... | false | 0 | [
"-DP = [0]",
"+ A = [0]",
"- DP.append(num)",
"+ A.append(num)",
"- DP = Counter(DP)",
"- for v, m in list(DP.items()):",
"- if m >= 2:",
"- ans += m * (m - 1) // 2",
"+ A = Counter(A)",
"+ for i, j in list(A.items()):",
"+ if j >= 2:",
"+ ... | false | 0.034751 | 0.078392 | 0.443296 | [
"s146641748",
"s803844479"
] |
u497952650 | p02787 | python | s563159874 | s500576638 | 1,652 | 442 | 3,668 | 12,508 | Accepted | Accepted | 73.24 | H,N = list(map(int,input().split()))
AB = [list(map(int, input().split())) for i in range(N)]
M = max(a for a,b in AB)
dp = [0]*(H+M)
for i in range(1,H+M):
dp[i] = min(dp[i-a]+b for a,b in AB)
print((min(dp[H:]))) | import numpy as np
H,N = list(map(int,input().split()))
A = []
B = []
for i in range(N):
a,b = list(map(int,input().split()))
A.append(a)
B.append(b)
A = np.array(A)
B = np.array(B)
dp = np.zeros(H+1,dtype=np.int32)
for i in range(1,H+1):
dp[i] = np.amin(dp[np.maximum(i-A,0)]+B)... | 11 | 21 | 228 | 328 | H, N = list(map(int, input().split()))
AB = [list(map(int, input().split())) for i in range(N)]
M = max(a for a, b in AB)
dp = [0] * (H + M)
for i in range(1, H + M):
dp[i] = min(dp[i - a] + b for a, b in AB)
print((min(dp[H:])))
| import numpy as np
H, N = list(map(int, input().split()))
A = []
B = []
for i in range(N):
a, b = list(map(int, input().split()))
A.append(a)
B.append(b)
A = np.array(A)
B = np.array(B)
dp = np.zeros(H + 1, dtype=np.int32)
for i in range(1, H + 1):
dp[i] = np.amin(dp[np.maximum(i - A, 0)] + B)
print((d... | false | 47.619048 | [
"+import numpy as np",
"+",
"-AB = [list(map(int, input().split())) for i in range(N)]",
"-M = max(a for a, b in AB)",
"-dp = [0] * (H + M)",
"-for i in range(1, H + M):",
"- dp[i] = min(dp[i - a] + b for a, b in AB)",
"-print((min(dp[H:])))",
"+A = []",
"+B = []",
"+for i in range(N):",
"+... | false | 0.071146 | 0.336895 | 0.21118 | [
"s563159874",
"s500576638"
] |
u806976856 | p02642 | python | s745782790 | s735835045 | 174 | 158 | 134,840 | 116,628 | Accepted | Accepted | 9.2 | n=int(eval(input()))
a=list(map(int,input().split()))
a=sorted(a)
b=list(set(a))
m=len(b)
p=[0]*(10**6+1)
for i in b:
if p[i]==0:
j=2
while i*j<=10**6:
p[i*j]=1
j+=1
a.append(-1)
a.insert(0,-1)
ans=0
for i in range(1,n+1):
if a[i]!=a[i+1] and a[i]!=a[i-1... | n=int(eval(input()))
a=list(map(int,input().split()))
x=[0]*(10**6+1)
for i in a:
x[i]+=1
for i in range(10**6+1):
if x[i]>=1:
j=2
while i*j<=10**6:
x[i*j]=0
j+=1
print((x.count(1)))
| 20 | 15 | 360 | 240 | n = int(eval(input()))
a = list(map(int, input().split()))
a = sorted(a)
b = list(set(a))
m = len(b)
p = [0] * (10**6 + 1)
for i in b:
if p[i] == 0:
j = 2
while i * j <= 10**6:
p[i * j] = 1
j += 1
a.append(-1)
a.insert(0, -1)
ans = 0
for i in range(1, n + 1):
if a[i] != a... | n = int(eval(input()))
a = list(map(int, input().split()))
x = [0] * (10**6 + 1)
for i in a:
x[i] += 1
for i in range(10**6 + 1):
if x[i] >= 1:
j = 2
while i * j <= 10**6:
x[i * j] = 0
j += 1
print((x.count(1)))
| false | 25 | [
"-a = sorted(a)",
"-b = list(set(a))",
"-m = len(b)",
"-p = [0] * (10**6 + 1)",
"-for i in b:",
"- if p[i] == 0:",
"+x = [0] * (10**6 + 1)",
"+for i in a:",
"+ x[i] += 1",
"+for i in range(10**6 + 1):",
"+ if x[i] >= 1:",
"- p[i * j] = 1",
"+ x[i * j] = 0",
"... | false | 0.6035 | 0.673467 | 0.89611 | [
"s745782790",
"s735835045"
] |
u254871849 | p03087 | python | s997972431 | s169707797 | 175 | 150 | 30,048 | 23,776 | Accepted | Accepted | 14.29 | import sys
def main():
n, q = list(map(int, sys.stdin.readline().split()))
s = sys.stdin.readline().rstrip()
lr = list(map(int, sys.stdin.read().split()))
lr = list(zip(lr, lr))
cumsum = [None] * (n + 1)
cumsum[0] = 0
flag = False
for i in range(n):
t = s[i]
... | import sys
n, q = map(int, sys.stdin.readline().split())
s = '$' + sys.stdin.readline().rstrip()
lr = zip(*[map(int, sys.stdin.read().split())] * 2)
def main():
res = [None] * (n + 1); res[0] = 0
prev = '$'
for i in range(1, n+1):
res[i] = res[i-1]
res[i] += (prev == 'A' and s[i... | 29 | 20 | 687 | 487 | import sys
def main():
n, q = list(map(int, sys.stdin.readline().split()))
s = sys.stdin.readline().rstrip()
lr = list(map(int, sys.stdin.read().split()))
lr = list(zip(lr, lr))
cumsum = [None] * (n + 1)
cumsum[0] = 0
flag = False
for i in range(n):
t = s[i]
if t == "A"... | import sys
n, q = map(int, sys.stdin.readline().split())
s = "$" + sys.stdin.readline().rstrip()
lr = zip(*[map(int, sys.stdin.read().split())] * 2)
def main():
res = [None] * (n + 1)
res[0] = 0
prev = "$"
for i in range(1, n + 1):
res[i] = res[i - 1]
res[i] += (prev == "A" and s[i] =... | false | 31.034483 | [
"+",
"+n, q = map(int, sys.stdin.readline().split())",
"+s = \"$\" + sys.stdin.readline().rstrip()",
"+lr = zip(*[map(int, sys.stdin.read().split())] * 2)",
"- n, q = list(map(int, sys.stdin.readline().split()))",
"- s = sys.stdin.readline().rstrip()",
"- lr = list(map(int, sys.stdin.read().spl... | false | 0.035339 | 0.035875 | 0.985048 | [
"s997972431",
"s169707797"
] |
u634046173 | p03486 | python | s659454334 | s747142005 | 65 | 57 | 61,800 | 61,912 | Accepted | Accepted | 12.31 | s = eval(input())
t = eval(input())
anas = sorted(s)
at = sorted(t,reverse = True)
miji = min(len(s),len(t))
for i in range(miji):
if ord(anas[i]) < ord(at[i]):
print('Yes')
exit()
elif ord(anas[i]) > ord(at[i]):
print('No')
exit()
if len(s) < len(t):
print('... | s = eval(input())
t = eval(input())
anas = sorted(s)
at = sorted(t,reverse = True)
if anas < at:
print('Yes')
else:
print('No')
| 20 | 9 | 342 | 133 | s = eval(input())
t = eval(input())
anas = sorted(s)
at = sorted(t, reverse=True)
miji = min(len(s), len(t))
for i in range(miji):
if ord(anas[i]) < ord(at[i]):
print("Yes")
exit()
elif ord(anas[i]) > ord(at[i]):
print("No")
exit()
if len(s) < len(t):
print("Yes")
else:
p... | s = eval(input())
t = eval(input())
anas = sorted(s)
at = sorted(t, reverse=True)
if anas < at:
print("Yes")
else:
print("No")
| false | 55 | [
"-miji = min(len(s), len(t))",
"-for i in range(miji):",
"- if ord(anas[i]) < ord(at[i]):",
"- print(\"Yes\")",
"- exit()",
"- elif ord(anas[i]) > ord(at[i]):",
"- print(\"No\")",
"- exit()",
"-if len(s) < len(t):",
"+if anas < at:"
] | false | 0.042969 | 0.039587 | 1.085441 | [
"s659454334",
"s747142005"
] |
u627803856 | p03212 | python | s837129939 | s046639307 | 287 | 250 | 52,060 | 45,424 | Accepted | Accepted | 12.89 | n = int(eval(input()))
def dfs(val, A):
if val > n:
return
A.append(val)
for v in [3, 5, 7]:
dfs(10 * val + v, A)
A = []
for v in [3, 5, 7]:
dfs(v, A)
cnt = 0
for v in A:
if '3' in str(v) and '5' in str(v) and '7' in str(v):
cnt += 1
print(cnt) | from itertools import product
from bisect import bisect_left, bisect_right
n = int(eval(input()))
s = []
for i in range(3, 10):
for v in product('753', repeat=i):
if len(set(v)) >= 3:
s.append(int(''.join(v)))
s.sort()
idx = bisect_right(s, n)
print((len(s[:idx]))) | 22 | 14 | 277 | 297 | n = int(eval(input()))
def dfs(val, A):
if val > n:
return
A.append(val)
for v in [3, 5, 7]:
dfs(10 * val + v, A)
A = []
for v in [3, 5, 7]:
dfs(v, A)
cnt = 0
for v in A:
if "3" in str(v) and "5" in str(v) and "7" in str(v):
cnt += 1
print(cnt)
| from itertools import product
from bisect import bisect_left, bisect_right
n = int(eval(input()))
s = []
for i in range(3, 10):
for v in product("753", repeat=i):
if len(set(v)) >= 3:
s.append(int("".join(v)))
s.sort()
idx = bisect_right(s, n)
print((len(s[:idx])))
| false | 36.363636 | [
"+from itertools import product",
"+from bisect import bisect_left, bisect_right",
"+",
"-",
"-",
"-def dfs(val, A):",
"- if val > n:",
"- return",
"- A.append(val)",
"- for v in [3, 5, 7]:",
"- dfs(10 * val + v, A)",
"-",
"-",
"-A = []",
"-for v in [3, 5, 7]:",
... | false | 0.059288 | 0.086169 | 0.68804 | [
"s837129939",
"s046639307"
] |
u122111917 | p02657 | python | s575919970 | s592456587 | 30 | 25 | 9,052 | 9,144 | Accepted | Accepted | 16.67 | # 169a
# A×Bを整数として出力せよ。
# 1. 入力をプログラムで扱えるように受け取ること
a, b = list(map(int, input().split()))
# print(a, b)
# 2. 受け取った入力値を使って、適切に処理(計算)すること
answer = a * b
# 3. 計算した結果を出力すること
print(answer) | A, B = list(map(int, input().split()))
answer = A * B
print(answer) | 14 | 5 | 195 | 67 | # 169a
# A×Bを整数として出力せよ。
# 1. 入力をプログラムで扱えるように受け取ること
a, b = list(map(int, input().split()))
# print(a, b)
# 2. 受け取った入力値を使って、適切に処理(計算)すること
answer = a * b
# 3. 計算した結果を出力すること
print(answer)
| A, B = list(map(int, input().split()))
answer = A * B
print(answer)
| false | 64.285714 | [
"-# 169a",
"-# A×Bを整数として出力せよ。",
"-# 1. 入力をプログラムで扱えるように受け取ること",
"-a, b = list(map(int, input().split()))",
"-# print(a, b)",
"-# 2. 受け取った入力値を使って、適切に処理(計算)すること",
"-answer = a * b",
"-# 3. 計算した結果を出力すること",
"+A, B = list(map(int, input().split()))",
"+answer = A * B"
] | false | 0.057865 | 0.050744 | 1.140327 | [
"s575919970",
"s592456587"
] |
u079022693 | p03038 | python | s016701838 | s204226356 | 544 | 499 | 33,128 | 32,960 | Accepted | Accepted | 8.27 | import heapq
def main():
N,M=list(map(int,input().split()))
A=list(map(int,input().split()))
heapq.heapify(A)
BC=[]
for i in range(M):
bc=list(map(int,input().split()))
BC.append(bc)
BC.sort(reverse=True,key=lambda x:x[1])
new_BC=[]
count=0
for i in rang... | def main():
N,M=list(map(int,input().split()))
A=list(map(int,input().split()))
A.sort()
BC=[]
for i in range(M):
bc=list(map(int,input().split()))
BC.append(bc)
BC.sort(reverse=True,key=lambda x:x[1])
new_BC=[]
count=0
for i in range(M):
for j i... | 36 | 30 | 820 | 670 | import heapq
def main():
N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
heapq.heapify(A)
BC = []
for i in range(M):
bc = list(map(int, input().split()))
BC.append(bc)
BC.sort(reverse=True, key=lambda x: x[1])
new_BC = []
count = 0
for i i... | def main():
N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
A.sort()
BC = []
for i in range(M):
bc = list(map(int, input().split()))
BC.append(bc)
BC.sort(reverse=True, key=lambda x: x[1])
new_BC = []
count = 0
for i in range(M):
for... | false | 16.666667 | [
"-import heapq",
"-",
"-",
"- heapq.heapify(A)",
"+ A.sort()",
"- flag = False",
"- a = heapq.heappop(A)",
"- if a < new_BC[i]:",
"- heapq.heappush(A, new_BC[i])",
"+ if A[i] < new_BC[i]:",
"+ A[i] = new_BC[i]",
"- heapq.heappush(A... | false | 0.099887 | 0.048384 | 2.064472 | [
"s016701838",
"s204226356"
] |
u497326082 | p03494 | python | s312257829 | s998501205 | 22 | 20 | 3,064 | 3,064 | Accepted | Accepted | 9.09 | N = int(eval(input()))
i = 0
cou = 0
flag = 0
list1 = list(map(int,input().split()))
while True:
for i in range(0,N):
if int(list1[i]) % 2 == 0:
flag += 1
if flag == N:
cou += 1
list1 = list([int(num/2) for num in list1])
flag = 0
else:
break
print(cou) | n=int(eval(input()))
p=list(map(int,input().split()))
p_=[]
b=False
c=0
while b==False:
p_=list([in_%2 for in_ in p])
b = 1 in p_
p=list([int(in_/2) for in_ in p])
c+=1
print((c-1)) | 16 | 11 | 284 | 197 | N = int(eval(input()))
i = 0
cou = 0
flag = 0
list1 = list(map(int, input().split()))
while True:
for i in range(0, N):
if int(list1[i]) % 2 == 0:
flag += 1
if flag == N:
cou += 1
list1 = list([int(num / 2) for num in list1])
flag = 0
else:
break
print(cou... | n = int(eval(input()))
p = list(map(int, input().split()))
p_ = []
b = False
c = 0
while b == False:
p_ = list([in_ % 2 for in_ in p])
b = 1 in p_
p = list([int(in_ / 2) for in_ in p])
c += 1
print((c - 1))
| false | 31.25 | [
"-N = int(eval(input()))",
"-i = 0",
"-cou = 0",
"-flag = 0",
"-list1 = list(map(int, input().split()))",
"-while True:",
"- for i in range(0, N):",
"- if int(list1[i]) % 2 == 0:",
"- flag += 1",
"- if flag == N:",
"- cou += 1",
"- list1 = list([int(num / ... | false | 0.035531 | 0.054927 | 0.646875 | [
"s312257829",
"s998501205"
] |
u197300773 | p03546 | python | s383587348 | s902979604 | 39 | 33 | 3,444 | 3,064 | Accepted | Accepted | 15.38 | H,W=list(map(int,input().split()))
c=[list(map(int,input().split())) for i in range(10)]
a=[list(map(int,input().split())) for i in range(H)]
INF=10**10
tmp=[[INF]*10 for i in range(10)]
for k in range(10):
for i in range(10):
for j in range(10):
tmp[i][j]=min(c[i][k]+c[k][j] for k in ... | H,W=list(map(int,input().split()))
c=[list(map(int,input().split())) for i in range(10)]
INF=10**10
tmp=[[INF]*10 for i in range(10)]
for k in range(9):
for i in range(10):
for j in range(10):
tmp[i][j]=min(c[i][k]+c[k][j] for k in range(10))
c[i][j]=min(tmp[i][j],c[i][j])
... | 17 | 21 | 477 | 511 | H, W = list(map(int, input().split()))
c = [list(map(int, input().split())) for i in range(10)]
a = [list(map(int, input().split())) for i in range(H)]
INF = 10**10
tmp = [[INF] * 10 for i in range(10)]
for k in range(10):
for i in range(10):
for j in range(10):
tmp[i][j] = min(c[i][k] + c[k][j]... | H, W = list(map(int, input().split()))
c = [list(map(int, input().split())) for i in range(10)]
INF = 10**10
tmp = [[INF] * 10 for i in range(10)]
for k in range(9):
for i in range(10):
for j in range(10):
tmp[i][j] = min(c[i][k] + c[k][j] for k in range(10))
c[i][j] = min(tmp[i][j],... | false | 19.047619 | [
"-a = [list(map(int, input().split())) for i in range(H)]",
"-for k in range(10):",
"+for k in range(9):",
"+count = [0] * 10",
"+for i in range(H):",
"+ l = list(map(int, input().split()))",
"+ for j in range(10):",
"+ count[j] += l.count(j)",
"-for i in range(H):",
"- for j in ra... | false | 0.13125 | 0.171921 | 0.763432 | [
"s383587348",
"s902979604"
] |
u455809703 | p02837 | python | s932492964 | s014289984 | 220 | 117 | 3,064 | 3,064 | Accepted | Accepted | 46.82 | N = int(eval(input()))
xy = []
for i in range(N):
A = int(eval(input()))
xy.append([])
for j in range(A):
xy[i].append(tuple(map(int, input().split())))
ans = 0
for i in range(2 ** N):
h = [0] * N
for j in range(N):
if (i >> j) & 1:
h[j] = 1
... | import itertools
N = int(eval(input()))
evidence_dit = {}
for i in range(N):
A = int(eval(input()))
x_y = []
if A == 0:
evidence_dit[i] = []
for j in range(A):
x_y.append(list(map(int,input().split())))
evidence_dit[i] = x_y
attribute = [0,1]
ans... | 31 | 41 | 610 | 766 | N = int(eval(input()))
xy = []
for i in range(N):
A = int(eval(input()))
xy.append([])
for j in range(A):
xy[i].append(tuple(map(int, input().split())))
ans = 0
for i in range(2**N):
h = [0] * N
for j in range(N):
if (i >> j) & 1:
h[j] = 1
flag = False
for i in ra... | import itertools
N = int(eval(input()))
evidence_dit = {}
for i in range(N):
A = int(eval(input()))
x_y = []
if A == 0:
evidence_dit[i] = []
for j in range(A):
x_y.append(list(map(int, input().split())))
evidence_dit[i] = x_y
attribute = [0, 1]
ans = 0
for i in itertools.product... | false | 24.390244 | [
"+import itertools",
"+",
"-xy = []",
"+evidence_dit = {}",
"- xy.append([])",
"+ x_y = []",
"+ if A == 0:",
"+ evidence_dit[i] = []",
"- xy[i].append(tuple(map(int, input().split())))",
"+ x_y.append(list(map(int, input().split())))",
"+ evidence_dit[i] = x_... | false | 0.040263 | 0.048724 | 0.82634 | [
"s932492964",
"s014289984"
] |
u467422569 | p02255 | python | s944601907 | s147097399 | 30 | 20 | 5,980 | 5,980 | Accepted | Accepted | 33.33 | def trace(A,input_num):
for i in range(input_num):
if i != input_num - 1:
print(A[i],end = " ")
else:
print(A[i])
def insertionSort(A,input_num):
for i in range(input_num):
v = A[i]
j = i - 1
while(j >= 0 and A[j] > v):
A[j... | def insertionSort(A,input_num):
for i in range(input_num):
v = A[i]
j = i - 1
while(j >= 0 and A[j] > v):
A[j + 1] = A[j]
j -= 1
A[j + 1] = v
print((*A))
input_num = int(eval(input()))
A = list(map(int, input().split()))
insertio... | 21 | 14 | 506 | 331 | def trace(A, input_num):
for i in range(input_num):
if i != input_num - 1:
print(A[i], end=" ")
else:
print(A[i])
def insertionSort(A, input_num):
for i in range(input_num):
v = A[i]
j = i - 1
while j >= 0 and A[j] > v:
A[j + 1] = A[j... | def insertionSort(A, input_num):
for i in range(input_num):
v = A[i]
j = i - 1
while j >= 0 and A[j] > v:
A[j + 1] = A[j]
j -= 1
A[j + 1] = v
print((*A))
input_num = int(eval(input()))
A = list(map(int, input().split()))
insertionSort(A, input_num)
| false | 33.333333 | [
"-def trace(A, input_num):",
"- for i in range(input_num):",
"- if i != input_num - 1:",
"- print(A[i], end=\" \")",
"- else:",
"- print(A[i])",
"-",
"-",
"- trace(A, input_num)",
"+ print((*A))",
"-input_num = int(input())",
"+input_num = i... | false | 0.054583 | 0.070298 | 0.776447 | [
"s944601907",
"s147097399"
] |
u172773620 | p03698 | python | s021050565 | s867269844 | 19 | 17 | 2,940 | 2,940 | Accepted | Accepted | 10.53 | a = list(input());b = set(a);print("yes") if(len(a)==len(b)) else print("no")
| a = list(eval(input()));print(("yes" if(len(a)==len(set(a))) else "no"))
| 1 | 1 | 77 | 65 | a = list(input())
b = set(a)
print("yes") if (len(a) == len(b)) else print("no")
| a = list(eval(input()))
print(("yes" if (len(a) == len(set(a))) else "no"))
| false | 0 | [
"-a = list(input())",
"-b = set(a)",
"-print(\"yes\") if (len(a) == len(b)) else print(\"no\")",
"+a = list(eval(input()))",
"+print((\"yes\" if (len(a) == len(set(a))) else \"no\"))"
] | false | 0.07242 | 0.076144 | 0.951096 | [
"s021050565",
"s867269844"
] |
u102461423 | p03173 | python | s200643854 | s592439809 | 1,394 | 213 | 16,928 | 16,660 | Accepted | Accepted | 84.72 | import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
import numpy as np
"""
最後の2つを決める:[0,x) [x,N)
小問題2つに分割できる。
全ての連続区間を計算すればよい
"""
N = int(eval(input()))
A = np.array(input().split(), np.int64)
# Acum[L,R] = A[L:R].sum()
Acum = np.zeros((N,N+1), dtype=np.int64)
for L in range(N):
... | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
import numpy as np
N = int(readline())
A = np.array(read().split(),np.int64)
INF = 10**18
# 左端ごとに、個数 -> 大きさ
size = np.full((N,N),INF,np.int64)
for n in range(N):
size[n,:N-n] = A[n:... | 28 | 28 | 568 | 580 | import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
import numpy as np
"""
最後の2つを決める:[0,x) [x,N)
小問題2つに分割できる。
全ての連続区間を計算すればよい
"""
N = int(eval(input()))
A = np.array(input().split(), np.int64)
# Acum[L,R] = A[L:R].sum()
Acum = np.zeros((N, N + 1), dtype=np.int64)
for L in range(N):
Acum[L, L + 1 :]... | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
import numpy as np
N = int(readline())
A = np.array(read().split(), np.int64)
INF = 10**18
# 左端ごとに、個数 -> 大きさ
size = np.full((N, N), INF, np.int64)
for n in range(N):
size[n, : N - n] = A[n:].cumsum(... | false | 0 | [
"-input = sys.stdin.readline",
"-sys.setrecursionlimit(10**7)",
"+read = sys.stdin.buffer.read",
"+readline = sys.stdin.buffer.readline",
"+readlines = sys.stdin.buffer.readlines",
"-\"\"\"",
"-最後の2つを決める:[0,x) [x,N)",
"-小問題2つに分割できる。",
"-全ての連続区間を計算すればよい",
"-\"\"\"",
"-N = int(eval(input()))",
"... | false | 0.627264 | 0.287293 | 2.183356 | [
"s200643854",
"s592439809"
] |
u441599836 | p02983 | python | s746424920 | s348500834 | 810 | 666 | 3,060 | 3,060 | Accepted | Accepted | 17.78 | l, r = list(map(int, input().split()))
n = r-l+1
if n >= 2019:
print((0))
else:
x = l % 2019
if x > r%2019:
print((0))
else:
ans = 2018
for i in range(l,r):
for j in range(i+1,r+1):
ans = min(ans,(j*i)%2019)
print(ans) | l, r = list(map(int, input().split()))
n = r-l+1
l = l%2019
r = r%2019
if n >= 2019:
print((0))
else:
if l > r:
print((0))
else:
ans = 2018
for i in range(l,r):
for j in range(i+1,r+1):
ans = min(ans,(j*i)%2019)
print(ans) | 14 | 15 | 297 | 298 | l, r = list(map(int, input().split()))
n = r - l + 1
if n >= 2019:
print((0))
else:
x = l % 2019
if x > r % 2019:
print((0))
else:
ans = 2018
for i in range(l, r):
for j in range(i + 1, r + 1):
ans = min(ans, (j * i) % 2019)
print(ans)
| l, r = list(map(int, input().split()))
n = r - l + 1
l = l % 2019
r = r % 2019
if n >= 2019:
print((0))
else:
if l > r:
print((0))
else:
ans = 2018
for i in range(l, r):
for j in range(i + 1, r + 1):
ans = min(ans, (j * i) % 2019)
print(ans)
| false | 6.666667 | [
"+l = l % 2019",
"+r = r % 2019",
"- x = l % 2019",
"- if x > r % 2019:",
"+ if l > r:"
] | false | 0.117375 | 0.035201 | 3.334432 | [
"s746424920",
"s348500834"
] |
u533039576 | p02901 | python | s375832531 | s824482656 | 1,400 | 1,047 | 3,316 | 3,188 | Accepted | Accepted | 25.21 | import sys
input = sys.stdin.readline
n, m = list(map(int, input().split()))
dp = [float("inf")] * ((1<<n) + 1)
dp[0] = 0
for i in range(m):
a, b = list(map(int, input().split()))
c = sum(1<<(ci-1) for ci in map(int, input().split()))
for j in range(1<<n):
if dp[j] + a < dp[j | c]:
... | import sys
input = sys.stdin.readline
n, m = list(map(int, input().split()))
# INF = float("inf")
INF = 10 ** 8
dp = [INF] * ((1<<n) + 1)
dp[0] = 0
for i in range(m):
a, b = list(map(int, input().split()))
c = sum(1<<(ci-1) for ci in map(int, input().split()))
for j in range(1<<n):
... | 24 | 26 | 493 | 512 | import sys
input = sys.stdin.readline
n, m = list(map(int, input().split()))
dp = [float("inf")] * ((1 << n) + 1)
dp[0] = 0
for i in range(m):
a, b = list(map(int, input().split()))
c = sum(1 << (ci - 1) for ci in map(int, input().split()))
for j in range(1 << n):
if dp[j] + a < dp[j | c]:
... | import sys
input = sys.stdin.readline
n, m = list(map(int, input().split()))
# INF = float("inf")
INF = 10**8
dp = [INF] * ((1 << n) + 1)
dp[0] = 0
for i in range(m):
a, b = list(map(int, input().split()))
c = sum(1 << (ci - 1) for ci in map(int, input().split()))
for j in range(1 << n):
if dp[j] +... | false | 7.692308 | [
"-dp = [float(\"inf\")] * ((1 << n) + 1)",
"+# INF = float(\"inf\")",
"+INF = 10**8",
"+dp = [INF] * ((1 << n) + 1)",
"-if dp[(1 << n) - 1] == float(\"inf\"):",
"+if dp[(1 << n) - 1] == INF:"
] | false | 0.12008 | 0.041133 | 2.919281 | [
"s375832531",
"s824482656"
] |
u681444474 | p02627 | python | s151248829 | s708372178 | 30 | 27 | 9,088 | 9,024 | Accepted | Accepted | 10 | #coding: utf-8
alp = [chr(i) for i in range(97, 97+26)]
a = eval(input())
if a in alp:
print('a')
else:
print('A') | # coding: utf-8
# Your code here!
c= eval(input())
a= ord('a')
alp = [chr(i) for i in range(a,a+26)]
#print(alp)
if c in alp:
print('a')
else:
print('A') | 7 | 11 | 122 | 166 | # coding: utf-8
alp = [chr(i) for i in range(97, 97 + 26)]
a = eval(input())
if a in alp:
print("a")
else:
print("A")
| # coding: utf-8
# Your code here!
c = eval(input())
a = ord("a")
alp = [chr(i) for i in range(a, a + 26)]
# print(alp)
if c in alp:
print("a")
else:
print("A")
| false | 36.363636 | [
"-alp = [chr(i) for i in range(97, 97 + 26)]",
"-a = eval(input())",
"-if a in alp:",
"+# Your code here!",
"+c = eval(input())",
"+a = ord(\"a\")",
"+alp = [chr(i) for i in range(a, a + 26)]",
"+# print(alp)",
"+if c in alp:"
] | false | 0.087686 | 0.048994 | 1.789744 | [
"s151248829",
"s708372178"
] |
u612281743 | p02909 | python | s102970054 | s287531608 | 24 | 19 | 8,780 | 8,884 | Accepted | Accepted | 20.83 | s = eval(input())
weatherList = {"Sunny" : "Cloudy", "Cloudy" : "Rainy", "Rainy" : "Sunny"}
print((weatherList[s])) | s = eval(input())
if(s == "Sunny"):
print("Cloudy")
elif(s == "Cloudy"):
print("Rainy")
elif(s == "Rainy"):
print("Sunny") | 5 | 7 | 113 | 134 | s = eval(input())
weatherList = {"Sunny": "Cloudy", "Cloudy": "Rainy", "Rainy": "Sunny"}
print((weatherList[s]))
| s = eval(input())
if s == "Sunny":
print("Cloudy")
elif s == "Cloudy":
print("Rainy")
elif s == "Rainy":
print("Sunny")
| false | 28.571429 | [
"-weatherList = {\"Sunny\": \"Cloudy\", \"Cloudy\": \"Rainy\", \"Rainy\": \"Sunny\"}",
"-print((weatherList[s]))",
"+if s == \"Sunny\":",
"+ print(\"Cloudy\")",
"+elif s == \"Cloudy\":",
"+ print(\"Rainy\")",
"+elif s == \"Rainy\":",
"+ print(\"Sunny\")"
] | false | 0.036805 | 0.036346 | 1.012634 | [
"s102970054",
"s287531608"
] |
u339199690 | p02762 | python | s878130909 | s664637116 | 1,487 | 955 | 136,964 | 99,964 | Accepted | Accepted | 35.78 | from collections import deque
def dfs(start):
link = {start}
S = deque()
# child = deque()
visited[start] = 1
S.append(start)
while len(S) > 0:
node = S.pop()
# child.clear()
for f in friend[node]:
if visited[f] == 0:
S.append(f... | from collections import deque
def dfs(start):
S = deque([start])
link = {start}
VL[start] = 1
while S:
node = S.pop()
for f in AB[node]:
if VL[f] == 1:
continue
link.add(f)
S.append(f)
VL[f] = 1
for l in l... | 44 | 41 | 1,031 | 846 | from collections import deque
def dfs(start):
link = {start}
S = deque()
# child = deque()
visited[start] = 1
S.append(start)
while len(S) > 0:
node = S.pop()
# child.clear()
for f in friend[node]:
if visited[f] == 0:
S.append(f)
... | from collections import deque
def dfs(start):
S = deque([start])
link = {start}
VL[start] = 1
while S:
node = S.pop()
for f in AB[node]:
if VL[f] == 1:
continue
link.add(f)
S.append(f)
VL[f] = 1
for l in link:
... | false | 6.818182 | [
"+ S = deque([start])",
"- S = deque()",
"- # child = deque()",
"- visited[start] = 1",
"- S.append(start)",
"- while len(S) > 0:",
"+ VL[start] = 1",
"+ while S:",
"- # child.clear()",
"- for f in friend[node]:",
"- if visited[f] == 0:",
"- ... | false | 0.036984 | 0.038448 | 0.961924 | [
"s878130909",
"s664637116"
] |
u416758623 | p03767 | python | s047434638 | s886891891 | 236 | 145 | 37,084 | 42,708 | Accepted | Accepted | 38.56 | n = int(eval(input()))
ls = sorted(list(map(int, input().split())),reverse=True)
total = 0
res = 1
for i in range(n):
total += ls[res]
res += 2
print(total) | n = int(eval(input()))
l = sorted(list(map(int, input().split())),reverse=True)
print((sum(l[1:len(l)-n:2]))) | 9 | 3 | 167 | 103 | n = int(eval(input()))
ls = sorted(list(map(int, input().split())), reverse=True)
total = 0
res = 1
for i in range(n):
total += ls[res]
res += 2
print(total)
| n = int(eval(input()))
l = sorted(list(map(int, input().split())), reverse=True)
print((sum(l[1 : len(l) - n : 2])))
| false | 66.666667 | [
"-ls = sorted(list(map(int, input().split())), reverse=True)",
"-total = 0",
"-res = 1",
"-for i in range(n):",
"- total += ls[res]",
"- res += 2",
"-print(total)",
"+l = sorted(list(map(int, input().split())), reverse=True)",
"+print((sum(l[1 : len(l) - n : 2])))"
] | false | 0.040844 | 0.036144 | 1.130034 | [
"s047434638",
"s886891891"
] |
u119148115 | p02987 | python | s683443116 | s603420822 | 173 | 63 | 61,768 | 61,872 | Accepted | Accepted | 63.58 | import sys
sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) #空白あり
def LI2(): return list(map(int,sys.stdin.readline().rstrip())) #空白なし
def ... | import sys
def LS2(): return list(sys.stdin.readline().rstrip()) #空白なし
S = LS2()
if S[0] == S[1] == S[2] == S[3]:
print('No')
elif S[0] == S[1] and S[2] == S[3]:
print('Yes')
elif S[0] == S[2] and S[1] == S[3]:
print('Yes')
elif S[0] == S[3] and S[1] == S[2]:
print('Yes')
else:
prin... | 23 | 15 | 742 | 328 | import sys
sys.setrecursionlimit(10**7)
def I():
return int(sys.stdin.readline().rstrip())
def MI():
return list(map(int, sys.stdin.readline().rstrip().split()))
def LI():
return list(map(int, sys.stdin.readline().rstrip().split())) # 空白あり
def LI2():
return list(map(int, sys.stdin.readline().r... | import sys
def LS2():
return list(sys.stdin.readline().rstrip()) # 空白なし
S = LS2()
if S[0] == S[1] == S[2] == S[3]:
print("No")
elif S[0] == S[1] and S[2] == S[3]:
print("Yes")
elif S[0] == S[2] and S[1] == S[3]:
print("Yes")
elif S[0] == S[3] and S[1] == S[2]:
print("Yes")
else:
print("No")... | false | 34.782609 | [
"-",
"-sys.setrecursionlimit(10**7)",
"-",
"-",
"-def I():",
"- return int(sys.stdin.readline().rstrip())",
"-",
"-",
"-def MI():",
"- return list(map(int, sys.stdin.readline().rstrip().split()))",
"-",
"-",
"-def LI():",
"- return list(map(int, sys.stdin.readline().rstrip().split... | false | 0.036644 | 0.036004 | 1.017753 | [
"s683443116",
"s603420822"
] |
u694649864 | p03013 | python | s901659823 | s340454325 | 195 | 163 | 13,216 | 86,284 | Accepted | Accepted | 16.41 | #3問目
NM = input().split()
N,M = int(NM[0]), int(NM[1])
A = set([int(eval(input())) for _ in range(M)])
dp = [0] * (N+1)
dp[0] = 1
dp[1] = 1
MOD = 1000000007
if(1 in A):
dp[1] = 0
for i in range(2, N+1):
#貰うdp
if(i in A):
dp[i] = 0
else:
dp[i] = dp[i-1] + dp[i-2]
... | #3問目
N, M = list(map(int, input().split()))
A = set({})
MAX = 1000000007
for i in range(M):
a = int(eval(input()))
A.add(a)
dp = [0] * (N+1)
dp[0] = 1
if 1 in A:
dp[1] = 0
else:
dp[1] = 1
for i in range(2, N+1):
if i in A:
dp[i] = 0
else:
#あきがなかったら
... | 21 | 21 | 348 | 354 | # 3問目
NM = input().split()
N, M = int(NM[0]), int(NM[1])
A = set([int(eval(input())) for _ in range(M)])
dp = [0] * (N + 1)
dp[0] = 1
dp[1] = 1
MOD = 1000000007
if 1 in A:
dp[1] = 0
for i in range(2, N + 1):
# 貰うdp
if i in A:
dp[i] = 0
else:
dp[i] = dp[i - 1] + dp[i - 2]
dp[i] %= MOD... | # 3問目
N, M = list(map(int, input().split()))
A = set({})
MAX = 1000000007
for i in range(M):
a = int(eval(input()))
A.add(a)
dp = [0] * (N + 1)
dp[0] = 1
if 1 in A:
dp[1] = 0
else:
dp[1] = 1
for i in range(2, N + 1):
if i in A:
dp[i] = 0
else:
# あきがなかったら
dp[i] = (dp[i - 2... | false | 0 | [
"-NM = input().split()",
"-N, M = int(NM[0]), int(NM[1])",
"-A = set([int(eval(input())) for _ in range(M)])",
"+N, M = list(map(int, input().split()))",
"+A = set({})",
"+MAX = 1000000007",
"+for i in range(M):",
"+ a = int(eval(input()))",
"+ A.add(a)",
"-dp[1] = 1",
"-MOD = 1000000007",... | false | 0.042267 | 0.043925 | 0.962248 | [
"s901659823",
"s340454325"
] |
u562935282 | p02602 | python | s640713077 | s251890567 | 182 | 130 | 33,016 | 31,588 | Accepted | Accepted | 28.57 | # 解説
def main():
from math import log10
N, K = list(map(int, input().split()))
*A, = list(map(int, input().split()))
def accumulate(a):
s = 0
for x in a:
s += log10(x)
yield s
*acc, = accumulate(A)
for i in range(N - 1, K - 1, -1):
... | def main():
N, K = map(int, input().split())
*A, = map(int, input().split())
ans = []
for i in range(K, N):
cond = A[i] > A[i - K]
ans.append('Yes' if cond else 'No')
print(*ans, sep='\n')
if __name__ == '__main__':
main()
| 27 | 14 | 513 | 280 | # 解説
def main():
from math import log10
N, K = list(map(int, input().split()))
(*A,) = list(map(int, input().split()))
def accumulate(a):
s = 0
for x in a:
s += log10(x)
yield s
(*acc,) = accumulate(A)
for i in range(N - 1, K - 1, -1):
acc[i] -=... | def main():
N, K = map(int, input().split())
(*A,) = map(int, input().split())
ans = []
for i in range(K, N):
cond = A[i] > A[i - K]
ans.append("Yes" if cond else "No")
print(*ans, sep="\n")
if __name__ == "__main__":
main()
| false | 48.148148 | [
"-# 解説",
"- from math import log10",
"-",
"- N, K = list(map(int, input().split()))",
"- (*A,) = list(map(int, input().split()))",
"-",
"- def accumulate(a):",
"- s = 0",
"- for x in a:",
"- s += log10(x)",
"- yield s",
"-",
"- (*acc,) = acc... | false | 0.047964 | 0.007778 | 6.166695 | [
"s640713077",
"s251890567"
] |
u876536031 | p02713 | python | s834021221 | s589539965 | 1,679 | 377 | 9,144 | 68,888 | Accepted | Accepted | 77.55 | import itertools
K = int(eval(input()))
ans = 0
S = list(range(1,K+1))
def gcd(x, y):
if y == 0:
return x
else:
return gcd(y, x % y)
for v in itertools.combinations_with_replacement(S, 3):
if v[0] == v[1] == v[2]:
ans += v[0]
elif v[0] != v[1] and v[1] != v[2] and v[0] != v[... | import itertools
K = int(eval(input()))
ans = 0
S = list(range(1,K+1))
def gcd(a,b):
while a != 0 or b != 0:
if a % b == 0:
return min(a,b)
a, b = b, a % b
for v in itertools.combinations_with_replacement(S, 3):
if v[0] == v[1] == v[2]:
ans += v[0]
elif v[0] != v[1] and v[1] != v[2] ... | 18 | 18 | 418 | 432 | import itertools
K = int(eval(input()))
ans = 0
S = list(range(1, K + 1))
def gcd(x, y):
if y == 0:
return x
else:
return gcd(y, x % y)
for v in itertools.combinations_with_replacement(S, 3):
if v[0] == v[1] == v[2]:
ans += v[0]
elif v[0] != v[1] and v[1] != v[2] and v[0] !=... | import itertools
K = int(eval(input()))
ans = 0
S = list(range(1, K + 1))
def gcd(a, b):
while a != 0 or b != 0:
if a % b == 0:
return min(a, b)
a, b = b, a % b
for v in itertools.combinations_with_replacement(S, 3):
if v[0] == v[1] == v[2]:
ans += v[0]
elif v[0] != ... | false | 0 | [
"-def gcd(x, y):",
"- if y == 0:",
"- return x",
"- else:",
"- return gcd(y, x % y)",
"+def gcd(a, b):",
"+ while a != 0 or b != 0:",
"+ if a % b == 0:",
"+ return min(a, b)",
"+ a, b = b, a % b"
] | false | 0.156088 | 0.156929 | 0.994639 | [
"s834021221",
"s589539965"
] |
u364298541 | p02971 | python | s850138301 | s583065894 | 1,728 | 1,504 | 16,744 | 16,744 | Accepted | Accepted | 12.96 | A=[]
_max = 0
_max2 = 0
N=int(eval(input()))
for i in range(N):
A.append(int(eval(input())))
_,_max2,_max=sorted([A[-1],_max2,_max])
for i in range(N):
print((_max if _max!=A[i] else _max2)) | A=[]
_max = 0
_max2 = 0
N=int(eval(input()))
for i in range(N):
A.append(int(eval(input())))
if _max<A[-1]:
_max2,_max=_max,A[i]
elif _max2<A[-1]:
_max2=A[i]
#_,_max2,_max=sorted([A[-1],_max2,_max])
for i in range(N):
print((_max if _max!=A[i] else _max2)) | 10 | 14 | 198 | 292 | A = []
_max = 0
_max2 = 0
N = int(eval(input()))
for i in range(N):
A.append(int(eval(input())))
_, _max2, _max = sorted([A[-1], _max2, _max])
for i in range(N):
print((_max if _max != A[i] else _max2))
| A = []
_max = 0
_max2 = 0
N = int(eval(input()))
for i in range(N):
A.append(int(eval(input())))
if _max < A[-1]:
_max2, _max = _max, A[i]
elif _max2 < A[-1]:
_max2 = A[i]
# _,_max2,_max=sorted([A[-1],_max2,_max])
for i in range(N):
print((_max if _max != A[i] else _max2))
| false | 28.571429 | [
"- _, _max2, _max = sorted([A[-1], _max2, _max])",
"+ if _max < A[-1]:",
"+ _max2, _max = _max, A[i]",
"+ elif _max2 < A[-1]:",
"+ _max2 = A[i]",
"+ # _,_max2,_max=sorted([A[-1],_max2,_max])"
] | false | 0.066182 | 0.038538 | 1.717333 | [
"s850138301",
"s583065894"
] |
u931889893 | p03339 | python | s047173925 | s659866111 | 164 | 147 | 15,564 | 15,564 | Accepted | Accepted | 10.37 | N = int(eval(input()))
S = eval(input())
i = S[1:].count('E')
ans = [i]
for n in range(N):
if n == 0:
continue
if S[n] == 'E':
i -= 1
if S[n - 1] == 'W':
i += 1
ans.append(i)
print((min(ans))) | N = int(eval(input()))
S = eval(input())
i = S[1:].count('E')
r = [i]
for n in range(1, N):
if S[n] == 'E':
i -= 1
if S[n - 1] == 'W':
i += 1
r.append(i)
print((min(r))) | 18 | 15 | 240 | 201 | N = int(eval(input()))
S = eval(input())
i = S[1:].count("E")
ans = [i]
for n in range(N):
if n == 0:
continue
if S[n] == "E":
i -= 1
if S[n - 1] == "W":
i += 1
ans.append(i)
print((min(ans)))
| N = int(eval(input()))
S = eval(input())
i = S[1:].count("E")
r = [i]
for n in range(1, N):
if S[n] == "E":
i -= 1
if S[n - 1] == "W":
i += 1
r.append(i)
print((min(r)))
| false | 16.666667 | [
"-ans = [i]",
"-for n in range(N):",
"- if n == 0:",
"- continue",
"+r = [i]",
"+for n in range(1, N):",
"- ans.append(i)",
"-print((min(ans)))",
"+ r.append(i)",
"+print((min(r)))"
] | false | 0.046649 | 0.049506 | 0.942288 | [
"s047173925",
"s659866111"
] |
u983918956 | p03329 | python | s341686198 | s065514723 | 1,114 | 710 | 7,064 | 3,828 | Accepted | Accepted | 36.27 | N = int(eval(input()))
dp = [N + 1 for i in range(N+1)]
dp[0] = 0
for i in range(1,N+1):
j = 0
while i - pow(6,j) >= 0:
if dp[i-pow(6,j)] + 1 < dp[i]:
dp[i] = dp[i-pow(6,j)] + 1
j += 1
j = 0
while i - pow(9,j) >= 0:
if dp[i-pow(9,j)] + 1 < dp[i]:
... | inf = float('inf')
N = int(eval(input()))
dp = [inf] * (N+1)
dp[0] = 0
for i in range(N):
if i+1 < N+1:
dp[i+1] = min(dp[i+1], dp[i] + 1)
j = 6
while i+j < N+1:
dp[i+j] = min(dp[i+j], dp[i] + 1)
j *= 6
j = 9
while i+j < N+1:
dp[i+j] = min(dp[i+j], d... | 15 | 21 | 373 | 370 | N = int(eval(input()))
dp = [N + 1 for i in range(N + 1)]
dp[0] = 0
for i in range(1, N + 1):
j = 0
while i - pow(6, j) >= 0:
if dp[i - pow(6, j)] + 1 < dp[i]:
dp[i] = dp[i - pow(6, j)] + 1
j += 1
j = 0
while i - pow(9, j) >= 0:
if dp[i - pow(9, j)] + 1 < dp[i]:
... | inf = float("inf")
N = int(eval(input()))
dp = [inf] * (N + 1)
dp[0] = 0
for i in range(N):
if i + 1 < N + 1:
dp[i + 1] = min(dp[i + 1], dp[i] + 1)
j = 6
while i + j < N + 1:
dp[i + j] = min(dp[i + j], dp[i] + 1)
j *= 6
j = 9
while i + j < N + 1:
dp[i + j] = min(dp[i ... | false | 28.571429 | [
"+inf = float(\"inf\")",
"-dp = [N + 1 for i in range(N + 1)]",
"+dp = [inf] * (N + 1)",
"-for i in range(1, N + 1):",
"- j = 0",
"- while i - pow(6, j) >= 0:",
"- if dp[i - pow(6, j)] + 1 < dp[i]:",
"- dp[i] = dp[i - pow(6, j)] + 1",
"- j += 1",
"- j = 0",
"- ... | false | 0.248161 | 0.154508 | 1.606137 | [
"s341686198",
"s065514723"
] |
u426534722 | p02289 | python | s598813369 | s975146704 | 9,900 | 2,450 | 105,632 | 99,120 | Accepted | Accepted | 75.25 | import sys
def maxHeapify(A, i):
l = i * 2 + 1
r = i * 2 + 2
if l < n:
largest = l
if r < n and A[r] > A[l]:
largest = r
if A[largest] > A[i]:
A[i], A[largest] = A[largest], A[i]
maxHeapify(A, largest)
def insert(S, k):
global n
... | import sys
from heapq import heapify, heappush, heappop
hq = []
S = []
for s in sys.stdin:
if s[2] == "s":
heappush(hq, -int(s[7:]))
elif s[2] == "t":
S.append(-heappop(hq))
else:
break
print(("\n".join(map(str, S))))
| 56 | 13 | 1,191 | 265 | import sys
def maxHeapify(A, i):
l = i * 2 + 1
r = i * 2 + 2
if l < n:
largest = l
if r < n and A[r] > A[l]:
largest = r
if A[largest] > A[i]:
A[i], A[largest] = A[largest], A[i]
maxHeapify(A, largest)
def insert(S, k):
global n
S[n] = ... | import sys
from heapq import heapify, heappush, heappop
hq = []
S = []
for s in sys.stdin:
if s[2] == "s":
heappush(hq, -int(s[7:]))
elif s[2] == "t":
S.append(-heappop(hq))
else:
break
print(("\n".join(map(str, S))))
| false | 76.785714 | [
"+from heapq import heapify, heappush, heappop",
"-",
"-def maxHeapify(A, i):",
"- l = i * 2 + 1",
"- r = i * 2 + 2",
"- if l < n:",
"- largest = l",
"- if r < n and A[r] > A[l]:",
"- largest = r",
"- if A[largest] > A[i]:",
"- A[i], A[largest]... | false | 0.081148 | 0.109041 | 0.744198 | [
"s598813369",
"s975146704"
] |
u941753895 | p03339 | python | s482626347 | s226441032 | 311 | 251 | 32,000 | 19,920 | Accepted | Accepted | 19.29 | import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time
sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
def LI(): return list(map(int,input().split()))
def I(): return int(eval(input()))
def LS(): return input().split()
def S(): return eval(input())
def main():
n=I(... | import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,queue
sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
def LI(): return list(map(int,input().split()))
def I(): return int(eval(input()))
def LS(): return input().split()
def S(): return eval(input())
def main():
... | 38 | 39 | 660 | 664 | import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time
sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7
def LI():
return list(map(int, input().split()))
def I():
return int(eval(input()))
def LS():
return input().split()
def S():
return eval... | import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, queue
sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7
def LI():
return list(map(int, input().split()))
def I():
return int(eval(input()))
def LS():
return input().split()
def S():
retu... | false | 2.564103 | [
"-import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time",
"+import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, queue",
"- l = list(S())",
"- l1 = [0] * n",
"+ s = S()",
"+ a = [0] * n",
"- ... | false | 0.080632 | 0.129107 | 0.624535 | [
"s482626347",
"s226441032"
] |
u171366497 | p03026 | python | s834246250 | s073127954 | 109 | 85 | 9,508 | 8,284 | Accepted | Accepted | 22.02 | N=int(eval(input()))
from collections import defaultdict,deque
B=[tuple(map(int,input().split())) for i in range(N-1)]
branch=defaultdict(set)
for a,b in B:
branch[a-1]|={b-1}
branch[b-1]|={a-1}
C=list(map(int,input().split()))
cnt=[len(branch[i]) for i in range(N)]
M=0
start=-1
for i in range(N):
... | N=int(eval(input()))
from collections import defaultdict
branch=defaultdict(set)
for i in range(N-1):
a,b=list(map(int,input().split()))
a-=1
b-=1
branch[a]|={b}
branch[b]|={a}
C=list(map(int,input().split()))
C.sort()
ans=[0]*N
used={0}
check={0}
M=sum(C[:-1])
while len(check)>0:
... | 31 | 24 | 774 | 506 | N = int(eval(input()))
from collections import defaultdict, deque
B = [tuple(map(int, input().split())) for i in range(N - 1)]
branch = defaultdict(set)
for a, b in B:
branch[a - 1] |= {b - 1}
branch[b - 1] |= {a - 1}
C = list(map(int, input().split()))
cnt = [len(branch[i]) for i in range(N)]
M = 0
start = -1... | N = int(eval(input()))
from collections import defaultdict
branch = defaultdict(set)
for i in range(N - 1):
a, b = list(map(int, input().split()))
a -= 1
b -= 1
branch[a] |= {b}
branch[b] |= {a}
C = list(map(int, input().split()))
C.sort()
ans = [0] * N
used = {0}
check = {0}
M = sum(C[:-1])
while ... | false | 22.580645 | [
"-from collections import defaultdict, deque",
"+from collections import defaultdict",
"-B = [tuple(map(int, input().split())) for i in range(N - 1)]",
"-for a, b in B:",
"- branch[a - 1] |= {b - 1}",
"- branch[b - 1] |= {a - 1}",
"+for i in range(N - 1):",
"+ a, b = list(map(int, input().spl... | false | 0.044921 | 0.123495 | 0.363746 | [
"s834246250",
"s073127954"
] |
u144913062 | p03364 | python | s493633536 | s586973953 | 1,235 | 766 | 48,092 | 41,128 | Accepted | Accepted | 37.98 | import sys
input = sys.stdin.readline
N = int(eval(input()))
S = [list(input().rstrip()) for _ in range(N)]
row = [[0] * 26 for _ in range(N)]
col = [[0] * 26 for _ in range(N)]
for i in range(N):
for j in range(N):
c = ord(S[i][j]) - ord('a')
row[i][c] += 1
col[j][c] += 1
ans =... | N=int(eval(input()))
X=list(range(N))
S=[eval(input())for _ in X]
print((sum(all(S[(i+k)%N][j]==S[(j+k)%N][i]for i in X for j in X)for k in X)*N)) | 19 | 4 | 522 | 129 | import sys
input = sys.stdin.readline
N = int(eval(input()))
S = [list(input().rstrip()) for _ in range(N)]
row = [[0] * 26 for _ in range(N)]
col = [[0] * 26 for _ in range(N)]
for i in range(N):
for j in range(N):
c = ord(S[i][j]) - ord("a")
row[i][c] += 1
col[j][c] += 1
ans = 0
same = [[... | N = int(eval(input()))
X = list(range(N))
S = [eval(input()) for _ in X]
print(
(
sum(
all(S[(i + k) % N][j] == S[(j + k) % N][i] for i in X for j in X) for k in X
)
* N
)
)
| false | 78.947368 | [
"-import sys",
"-",
"-input = sys.stdin.readline",
"-S = [list(input().rstrip()) for _ in range(N)]",
"-row = [[0] * 26 for _ in range(N)]",
"-col = [[0] * 26 for _ in range(N)]",
"-for i in range(N):",
"- for j in range(N):",
"- c = ord(S[i][j]) - ord(\"a\")",
"- row[i][c] += 1",... | false | 0.037403 | 0.036204 | 1.033115 | [
"s493633536",
"s586973953"
] |
u022407960 | p02238 | python | s028186729 | s530767450 | 40 | 30 | 7,924 | 7,880 | Accepted | Accepted | 25 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
UNVISITED, VISITED_IN_STACK, POPPED_OUT = 0, 1, 2
def generate_adj_matrix(v_info):
for v_detail in v_info:
v_adj_list = v_detail[2:]
# assert len(v_adj_list) == int(v_detail[1])
for each in v_adj_list:
init... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
UNVISITED, VISITED_IN_STACK, POPPED_OUT = 0, 1, 2
def generate_adj_matrix(v_info):
for v_detail in v_info:
v_adj_list = v_detail[2:]
# assert len(v_adj_list) == int(v_detail[1])
for each in v_adj_list:
init... | 82 | 82 | 2,531 | 2,538 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
UNVISITED, VISITED_IN_STACK, POPPED_OUT = 0, 1, 2
def generate_adj_matrix(v_info):
for v_detail in v_info:
v_adj_list = v_detail[2:]
# assert len(v_adj_list) == int(v_detail[1])
for each in v_adj_list:
init_adj_matrix[in... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
UNVISITED, VISITED_IN_STACK, POPPED_OUT = 0, 1, 2
def generate_adj_matrix(v_info):
for v_detail in v_info:
v_adj_list = v_detail[2:]
# assert len(v_adj_list) == int(v_detail[1])
for each in v_adj_list:
init_adj_matrix[in... | false | 0 | [
"- init_adj_matrix = [[0] * vertices_num for _ in range(vertices_num)]",
"+ init_adj_matrix = tuple([[0] * vertices_num for _ in range(vertices_num)])"
] | false | 0.044894 | 0.040555 | 1.106993 | [
"s028186729",
"s530767450"
] |
u315078622 | p02889 | python | s236136422 | s661641245 | 911 | 502 | 22,144 | 19,772 | Accepted | Accepted | 44.9 | def io_tmp():
global input
import io, sys
#f = io.StringIO(open(0).read())
f = io.BytesIO(sys.stdin.buffer.read())
input = f.readline
io_tmp()
from scipy.sparse.csgraph import floyd_warshall
import numpy as np
N, M, L = map(int, input().split())
graph = [[float("inf")] * N for _ in... | def io_tmp():
global input
import io, sys
#f = io.StringIO(open(0).read())
f = io.BytesIO(sys.stdin.buffer.read())
input = f.readline
io_tmp()
from scipy.sparse.csgraph import floyd_warshall
import numpy as np
N, M, L = map(int, input().split())
graph = [[float("inf")] * N for _ in... | 33 | 33 | 815 | 821 | def io_tmp():
global input
import io, sys
# f = io.StringIO(open(0).read())
f = io.BytesIO(sys.stdin.buffer.read())
input = f.readline
io_tmp()
from scipy.sparse.csgraph import floyd_warshall
import numpy as np
N, M, L = map(int, input().split())
graph = [[float("inf")] * N for _ in range(N)]
fo... | def io_tmp():
global input
import io, sys
# f = io.StringIO(open(0).read())
f = io.BytesIO(sys.stdin.buffer.read())
input = f.readline
io_tmp()
from scipy.sparse.csgraph import floyd_warshall
import numpy as np
N, M, L = map(int, input().split())
graph = [[float("inf")] * N for _ in range(N)]
fo... | false | 0 | [
"-dist = dist.astype(int)",
"+# dist = dist.astype(int)",
"- ans.append(dist[s - 1][t - 1] - 1)",
"+ ans.append(int(dist[s - 1][t - 1]) - 1)"
] | false | 0.300183 | 0.292753 | 1.025381 | [
"s236136422",
"s661641245"
] |
u268822556 | p02629 | python | s562019997 | s297682521 | 33 | 27 | 9,196 | 8,992 | Accepted | Accepted | 18.18 | N = int(eval(input()))
ans = ""
while N > 0:
N -= 1
ans += chr(97 + N%26)
N //= 26
print((ans[::-1])) | def f(N):
if N == 0: return ""
N -= 1
return f(N//26) + chr(97 + N%26)
N = int(eval(input()))
print((f(N))) | 7 | 7 | 111 | 118 | N = int(eval(input()))
ans = ""
while N > 0:
N -= 1
ans += chr(97 + N % 26)
N //= 26
print((ans[::-1]))
| def f(N):
if N == 0:
return ""
N -= 1
return f(N // 26) + chr(97 + N % 26)
N = int(eval(input()))
print((f(N)))
| false | 0 | [
"+def f(N):",
"+ if N == 0:",
"+ return \"\"",
"+ N -= 1",
"+ return f(N // 26) + chr(97 + N % 26)",
"+",
"+",
"-ans = \"\"",
"-while N > 0:",
"- N -= 1",
"- ans += chr(97 + N % 26)",
"- N //= 26",
"-print((ans[::-1]))",
"+print((f(N)))"
] | false | 0.035118 | 0.035548 | 0.987887 | [
"s562019997",
"s297682521"
] |
u872538555 | p02708 | python | s367532574 | s446839183 | 119 | 22 | 9,188 | 9,004 | Accepted | Accepted | 81.51 | n, k = list(map(int, input().split()))
ans = 0
for num in range(k, n + 2):
maximum = (2 * n - num + 1) * num // 2
minimum = (num - 1) * num // 2
ans += maximum - minimum + 1
ans = ans % (10**9 + 7)
print(ans) | n, k = list(map(int, input().split()))
m = n + 1
l = k - 1
ans = m * (m**2 + 5) // 6
ans += l * (2 * l**2 + 3 * l - 5 - 3 * m * (l + 1)) // 6
ans = ans % (10**9 + 7)
print(ans)
| 11 | 10 | 231 | 183 | n, k = list(map(int, input().split()))
ans = 0
for num in range(k, n + 2):
maximum = (2 * n - num + 1) * num // 2
minimum = (num - 1) * num // 2
ans += maximum - minimum + 1
ans = ans % (10**9 + 7)
print(ans)
| n, k = list(map(int, input().split()))
m = n + 1
l = k - 1
ans = m * (m**2 + 5) // 6
ans += l * (2 * l**2 + 3 * l - 5 - 3 * m * (l + 1)) // 6
ans = ans % (10**9 + 7)
print(ans)
| false | 9.090909 | [
"-ans = 0",
"-for num in range(k, n + 2):",
"- maximum = (2 * n - num + 1) * num // 2",
"- minimum = (num - 1) * num // 2",
"- ans += maximum - minimum + 1",
"+m = n + 1",
"+l = k - 1",
"+ans = m * (m**2 + 5) // 6",
"+ans += l * (2 * l**2 + 3 * l - 5 - 3 * m * (l + 1)) // 6"
] | false | 0.045556 | 0.035893 | 1.269218 | [
"s367532574",
"s446839183"
] |
u073549161 | p03030 | python | s393664170 | s048999958 | 171 | 17 | 38,384 | 3,060 | Accepted | Accepted | 90.06 | n = int(eval(input()))
dat = []
for i in range(n):
s,p = input().split()
p = int(p)
dat.append((s, p, i+1))
res = sorted(dat, key=lambda x: (x[0], -x[1]))
for i in range(len(res)):
print((res[i][2])) | n = int(eval(input()))
dat = []
for i in range(n):
s,p = input().split()
dat.append((s, int(p), i+1))
res = sorted(dat, key=lambda x: (x[0], -x[1]))
for i in range(len(res)):
print((res[i][2])) | 9 | 8 | 215 | 204 | n = int(eval(input()))
dat = []
for i in range(n):
s, p = input().split()
p = int(p)
dat.append((s, p, i + 1))
res = sorted(dat, key=lambda x: (x[0], -x[1]))
for i in range(len(res)):
print((res[i][2]))
| n = int(eval(input()))
dat = []
for i in range(n):
s, p = input().split()
dat.append((s, int(p), i + 1))
res = sorted(dat, key=lambda x: (x[0], -x[1]))
for i in range(len(res)):
print((res[i][2]))
| false | 11.111111 | [
"- p = int(p)",
"- dat.append((s, p, i + 1))",
"+ dat.append((s, int(p), i + 1))"
] | false | 0.119174 | 0.043094 | 2.765454 | [
"s393664170",
"s048999958"
] |
u703528810 | p02678 | python | s334422307 | s828275643 | 827 | 680 | 39,948 | 35,928 | Accepted | Accepted | 17.78 | from collections import deque
N,M=list(map(int,input().split()))
tree=[[0] for _ in range(N)]
for _ in range(M):
A,B=list(map(int,input().split()))
tree[A-1].append(B-1)
tree[B-1].append(A-1)
dist = [-1]*N
que = deque([0])
dist[0] = 0
while que:
v = que.popleft()
d = dist[v]
... | from collections import deque
N,M=list(map(int,input().split()))
tree=[[0] for _ in range(N)]
for _ in range(M):
A,B=list(map(int,input().split()))
tree[A-1].append(B-1)
tree[B-1].append(A-1)
dist = [-1]*N
que = deque([0])
dist[0] = 0
while que:
v = que.popleft()
d = dist[v]
... | 32 | 26 | 626 | 478 | from collections import deque
N, M = list(map(int, input().split()))
tree = [[0] for _ in range(N)]
for _ in range(M):
A, B = list(map(int, input().split()))
tree[A - 1].append(B - 1)
tree[B - 1].append(A - 1)
dist = [-1] * N
que = deque([0])
dist[0] = 0
while que:
v = que.popleft()
d = dist[v]
... | from collections import deque
N, M = list(map(int, input().split()))
tree = [[0] for _ in range(N)]
for _ in range(M):
A, B = list(map(int, input().split()))
tree[A - 1].append(B - 1)
tree[B - 1].append(A - 1)
dist = [-1] * N
que = deque([0])
dist[0] = 0
while que:
v = que.popleft()
d = dist[v]
... | false | 18.75 | [
"- dist[w] = d + 1",
"+ dist[w] = v",
"-ans = [0 for _ in range(N)]",
"-for i in range(1, N):",
"- for t in tree[i]:",
"- if dist[t] == dist[i] - 1:",
"- ans[i] = t + 1",
"- break",
"- print((ans[j]))",
"+ print((dist[j] + 1))"
] | false | 0.10991 | 0.065396 | 1.680687 | [
"s334422307",
"s828275643"
] |
u389910364 | p03844 | python | s940633444 | s970833581 | 26 | 24 | 3,684 | 3,572 | Accepted | Accepted | 7.69 | import functools
import os
import sys
sys.setrecursionlimit(10000)
INF = float('inf')
def inp():
return int(eval(input()))
def inpf():
return float(eval(input()))
def inps():
return eval(input())
def inl():
return list(map(int, input().split()))
def inlf():
retu... | import functools
import os
import sys
sys.setrecursionlimit(10000)
INF = float('inf')
def inp():
return int(eval(input()))
def inpf():
return float(eval(input()))
def inps():
return eval(input())
def inl():
return list(map(int, input().split()))
def inlf():
retu... | 73 | 70 | 1,033 | 964 | import functools
import os
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
def inp():
return int(eval(input()))
def inpf():
return float(eval(input()))
def inps():
return eval(input())
def inl():
return list(map(int, input().split()))
def inlf():
return list(map(float, input().... | import functools
import os
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
def inp():
return int(eval(input()))
def inpf():
return float(eval(input()))
def inps():
return eval(input())
def inl():
return list(map(int, input().split()))
def inlf():
return list(map(float, input().... | false | 4.109589 | [
"-a, o, b = inls()",
"-if o == \"+\":",
"- print((int(a) + int(b)))",
"-else:",
"- print((int(a) - int(b)))",
"+print((eval(input())))"
] | false | 0.038223 | 0.064063 | 0.596651 | [
"s940633444",
"s970833581"
] |
u092650292 | p02953 | python | s981946821 | s703903788 | 68 | 60 | 14,396 | 14,832 | Accepted | Accepted | 11.76 | def main():
n = int(eval(input()))
h = list(map(int,input().split()))
h = list(reversed(h))
flag = True
for i in range(1,len(h)):
if h[i] - h[i-1] > 1:
flag = False
elif h[i] - h[i-1] == 1:
h[i] -= 1
if flag:
print('Yes')
... |
from sys import exit
ii = lambda : int(eval(input()))
mi = lambda : list(map(int,input().split()))
li = lambda : list(map(int,input().split()))
def main():
n = ii()
a = li()
a = reversed(a)
m = 100000000000
for i in a:
m = min(m,i)
if i > m+1:
prin... | 19 | 27 | 354 | 376 | def main():
n = int(eval(input()))
h = list(map(int, input().split()))
h = list(reversed(h))
flag = True
for i in range(1, len(h)):
if h[i] - h[i - 1] > 1:
flag = False
elif h[i] - h[i - 1] == 1:
h[i] -= 1
if flag:
print("Yes")
else:
pr... | from sys import exit
ii = lambda: int(eval(input()))
mi = lambda: list(map(int, input().split()))
li = lambda: list(map(int, input().split()))
def main():
n = ii()
a = li()
a = reversed(a)
m = 100000000000
for i in a:
m = min(m, i)
if i > m + 1:
print("No")
... | false | 29.62963 | [
"+from sys import exit",
"+",
"+ii = lambda: int(eval(input()))",
"+mi = lambda: list(map(int, input().split()))",
"+li = lambda: list(map(int, input().split()))",
"+",
"+",
"- n = int(eval(input()))",
"- h = list(map(int, input().split()))",
"- h = list(reversed(h))",
"- flag = True... | false | 0.034803 | 0.036531 | 0.9527 | [
"s981946821",
"s703903788"
] |
u661290476 | p00008 | python | s160808241 | s284522512 | 210 | 30 | 7,568 | 7,532 | Accepted | Accepted | 85.71 |
memo=[[0]*51 for i in range(5)]
def rec(i,n):
if memo[i][n]!=0:
return memo[i][n]
if i==4:
return 1 if n==0 else 0
for m in range(10):
memo[i][n]+=rec(i+1,n-m)
return memo[i][n]
while True:
try:
n=int(eval(input()))
print((rec(0,n)))
e... | memo=[[-1]*51 for i in range(5)]
def rec(i,n):
if memo[i][n]!=-1:
return memo[i][n]
r=0
if i==4:
return 1 if n==0 else 0
for m in range(10):
r+=rec(i+1,n-m)
memo[i][n]=r
return r
while True:
try:
n=int(eval(input()))
print((rec(0,n... | 17 | 18 | 333 | 343 | memo = [[0] * 51 for i in range(5)]
def rec(i, n):
if memo[i][n] != 0:
return memo[i][n]
if i == 4:
return 1 if n == 0 else 0
for m in range(10):
memo[i][n] += rec(i + 1, n - m)
return memo[i][n]
while True:
try:
n = int(eval(input()))
print((rec(0, n)))
... | memo = [[-1] * 51 for i in range(5)]
def rec(i, n):
if memo[i][n] != -1:
return memo[i][n]
r = 0
if i == 4:
return 1 if n == 0 else 0
for m in range(10):
r += rec(i + 1, n - m)
memo[i][n] = r
return r
while True:
try:
n = int(eval(input()))
print((... | false | 5.555556 | [
"-memo = [[0] * 51 for i in range(5)]",
"+memo = [[-1] * 51 for i in range(5)]",
"- if memo[i][n] != 0:",
"+ if memo[i][n] != -1:",
"+ r = 0",
"- memo[i][n] += rec(i + 1, n - m)",
"- return memo[i][n]",
"+ r += rec(i + 1, n - m)",
"+ memo[i][n] = r",
"+ return r"
] | false | 0.138121 | 0.046908 | 2.944489 | [
"s160808241",
"s284522512"
] |
u614314290 | p03167 | python | s882415465 | s018369209 | 1,473 | 1,187 | 52,468 | 52,388 | Accepted | Accepted | 19.42 | H, W = list(map(int, input().split()))
STAGE = [list(eval(input())) for _ in range(H)]
dp = [[0 for _ in range(W)] for _ in range(H)]
dp[0][0] = 1
MOD = 10 ** 9 + 7
for y in range(H):
for x in range(W):
if y + 1 < H and STAGE[y + 1][x] == ".":
dp[y + 1][x] += dp[y][x]
if MOD < dp[y + 1][x]:
... | H, W = list(map(int, input().split()))
STAGE = [list(eval(input())) for _ in range(H)]
dp = [[0 for _ in range(W)] for _ in range(H)]
dp[0][0] = 1
MOD = 10 ** 9 + 7
for y in range(H):
for x in range(W):
if y + 1 < H and STAGE[y + 1][x] == ".":
dp[y + 1][x] += dp[y][x] % MOD
if x + 1 < W and STAGE... | 20 | 16 | 475 | 389 | H, W = list(map(int, input().split()))
STAGE = [list(eval(input())) for _ in range(H)]
dp = [[0 for _ in range(W)] for _ in range(H)]
dp[0][0] = 1
MOD = 10**9 + 7
for y in range(H):
for x in range(W):
if y + 1 < H and STAGE[y + 1][x] == ".":
dp[y + 1][x] += dp[y][x]
if MOD < dp[y + 1... | H, W = list(map(int, input().split()))
STAGE = [list(eval(input())) for _ in range(H)]
dp = [[0 for _ in range(W)] for _ in range(H)]
dp[0][0] = 1
MOD = 10**9 + 7
for y in range(H):
for x in range(W):
if y + 1 < H and STAGE[y + 1][x] == ".":
dp[y + 1][x] += dp[y][x] % MOD
if x + 1 < W an... | false | 20 | [
"- dp[y + 1][x] += dp[y][x]",
"- if MOD < dp[y + 1][x]:",
"- dp[y + 1][x] -= MOD",
"+ dp[y + 1][x] += dp[y][x] % MOD",
"- dp[y][x + 1] += dp[y][x]",
"- if MOD < dp[y][x + 1]:",
"- dp[y][x + 1] -= MOD",
"-print((dp[-1]... | false | 0.080989 | 0.068153 | 1.188345 | [
"s882415465",
"s018369209"
] |
u456353530 | p02632 | python | s823488581 | s913208832 | 781 | 685 | 244,160 | 242,092 | Accepted | Accepted | 12.29 | class comb():
F = [1, 1]
Fi = [1, 1]
I = [0, 1]
def __init__(self, num, mod):
self.MOD = mod
for i in range(2, num + 1):
self.F.append((self.F[-1] * i) % mod)
self.I.append(mod - self.I[mod % i] * (mod // i) % mod)
self.Fi.append(self.Fi[-1] * self.I[i] % mod)
def com(self,... | class comb():
F = [1, 1]
Fi = [1, 1]
I = [0, 1]
def __init__(self, num, mod):
self.MOD = mod
for i in range(2, num + 1):
self.F.append((self.F[-1] * i) % mod)
self.I.append(mod - self.I[mod % i] * (mod // i) % mod)
self.Fi.append(self.Fi[-1] * self.I[i] % mod)
def com(self,... | 36 | 35 | 808 | 754 | class comb:
F = [1, 1]
Fi = [1, 1]
I = [0, 1]
def __init__(self, num, mod):
self.MOD = mod
for i in range(2, num + 1):
self.F.append((self.F[-1] * i) % mod)
self.I.append(mod - self.I[mod % i] * (mod // i) % mod)
self.Fi.append(self.Fi[-1] * self.I[i]... | class comb:
F = [1, 1]
Fi = [1, 1]
I = [0, 1]
def __init__(self, num, mod):
self.MOD = mod
for i in range(2, num + 1):
self.F.append((self.F[-1] * i) % mod)
self.I.append(mod - self.I[mod % i] * (mod // i) % mod)
self.Fi.append(self.Fi[-1] * self.I[i]... | false | 2.777778 | [
"-p26 = [1]",
"-for i in range(K + 1):",
"+for i in range(N + 1):",
"- p26.append(p26[-1] * 26 % MOD)",
"- ans = (ans + p25[i] * com.com(M + i - 1, M - 1) * p26[K - i]) % MOD",
"+ t = M + i",
"+ ans = (ans + p25[N - t] * com.com(N, t)) % MOD"
] | false | 0.038693 | 0.081444 | 0.475084 | [
"s823488581",
"s913208832"
] |
u883621917 | p03043 | python | s917582610 | s924816417 | 96 | 66 | 64,920 | 66,312 | Accepted | Accepted | 31.25 | import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
n, k = list(map(int, input().split()))
if k == 1:
print((1))
sys.exit(0)
if k <= n:
ans = ((n - k) + 1) / n
upper = k - 1
else:
ans = 0
upper = n
for i in range(1, upper + 1):
tmp = 1 / n
while i < ... | import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
n, k = list(map(int, input().split()))
if k == 1:
print((1))
sys.exit(0)
# 場合分けをする必要はなかった
#if k <= n:
# ans = ((n - k) + 1) / n
# upper = k - 1
#else:
# ans = 0
# upper = n
#for i in range(1, upper + 1):
# t... | 23 | 31 | 383 | 541 | import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
n, k = list(map(int, input().split()))
if k == 1:
print((1))
sys.exit(0)
if k <= n:
ans = ((n - k) + 1) / n
upper = k - 1
else:
ans = 0
upper = n
for i in range(1, upper + 1):
tmp = 1 / n
while i < k:
tmp *= 1 / ... | import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
n, k = list(map(int, input().split()))
if k == 1:
print((1))
sys.exit(0)
# 場合分けをする必要はなかった
# if k <= n:
# ans = ((n - k) + 1) / n
# upper = k - 1
# else:
# ans = 0
# upper = n
# for i in range(1, upper + 1):
# tmp = 1 / n
# whi... | false | 25.806452 | [
"-if k <= n:",
"- ans = ((n - k) + 1) / n",
"- upper = k - 1",
"-else:",
"- ans = 0",
"- upper = n",
"-for i in range(1, upper + 1):",
"+# 場合分けをする必要はなかった",
"+# if k <= n:",
"+# ans = ((n - k) + 1) / n",
"+# upper = k - 1",
"+# else:",
"+# ans = 0",
"+# upper = n",
... | false | 0.039508 | 0.007171 | 5.509129 | [
"s917582610",
"s924816417"
] |
u072053884 | p02399 | python | s700283798 | s946029396 | 70 | 20 | 7,676 | 7,692 | Accepted | Accepted | 71.43 | a, b = [int(x) for x in input().split(' ')]
d = a // b
r = a % b
f = a / b
print(("{0} {1} {2:.9f}".format(d, r, f))) | a, b = [int(x) for x in input().split(' ')]
d = a // b
r = a % b
f = a / b
print(("{0} {1} {2:.5f}".format(d, r, f))) | 7 | 7 | 123 | 123 | a, b = [int(x) for x in input().split(" ")]
d = a // b
r = a % b
f = a / b
print(("{0} {1} {2:.9f}".format(d, r, f)))
| a, b = [int(x) for x in input().split(" ")]
d = a // b
r = a % b
f = a / b
print(("{0} {1} {2:.5f}".format(d, r, f)))
| false | 0 | [
"-print((\"{0} {1} {2:.9f}\".format(d, r, f)))",
"+print((\"{0} {1} {2:.5f}\".format(d, r, f)))"
] | false | 0.03979 | 0.040477 | 0.98303 | [
"s700283798",
"s946029396"
] |
u753803401 | p03472 | python | s166287957 | s716631548 | 298 | 264 | 47,068 | 50,268 | Accepted | Accepted | 11.41 | import sys
def solve():
input = sys.stdin.readline
mod = 10 ** 9 + 7
n, h = list(map(int, input().rstrip('\n').split()))
md = 0
dl = []
for i in range(n):
a, b = list(map(int, input().rstrip('\n').split()))
md = max(md, a)
dl.append(b)
dl.sort(reverse=T... | import sys
def solve():
readline = sys.stdin.buffer.readline
mod = 10 ** 9 + 7
n, h = list(map(int, readline().split()))
a, b = [], []
for i in range(n):
av, bv = list(map(int, readline().split()))
a.append(av)
b.append(bv)
a.sort()
b.sort()
cnt = ... | 31 | 37 | 640 | 860 | import sys
def solve():
input = sys.stdin.readline
mod = 10**9 + 7
n, h = list(map(int, input().rstrip("\n").split()))
md = 0
dl = []
for i in range(n):
a, b = list(map(int, input().rstrip("\n").split()))
md = max(md, a)
dl.append(b)
dl.sort(reverse=True)
cnt = ... | import sys
def solve():
readline = sys.stdin.buffer.readline
mod = 10**9 + 7
n, h = list(map(int, readline().split()))
a, b = [], []
for i in range(n):
av, bv = list(map(int, readline().split()))
a.append(av)
b.append(bv)
a.sort()
b.sort()
cnt = 0
while True... | false | 16.216216 | [
"- input = sys.stdin.readline",
"+ readline = sys.stdin.buffer.readline",
"- n, h = list(map(int, input().rstrip(\"\\n\").split()))",
"- md = 0",
"- dl = []",
"+ n, h = list(map(int, readline().split()))",
"+ a, b = [], []",
"- a, b = list(map(int, input().rstrip(\"\\n\").s... | false | 0.116248 | 0.037753 | 3.079164 | [
"s166287957",
"s716631548"
] |
u989306199 | p03470 | python | s116950713 | s127748147 | 19 | 17 | 2,940 | 2,940 | Accepted | Accepted | 10.53 | n = int(eval(input()))
n_list = [int(eval(input())) for i in range(n)]
print((len(set(n_list)))) | n = int(eval(input()))
print((len(set([int(eval(input())) for i in range(n)])))) | 4 | 2 | 86 | 67 | n = int(eval(input()))
n_list = [int(eval(input())) for i in range(n)]
print((len(set(n_list))))
| n = int(eval(input()))
print((len(set([int(eval(input())) for i in range(n)]))))
| false | 50 | [
"-n_list = [int(eval(input())) for i in range(n)]",
"-print((len(set(n_list))))",
"+print((len(set([int(eval(input())) for i in range(n)]))))"
] | false | 0.044493 | 0.043306 | 1.027415 | [
"s116950713",
"s127748147"
] |
u813371068 | p03073 | python | s740425818 | s337924760 | 57 | 18 | 3,316 | 3,188 | Accepted | Accepted | 68.42 | S = eval(input())
tmp1 = '01' * (len(S) // 2 + 1)
tmp2 = '10' * (len(S) // 2 + 1)
C = {0 : 0, 1 : 0}
for i, s in enumerate(S):
if s != tmp1[i] : C[0] += 1
if s != tmp2[i] : C[1] += 1
print((min(C.values()))) | s = eval(input())
n = s[::2].count('0') + s[1::2].count('1')
print(( min(n, len(s)-n) )) | 8 | 3 | 214 | 82 | S = eval(input())
tmp1 = "01" * (len(S) // 2 + 1)
tmp2 = "10" * (len(S) // 2 + 1)
C = {0: 0, 1: 0}
for i, s in enumerate(S):
if s != tmp1[i]:
C[0] += 1
if s != tmp2[i]:
C[1] += 1
print((min(C.values())))
| s = eval(input())
n = s[::2].count("0") + s[1::2].count("1")
print((min(n, len(s) - n)))
| false | 62.5 | [
"-S = eval(input())",
"-tmp1 = \"01\" * (len(S) // 2 + 1)",
"-tmp2 = \"10\" * (len(S) // 2 + 1)",
"-C = {0: 0, 1: 0}",
"-for i, s in enumerate(S):",
"- if s != tmp1[i]:",
"- C[0] += 1",
"- if s != tmp2[i]:",
"- C[1] += 1",
"-print((min(C.values())))",
"+s = eval(input())",
... | false | 0.045058 | 0.044967 | 1.002034 | [
"s740425818",
"s337924760"
] |
u581187895 | p03207 | python | s571936803 | s776585803 | 149 | 18 | 12,404 | 2,940 | Accepted | Accepted | 87.92 | import numpy as np
n = int(eval(input()))
arr = [int(eval(input())) for _ in range(n)]
arg_m = np.argmax(arr)
total = (arr.pop(arg_m)//2) + sum(arr)
print(total)
| N = int(eval(input()))
A = sorted([int(eval(input())) for _ in range(N)])
ans = A[-1]//2 + sum(A[:-1])
print(ans) | 6 | 4 | 155 | 104 | import numpy as np
n = int(eval(input()))
arr = [int(eval(input())) for _ in range(n)]
arg_m = np.argmax(arr)
total = (arr.pop(arg_m) // 2) + sum(arr)
print(total)
| N = int(eval(input()))
A = sorted([int(eval(input())) for _ in range(N)])
ans = A[-1] // 2 + sum(A[:-1])
print(ans)
| false | 33.333333 | [
"-import numpy as np",
"-",
"-n = int(eval(input()))",
"-arr = [int(eval(input())) for _ in range(n)]",
"-arg_m = np.argmax(arr)",
"-total = (arr.pop(arg_m) // 2) + sum(arr)",
"-print(total)",
"+N = int(eval(input()))",
"+A = sorted([int(eval(input())) for _ in range(N)])",
"+ans = A[-1] // 2 + su... | false | 0.212084 | 0.081339 | 2.607395 | [
"s571936803",
"s776585803"
] |
u678167152 | p02663 | python | s569088784 | s599457326 | 64 | 23 | 61,580 | 9,160 | Accepted | Accepted | 64.06 | A = list(map(int, input().split()))
h = (A[2]-A[0])*60+A[3]-A[1]-A[4]
print(h) | A = list(map(int, input().split()))
print(((A[2]*60+A[3])-(A[0]*60+A[1])-A[4])) | 4 | 3 | 82 | 80 | A = list(map(int, input().split()))
h = (A[2] - A[0]) * 60 + A[3] - A[1] - A[4]
print(h)
| A = list(map(int, input().split()))
print(((A[2] * 60 + A[3]) - (A[0] * 60 + A[1]) - A[4]))
| false | 25 | [
"-h = (A[2] - A[0]) * 60 + A[3] - A[1] - A[4]",
"-print(h)",
"+print(((A[2] * 60 + A[3]) - (A[0] * 60 + A[1]) - A[4]))"
] | false | 0.036345 | 0.037739 | 0.963065 | [
"s569088784",
"s599457326"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.