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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
u173148629 | p02755 | python | s277190104 | s151376368 | 47 | 17 | 3,060 | 2,940 | Accepted | Accepted | 63.83 | A,B=list(map(int,input().split()))
S=max(12.5*A,10*B)
if S%1!=0:
S=S//1+1
if S<12.5*A+12.5 and S<10*B+10:
print((int(S)))
else:
print("-1") | A,B=list(map(int,input().split()))
S=max(12.5*A,10*B)
if S%1!=0:
S=int(S)+1
if S<12.5*A+12.5 and S<10*B+10:
print((int(S)))
else:
print("-1")
| 11 | 11 | 156 | 159 | A, B = list(map(int, input().split()))
S = max(12.5 * A, 10 * B)
if S % 1 != 0:
S = S // 1 + 1
if S < 12.5 * A + 12.5 and S < 10 * B + 10:
print((int(S)))
else:
print("-1")
| A, B = list(map(int, input().split()))
S = max(12.5 * A, 10 * B)
if S % 1 != 0:
S = int(S) + 1
if S < 12.5 * A + 12.5 and S < 10 * B + 10:
print((int(S)))
else:
print("-1")
| false | 0 | [
"- S = S // 1 + 1",
"+ S = int(S) + 1"
] | false | 0.007803 | 0.057906 | 0.13475 | [
"s277190104",
"s151376368"
] |
u545368057 | p03112 | python | s503944714 | s019021621 | 1,751 | 998 | 17,304 | 116,516 | Accepted | Accepted | 43 | # 二部探索問題
# from bisect import bisect_right as binarysearch
A, B, Q = list(map(int,input().split()))
"""
自分で作ったやつは遅い
"""
def binarysearch(ls,x):
n = len(ls)
left = 0
right = n
pos = (right+left)//2
while True:
if ls[pos] < x < ls[pos+1]:
index = pos
b... | import sys
from bisect import bisect_left
from bisect import bisect_right
input = sys.stdin.readline
a,b,q = list(map(int, input().split()))
INF = 10**20
ss = [-INF] + [int(eval(input())) for i in range(a)] + [INF]
ts = [-INF] + [int(eval(input())) for i in range(b)] + [INF]
xs = [int(eval(input())) for i in ra... | 43 | 26 | 1,060 | 814 | # 二部探索問題
# from bisect import bisect_right as binarysearch
A, B, Q = list(map(int, input().split()))
"""
自分で作ったやつは遅い
"""
def binarysearch(ls, x):
n = len(ls)
left = 0
right = n
pos = (right + left) // 2
while True:
if ls[pos] < x < ls[pos + 1]:
index = pos
break
... | import sys
from bisect import bisect_left
from bisect import bisect_right
input = sys.stdin.readline
a, b, q = list(map(int, input().split()))
INF = 10**20
ss = [-INF] + [int(eval(input())) for i in range(a)] + [INF]
ts = [-INF] + [int(eval(input())) for i in range(b)] + [INF]
xs = [int(eval(input())) for i in range(q... | false | 39.534884 | [
"-# 二部探索問題",
"-# from bisect import bisect_right as binarysearch",
"-A, B, Q = list(map(int, input().split()))",
"-\"\"\"",
"-自分で作ったやつは遅い",
"-\"\"\"",
"+import sys",
"+from bisect import bisect_left",
"+from bisect import bisect_right",
"-",
"-def binarysearch(ls, x):",
"- n = len(ls)",
"... | false | 0.03981 | 0.03616 | 1.100936 | [
"s503944714",
"s019021621"
] |
u983918956 | p03993 | python | s822751460 | s390425556 | 159 | 75 | 33,636 | 13,880 | Accepted | Accepted | 52.83 | N = int(eval(input()))
A = [int(e)-1 for e in input().split()]
ad = [set() for _ in range(N)]
for i, a in enumerate(A):
ad[a].add(i)
ans = 0
for i, a in enumerate(A):
if a in ad[i]:
ans += 1
print((ans//2)) | N = int(eval(input()))
A = [int(e)-1 for e in input().split()]
ans = 0
for i, a in enumerate(A):
if A[a] == i:
ans += 1
ans //= 2
print(ans) | 15 | 11 | 233 | 160 | N = int(eval(input()))
A = [int(e) - 1 for e in input().split()]
ad = [set() for _ in range(N)]
for i, a in enumerate(A):
ad[a].add(i)
ans = 0
for i, a in enumerate(A):
if a in ad[i]:
ans += 1
print((ans // 2))
| N = int(eval(input()))
A = [int(e) - 1 for e in input().split()]
ans = 0
for i, a in enumerate(A):
if A[a] == i:
ans += 1
ans //= 2
print(ans)
| false | 26.666667 | [
"-ad = [set() for _ in range(N)]",
"-for i, a in enumerate(A):",
"- ad[a].add(i)",
"- if a in ad[i]:",
"+ if A[a] == i:",
"-print((ans // 2))",
"+ans //= 2",
"+print(ans)"
] | false | 0.042164 | 0.040757 | 1.03451 | [
"s822751460",
"s390425556"
] |
u699296734 | p02780 | python | s550426859 | s883068492 | 202 | 172 | 25,060 | 25,060 | Accepted | Accepted | 14.85 | num,renzoku=list(map(int,input().split()))
dices=list(map(int,input().split()))
expects=[0]*num
for i in range(num):
pi=dices[i]
expects[i]=(1+pi)/2
Si=[0]*(num+1)
for i in range(1,num+1):
Si[i]=Si[i-1]+expects[i-1]
max_Si=0
for i in range(0,num-renzoku+1):
if max_Si<Si[i+renzoku]-Si[i]:
max_Si=... | num,renzoku=list(map(int,input().split()))
dices=list(map(int,input().split()))
expects=[0]*num
Si=[0]*(num+1)
for i in range(1,num+1):
Si[i]=Si[i-1]+(1+dices[i-1])/2
max_Si=0
for i in range(0,num-renzoku+1):
if max_Si<Si[i+renzoku]-Si[i]:
max_Si=Si[i+renzoku]-Si[i]
print(max_Si)
| 14 | 11 | 348 | 293 | num, renzoku = list(map(int, input().split()))
dices = list(map(int, input().split()))
expects = [0] * num
for i in range(num):
pi = dices[i]
expects[i] = (1 + pi) / 2
Si = [0] * (num + 1)
for i in range(1, num + 1):
Si[i] = Si[i - 1] + expects[i - 1]
max_Si = 0
for i in range(0, num - renzoku + 1):
if ... | num, renzoku = list(map(int, input().split()))
dices = list(map(int, input().split()))
expects = [0] * num
Si = [0] * (num + 1)
for i in range(1, num + 1):
Si[i] = Si[i - 1] + (1 + dices[i - 1]) / 2
max_Si = 0
for i in range(0, num - renzoku + 1):
if max_Si < Si[i + renzoku] - Si[i]:
max_Si = Si[i + ren... | false | 21.428571 | [
"-for i in range(num):",
"- pi = dices[i]",
"- expects[i] = (1 + pi) / 2",
"- Si[i] = Si[i - 1] + expects[i - 1]",
"+ Si[i] = Si[i - 1] + (1 + dices[i - 1]) / 2"
] | false | 0.051791 | 0.042432 | 1.220567 | [
"s550426859",
"s883068492"
] |
u063052907 | p03087 | python | s953499067 | s345653086 | 1,426 | 893 | 6,116 | 7,748 | Accepted | Accepted | 37.38 | N, Q = list(map(int, input().split()))
S = eval(input())
len_S = len(S)
char = ""
ac = [0] * len_S
val = 0
for i in range(N):
char += S[i]
# print(char)
# print(char[len(char)-2:len(char)+1])
if char[len(char)-2:len(char)+1] == "AC":
val += 1
ac[i] = val
# print(ac)
for _ i... | # 解答通り
N, Q = list(map(int, input().split()))
S = eval(input())
t = [0] * (N+1)
for i in range(N):
t[i+1] = t[i] + (1 if S[i:i+2] == "AC" else 0)
for i in range(Q):
l, r = list(map(int, input().split()))
ans = t[r-1] - t[l-1]
print(ans)
| 22 | 12 | 422 | 248 | N, Q = list(map(int, input().split()))
S = eval(input())
len_S = len(S)
char = ""
ac = [0] * len_S
val = 0
for i in range(N):
char += S[i]
# print(char)
# print(char[len(char)-2:len(char)+1])
if char[len(char) - 2 : len(char) + 1] == "AC":
val += 1
ac[i] = val
# print(ac)
for _ in range(Q):
... | # 解答通り
N, Q = list(map(int, input().split()))
S = eval(input())
t = [0] * (N + 1)
for i in range(N):
t[i + 1] = t[i] + (1 if S[i : i + 2] == "AC" else 0)
for i in range(Q):
l, r = list(map(int, input().split()))
ans = t[r - 1] - t[l - 1]
print(ans)
| false | 45.454545 | [
"+# 解答通り",
"-len_S = len(S)",
"-char = \"\"",
"-ac = [0] * len_S",
"-val = 0",
"+t = [0] * (N + 1)",
"- char += S[i]",
"- # print(char)",
"- # print(char[len(char)-2:len(char)+1])",
"- if char[len(char) - 2 : len(char) + 1] == \"AC\":",
"- val += 1",
"- ac[i] = val",
"-... | false | 0.09328 | 0.041082 | 2.270566 | [
"s953499067",
"s345653086"
] |
u092415958 | p02701 | python | s370050086 | s074308077 | 343 | 256 | 23,980 | 35,508 | Accepted | Accepted | 25.36 | N = int(eval(input()))
S = [eval(input()) for _ in range(N)]
S.sort()
uni_count = 1
for i in range(N-1):
if(S[i+1]!=S[i]):
uni_count += 1
print(uni_count)
| N = int(eval(input()))
S = [eval(input()) for _ in range(N)]
print((len(set(S))))
| 8 | 4 | 164 | 74 | N = int(eval(input()))
S = [eval(input()) for _ in range(N)]
S.sort()
uni_count = 1
for i in range(N - 1):
if S[i + 1] != S[i]:
uni_count += 1
print(uni_count)
| N = int(eval(input()))
S = [eval(input()) for _ in range(N)]
print((len(set(S))))
| false | 50 | [
"-S.sort()",
"-uni_count = 1",
"-for i in range(N - 1):",
"- if S[i + 1] != S[i]:",
"- uni_count += 1",
"-print(uni_count)",
"+print((len(set(S))))"
] | false | 0.045759 | 0.045417 | 1.007548 | [
"s370050086",
"s074308077"
] |
u912237403 | p00055 | python | s403087159 | s812196782 | 20 | 10 | 4,212 | 4,204 | Accepted | Accepted | 50 | import sys
for x in sys.stdin:
s=a=float(x)
for i in range(9):
if i%2==0: a*=2
else: a/=3
s+=a
print(s) | import sys
for x in sys.stdin:
a=float(x)
s=a
for i in range(9):
if i%2: a/=3
else: a*=2
s+=a
print(s) | 8 | 9 | 145 | 149 | import sys
for x in sys.stdin:
s = a = float(x)
for i in range(9):
if i % 2 == 0:
a *= 2
else:
a /= 3
s += a
print(s)
| import sys
for x in sys.stdin:
a = float(x)
s = a
for i in range(9):
if i % 2:
a /= 3
else:
a *= 2
s += a
print(s)
| false | 11.111111 | [
"- s = a = float(x)",
"+ a = float(x)",
"+ s = a",
"- if i % 2 == 0:",
"+ if i % 2:",
"+ a /= 3",
"+ else:",
"- else:",
"- a /= 3"
] | false | 0.172438 | 0.038508 | 4.478032 | [
"s403087159",
"s812196782"
] |
u021019433 | p03005 | python | s920884484 | s239332947 | 20 | 17 | 2,940 | 2,940 | Accepted | Accepted | 15 | n, k = list(map(int, input().split()))
print(((0, n - k)[k > 1]))
| n, k = list(map(int, input().split()))
print(((n - k) * (k > 1)))
| 2 | 2 | 59 | 59 | n, k = list(map(int, input().split()))
print(((0, n - k)[k > 1]))
| n, k = list(map(int, input().split()))
print(((n - k) * (k > 1)))
| false | 0 | [
"-print(((0, n - k)[k > 1]))",
"+print(((n - k) * (k > 1)))"
] | false | 0.046384 | 0.046232 | 1.003286 | [
"s920884484",
"s239332947"
] |
u037430802 | p02803 | python | s232298732 | s589464122 | 473 | 428 | 3,316 | 3,444 | Accepted | Accepted | 9.51 | H,W = list(map(int,input().split()))
S = [eval(input()) for i in range(H)]
dxy = [(0,1),(1,0),(0,-1),(-1,0)]
from collections import deque
ans = 0
for y in range(H):
for x in range(W):
if S[y][x] == '#': continue
dist = [[0]*W for i in range(H)]
visited = [[0]*W for i in range(H)]... | from collections import deque
H,W = list(map(int, input().split()))
S = [eval(input()) for _ in range(H)]
ans = 0
dyx = [(1,0), (0,1),(-1,0), (0,-1)]
for i in range(H):
for j in range(W):
if S[i][j] == '#': continue
dist = [[0 for _ in range(W)] for _ in range(H)]
visited =... | 31 | 40 | 927 | 1,122 | H, W = list(map(int, input().split()))
S = [eval(input()) for i in range(H)]
dxy = [(0, 1), (1, 0), (0, -1), (-1, 0)]
from collections import deque
ans = 0
for y in range(H):
for x in range(W):
if S[y][x] == "#":
continue
dist = [[0] * W for i in range(H)]
visited = [[0] * W for... | from collections import deque
H, W = list(map(int, input().split()))
S = [eval(input()) for _ in range(H)]
ans = 0
dyx = [(1, 0), (0, 1), (-1, 0), (0, -1)]
for i in range(H):
for j in range(W):
if S[i][j] == "#":
continue
dist = [[0 for _ in range(W)] for _ in range(H)]
visited ... | false | 22.5 | [
"-H, W = list(map(int, input().split()))",
"-S = [eval(input()) for i in range(H)]",
"-dxy = [(0, 1), (1, 0), (0, -1), (-1, 0)]",
"+H, W = list(map(int, input().split()))",
"+S = [eval(input()) for _ in range(H)]",
"-for y in range(H):",
"- for x in range(W):",
"- if S[y][x] == \"#\":",
"+... | false | 0.046128 | 0.049575 | 0.930461 | [
"s232298732",
"s589464122"
] |
u596276291 | p03732 | python | s424118045 | s504330491 | 173 | 158 | 21,120 | 4,204 | Accepted | Accepted | 8.67 | from collections import defaultdict
memo = {}
def dfs(i, w, l, W):
if i >= len(l):
return 0
if (i, w) in memo:
return memo[(i, w)]
# not use
ans = dfs(i + 1, w, l, W)
# use
if w + l[i][0] <= W:
ans = max(ans, dfs(i + 1, w + l[i][0], l, W) + l[i][1])
... | from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.se... | 32 | 52 | 590 | 1,282 | from collections import defaultdict
memo = {}
def dfs(i, w, l, W):
if i >= len(l):
return 0
if (i, w) in memo:
return memo[(i, w)]
# not use
ans = dfs(i + 1, w, l, W)
# use
if w + l[i][0] <= W:
ans = max(ans, dfs(i + 1, w + l[i][0], l, W) + l[i][1])
memo[(i, w)] = ... | from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecurs... | false | 38.461538 | [
"-from collections import defaultdict",
"+from collections import defaultdict, Counter",
"+from itertools import product, groupby, count, permutations, combinations",
"+from math import pi, sqrt",
"+from collections import deque",
"+from bisect import bisect, bisect_left, bisect_right",
"+from string im... | false | 0.048264 | 0.091986 | 0.524685 | [
"s424118045",
"s504330491"
] |
u928784113 | p03073 | python | s040877700 | s559118375 | 57 | 50 | 3,956 | 5,424 | Accepted | Accepted | 12.28 | S = eval(input())
SL = [int(i) for i in S]
SL.append("A")
keepcount = "start"
count = 0
for i in SL:
if keepcount == "start":
keepcount = i
elif keepcount == i:
keepcount = i^1
count += 1
else:
keepcount = i
print(cou... | from collections import deque,defaultdict,Counter
from itertools import accumulate
import bisect
from heapq import heappop,heappush
from fractions import gcd
from copy import deepcopy
import math
Mod = 1000000007
def main(): #startline-------------------------------------------
S = eval(input())
... | 15 | 70 | 317 | 1,756 | S = eval(input())
SL = [int(i) for i in S]
SL.append("A")
keepcount = "start"
count = 0
for i in SL:
if keepcount == "start":
keepcount = i
elif keepcount == i:
keepcount = i ^ 1
count += 1
else:
keepcount = i
print(count)
| from collections import deque, defaultdict, Counter
from itertools import accumulate
import bisect
from heapq import heappop, heappush
from fractions import gcd
from copy import deepcopy
import math
Mod = 1000000007
def main(): # startline-------------------------------------------
S = eval(input())
keep = ... | false | 78.571429 | [
"-S = eval(input())",
"-SL = [int(i) for i in S]",
"-SL.append(\"A\")",
"-keepcount = \"start\"",
"-count = 0",
"-for i in SL:",
"- if keepcount == \"start\":",
"- keepcount = i",
"- elif keepcount == i:",
"- keepcount = i ^ 1",
"- count += 1",
"- else:",
"- ... | false | 0.007556 | 0.089073 | 0.084827 | [
"s040877700",
"s559118375"
] |
u562016607 | p03308 | python | s475874719 | s518783416 | 19 | 17 | 3,060 | 2,940 | Accepted | Accepted | 10.53 | N=int(eval(input()))
A=[int(i) for i in input().split()]
ans=0
for i in range(N):
for j in range(N):
if abs(A[i]-A[j])>ans:
ans=abs(A[i]-A[j])
print(ans)
| N=int(eval(input()))
A=[int(i) for i in input().split()]
print((max(A)-min(A)))
| 8 | 3 | 167 | 74 | N = int(eval(input()))
A = [int(i) for i in input().split()]
ans = 0
for i in range(N):
for j in range(N):
if abs(A[i] - A[j]) > ans:
ans = abs(A[i] - A[j])
print(ans)
| N = int(eval(input()))
A = [int(i) for i in input().split()]
print((max(A) - min(A)))
| false | 62.5 | [
"-ans = 0",
"-for i in range(N):",
"- for j in range(N):",
"- if abs(A[i] - A[j]) > ans:",
"- ans = abs(A[i] - A[j])",
"-print(ans)",
"+print((max(A) - min(A)))"
] | false | 0.041602 | 0.040251 | 1.033554 | [
"s475874719",
"s518783416"
] |
u644907318 | p03403 | python | s800718050 | s982274224 | 368 | 162 | 64,108 | 83,384 | Accepted | Accepted | 55.98 | N = int(eval(input()))
A = list(map(int,input().split()))
A.insert(0,0)
tot = 0
for i in range(1,N+1):
tot += abs(A[i]-A[i-1])
tot += abs(A[0]-A[N])
for i in range(1,N):
a = tot-abs(A[i]-A[i-1])-abs(A[i+1]-A[i])+abs(A[i+1]-A[i-1])
print(a)
a = tot-abs(A[N]-A[N-1])-abs(0-A[N])+abs(0-A[N-1])
print(... | N = int(eval(input()))
A = list(map(int,input().split()))
A.insert(0,0)
tot = abs(A[1])
for i in range(2,N+1):
tot += abs(A[i]-A[i-1])
tot += abs(A[N])
print((tot-abs(A[1])-abs(A[2]-A[1])+abs(A[2])))
for i in range(2,N):
print((tot-abs(A[i]-A[i-1])-abs(A[i+1]-A[i])+abs(A[i+1]-A[i-1])))
print((tot-abs(... | 12 | 11 | 316 | 344 | N = int(eval(input()))
A = list(map(int, input().split()))
A.insert(0, 0)
tot = 0
for i in range(1, N + 1):
tot += abs(A[i] - A[i - 1])
tot += abs(A[0] - A[N])
for i in range(1, N):
a = tot - abs(A[i] - A[i - 1]) - abs(A[i + 1] - A[i]) + abs(A[i + 1] - A[i - 1])
print(a)
a = tot - abs(A[N] - A[N - 1]) - abs... | N = int(eval(input()))
A = list(map(int, input().split()))
A.insert(0, 0)
tot = abs(A[1])
for i in range(2, N + 1):
tot += abs(A[i] - A[i - 1])
tot += abs(A[N])
print((tot - abs(A[1]) - abs(A[2] - A[1]) + abs(A[2])))
for i in range(2, N):
print(
(tot - abs(A[i] - A[i - 1]) - abs(A[i + 1] - A[i]) + abs(A... | false | 8.333333 | [
"-tot = 0",
"-for i in range(1, N + 1):",
"+tot = abs(A[1])",
"+for i in range(2, N + 1):",
"-tot += abs(A[0] - A[N])",
"-for i in range(1, N):",
"- a = tot - abs(A[i] - A[i - 1]) - abs(A[i + 1] - A[i]) + abs(A[i + 1] - A[i - 1])",
"- print(a)",
"-a = tot - abs(A[N] - A[N - 1]) - abs(0 - A[N])... | false | 0.042972 | 0.14578 | 0.294771 | [
"s800718050",
"s982274224"
] |
u983918956 | p02852 | python | s955221123 | s414074191 | 1,974 | 558 | 26,084 | 68,664 | Accepted | Accepted | 71.73 | import sys
input = sys.stdin.readline
inf = float('inf')
# 一点更新 区間取得 1-indexed
class SegmentTree:
def __init__(self, n):
tmp = 1
while tmp < n:
tmp <<= 1
# self.N : 完全二分木の葉の数(N以上の最小の2べき)
self.N = tmp
# 2*self.N - 1 : 完全二分木のノード数
# 1-indexedで... | inf = float('inf')
# 一点更新 区間取得 1-indexed
class SegmentTree:
def __init__(self, n):
tmp = 1
while tmp < n:
tmp <<= 1
# self.N : 完全二分木の葉の数(N以上の最小の2べき)
self.N = tmp
# 2*self.N - 1 : 完全二分木のノード数
# 1-indexedで管理するので1つ余分に設ける
self.Data = [(inf,... | 81 | 78 | 1,783 | 1,741 | import sys
input = sys.stdin.readline
inf = float("inf")
# 一点更新 区間取得 1-indexed
class SegmentTree:
def __init__(self, n):
tmp = 1
while tmp < n:
tmp <<= 1
# self.N : 完全二分木の葉の数(N以上の最小の2べき)
self.N = tmp
# 2*self.N - 1 : 完全二分木のノード数
# 1-indexedで管理するので1つ余分に設ける
... | inf = float("inf")
# 一点更新 区間取得 1-indexed
class SegmentTree:
def __init__(self, n):
tmp = 1
while tmp < n:
tmp <<= 1
# self.N : 完全二分木の葉の数(N以上の最小の2べき)
self.N = tmp
# 2*self.N - 1 : 完全二分木のノード数
# 1-indexedで管理するので1つ余分に設ける
self.Data = [(inf, -1) for _ in... | false | 3.703704 | [
"-import sys",
"-",
"-input = sys.stdin.readline"
] | false | 0.042265 | 0.040394 | 1.046313 | [
"s955221123",
"s414074191"
] |
u766684188 | p03099 | python | s646902992 | s135955810 | 4,696 | 1,829 | 121,432 | 122,076 | Accepted | Accepted | 61.05 | import sys
input=sys.stdin.readline
sys.setrecursionlimit(10**9)
from bisect import bisect_left,bisect_right
class MinCostFlow:
def __init__(self,n):
self.n=n
self.edges=[[] for i in range(n)]
def add_edge(self,fr,to,cap,cost):
self.edges[fr].append([to,cap,cost,len(self.edges... | import sys
input=sys.stdin.readline
sys.setrecursionlimit(10**9)
from collections import deque
from bisect import bisect_left,bisect_right
class MinCostFlow:
def __init__(self,n):
self.n=n
self.edges=[[] for i in range(n)]
def add_edge(self,fr,to,cap,cost):
self.edges[fr].app... | 110 | 111 | 3,102 | 3,138 | import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**9)
from bisect import bisect_left, bisect_right
class MinCostFlow:
def __init__(self, n):
self.n = n
self.edges = [[] for i in range(n)]
def add_edge(self, fr, to, cap, cost):
self.edges[fr].append([to, cap, cost, len(se... | import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**9)
from collections import deque
from bisect import bisect_left, bisect_right
class MinCostFlow:
def __init__(self, n):
self.n = n
self.edges = [[] for i in range(n)]
def add_edge(self, fr, to, cap, cost):
self.edges[fr]... | false | 0.900901 | [
"+from collections import deque",
"- n, E = self.n, self.edges",
"- prev_v, prev_e = [0] * n, [0] * n",
"+ n = self.n",
"+ E = self.edges",
"+ prev_v = [0] * n",
"+ prev_e = [0] * n",
"- flag = True",
"- while flag:",
"- ... | false | 0.047905 | 0.037467 | 1.278581 | [
"s646902992",
"s135955810"
] |
u353919145 | p02835 | python | s372097988 | s969977950 | 19 | 17 | 2,940 | 2,940 | Accepted | Accepted | 10.53 | a,b,c=[int(x) for x in input().split()]
if a+b+c>=22:
print('bust')
else:
print('win')
| a=list(map(int,input().split()))
if(sum(a)>=22):
print("bust")
else:
print("win") | 7 | 5 | 103 | 93 | a, b, c = [int(x) for x in input().split()]
if a + b + c >= 22:
print("bust")
else:
print("win")
| a = list(map(int, input().split()))
if sum(a) >= 22:
print("bust")
else:
print("win")
| false | 28.571429 | [
"-a, b, c = [int(x) for x in input().split()]",
"-if a + b + c >= 22:",
"+a = list(map(int, input().split()))",
"+if sum(a) >= 22:"
] | false | 0.046796 | 0.046397 | 1.008614 | [
"s372097988",
"s969977950"
] |
u809819902 | p02699 | python | s164098225 | s708589196 | 29 | 25 | 9,152 | 9,152 | Accepted | Accepted | 13.79 | s,w = list(map(int, input().split()))
print(("unsafe" if s <= w else "safe")) | s,w=list(map(int,input().split()))
print(("unsafe" if w>=s else "safe")) | 2 | 2 | 70 | 65 | s, w = list(map(int, input().split()))
print(("unsafe" if s <= w else "safe"))
| s, w = list(map(int, input().split()))
print(("unsafe" if w >= s else "safe"))
| false | 0 | [
"-print((\"unsafe\" if s <= w else \"safe\"))",
"+print((\"unsafe\" if w >= s else \"safe\"))"
] | false | 0.057571 | 0.069877 | 0.823889 | [
"s164098225",
"s708589196"
] |
u548252256 | p02412 | python | s244817642 | s146981234 | 740 | 470 | 31,296 | 5,604 | Accepted | Accepted | 36.49 | import itertools
while True:
n,x = list(map(int,input().split(" ")))
if n == 0 and x == 0:
break
#データリスト作成
data = [m for m in range(1,n+1)]
data_cmb = list(itertools.combinations(data,3))
#検証
res = [ret for ret in data_cmb if sum(ret) == x]
print((len(res)))
| while True:
n,x = list(map(int,input().split(" ")))
if n == 0 and x == 0:
break
#データリスト作成
data = [m for m in range(1,n+1)]
data_list = []
cnt = 0
#n種類の数字があって、xになる組み合わせは?
for i in range(1,n+1):
for j in range(1+i,n+1):
for k in range(1+j,n+1):
if i+j+k == x:
cnt += 1
print(cn... | 16 | 19 | 281 | 319 | import itertools
while True:
n, x = list(map(int, input().split(" ")))
if n == 0 and x == 0:
break
# データリスト作成
data = [m for m in range(1, n + 1)]
data_cmb = list(itertools.combinations(data, 3))
# 検証
res = [ret for ret in data_cmb if sum(ret) == x]
print((len(res)))
| while True:
n, x = list(map(int, input().split(" ")))
if n == 0 and x == 0:
break
# データリスト作成
data = [m for m in range(1, n + 1)]
data_list = []
cnt = 0
# n種類の数字があって、xになる組み合わせは?
for i in range(1, n + 1):
for j in range(1 + i, n + 1):
for k in range(1 + j, n + 1... | false | 15.789474 | [
"-import itertools",
"-",
"- data_cmb = list(itertools.combinations(data, 3))",
"- # 検証",
"- res = [ret for ret in data_cmb if sum(ret) == x]",
"- print((len(res)))",
"+ data_list = []",
"+ cnt = 0",
"+ # n種類の数字があって、xになる組み合わせは?",
"+ for i in range(1, n + 1):",
"+ f... | false | 0.059009 | 0.058215 | 1.013635 | [
"s244817642",
"s146981234"
] |
u141574039 | p02646 | python | s904415781 | s697754117 | 32 | 28 | 9,120 | 9,112 | Accepted | Accepted | 12.5 | A,V=list(map(int,input().split()))
B,W=list(map(int,input().split()))
T=int(eval(input()))
if W>=V:
print("NO")
else:
if abs(A-B)/(V-W)<=T:
print("YES")
else:
print("NO") | A,V=list(map(int,input().split()))
B,W=list(map(int,input().split()))
T=int(eval(input()))
if W>=V:
print("NO")
else:
if abs(A-B)<=(V-W)*T:
print("YES")
else:
print("NO") | 10 | 10 | 175 | 175 | A, V = list(map(int, input().split()))
B, W = list(map(int, input().split()))
T = int(eval(input()))
if W >= V:
print("NO")
else:
if abs(A - B) / (V - W) <= T:
print("YES")
else:
print("NO")
| A, V = list(map(int, input().split()))
B, W = list(map(int, input().split()))
T = int(eval(input()))
if W >= V:
print("NO")
else:
if abs(A - B) <= (V - W) * T:
print("YES")
else:
print("NO")
| false | 0 | [
"- if abs(A - B) / (V - W) <= T:",
"+ if abs(A - B) <= (V - W) * T:"
] | false | 0.007486 | 0.080891 | 0.092546 | [
"s904415781",
"s697754117"
] |
u241159583 | p02813 | python | s609679031 | s311084663 | 115 | 29 | 9,548 | 3,064 | Accepted | Accepted | 74.78 | N = int(eval(input()))
P = list(map(int, input().split()))
Q = list(map(int, input().split()))
l = list(range(1, N+1))
import itertools
L = list(itertools.permutations(l))
jisyo = []
for i in range(len(L)):
n = 0
for j in range(N):
n = n * 10 + L[i][j]
jisyo.append(n)
p = 0
q = 0
for x in ... | import itertools
n = int(eval(input()))
p = tuple(map(int, input().split()))
q = tuple(map(int, input().split()))
cnt = 0
for v in itertools.permutations(list(range(1,n+1))):
cnt += 1
if p == v: a = cnt
if q == v: b = cnt
print((abs(a-b))) | 22 | 10 | 412 | 252 | N = int(eval(input()))
P = list(map(int, input().split()))
Q = list(map(int, input().split()))
l = list(range(1, N + 1))
import itertools
L = list(itertools.permutations(l))
jisyo = []
for i in range(len(L)):
n = 0
for j in range(N):
n = n * 10 + L[i][j]
jisyo.append(n)
p = 0
q = 0
for x in range(N... | import itertools
n = int(eval(input()))
p = tuple(map(int, input().split()))
q = tuple(map(int, input().split()))
cnt = 0
for v in itertools.permutations(list(range(1, n + 1))):
cnt += 1
if p == v:
a = cnt
if q == v:
b = cnt
print((abs(a - b)))
| false | 54.545455 | [
"-N = int(eval(input()))",
"-P = list(map(int, input().split()))",
"-Q = list(map(int, input().split()))",
"-l = list(range(1, N + 1))",
"-L = list(itertools.permutations(l))",
"-jisyo = []",
"-for i in range(len(L)):",
"- n = 0",
"- for j in range(N):",
"- n = n * 10 + L[i][j]",
"-... | false | 0.083397 | 0.122859 | 0.678803 | [
"s609679031",
"s311084663"
] |
u573754721 | p02887 | python | s315139037 | s743349495 | 47 | 34 | 4,652 | 4,056 | Accepted | Accepted | 27.66 | n=int(eval(input()))
s=list(eval(input()))
latest=0
L=[]
for i in range(n):
if s[i]!=latest:
L.append(s[i])
latest=s[i]
print((len(L))) | n=int(eval(input()))
s=eval(input())
L=[s[0]]
bef=s[0]
for i in s[1:]:
if i!=bef:
L.append(i)
bef=i
print((len(L)))
| 10 | 10 | 161 | 136 | n = int(eval(input()))
s = list(eval(input()))
latest = 0
L = []
for i in range(n):
if s[i] != latest:
L.append(s[i])
latest = s[i]
print((len(L)))
| n = int(eval(input()))
s = eval(input())
L = [s[0]]
bef = s[0]
for i in s[1:]:
if i != bef:
L.append(i)
bef = i
print((len(L)))
| false | 0 | [
"-s = list(eval(input()))",
"-latest = 0",
"-L = []",
"-for i in range(n):",
"- if s[i] != latest:",
"- L.append(s[i])",
"- latest = s[i]",
"+s = eval(input())",
"+L = [s[0]]",
"+bef = s[0]",
"+for i in s[1:]:",
"+ if i != bef:",
"+ L.append(i)",
"+ bef = i"
] | false | 0.048364 | 0.034674 | 1.394845 | [
"s315139037",
"s743349495"
] |
u072053884 | p00481 | python | s723247360 | s641548087 | 6,450 | 2,530 | 22,604 | 14,728 | Accepted | Accepted | 60.78 | import sys
file_input = sys.stdin
H, W, N = list(map(int, file_input.readline().split()))
town_map = file_input.read()
start_index = town_map.index('S')
mouse = [start_index, 0]
# position, elapsed time
from collections import deque
for goal in range(1, N + 1):
q = deque()
unvisited = [T... | import sys
file_input = sys.stdin
H, W, N = list(map(int, file_input.readline().split()))
town_map = 'X' * (W + 2)
for line in file_input:
town_map += 'X' + line.rstrip() + 'X'
town_map += 'X' * (W + 2)
move = (1, -1, W + 2, -W - 2)
from collections import deque
def search(start_pos, goal_lot):... | 73 | 44 | 2,272 | 1,136 | import sys
file_input = sys.stdin
H, W, N = list(map(int, file_input.readline().split()))
town_map = file_input.read()
start_index = town_map.index("S")
mouse = [start_index, 0]
# position, elapsed time
from collections import deque
for goal in range(1, N + 1):
q = deque()
unvisited = [True] * len(town_map)
... | import sys
file_input = sys.stdin
H, W, N = list(map(int, file_input.readline().split()))
town_map = "X" * (W + 2)
for line in file_input:
town_map += "X" + line.rstrip() + "X"
town_map += "X" * (W + 2)
move = (1, -1, W + 2, -W - 2)
from collections import deque
def search(start_pos, goal_lot):
mouse = [star... | false | 39.726027 | [
"-town_map = file_input.read()",
"-start_index = town_map.index(\"S\")",
"-mouse = [start_index, 0]",
"-# position, elapsed time",
"+town_map = \"X\" * (W + 2)",
"+for line in file_input:",
"+ town_map += \"X\" + line.rstrip() + \"X\"",
"+town_map += \"X\" * (W + 2)",
"+move = (1, -1, W + 2, -W -... | false | 0.038738 | 0.03898 | 0.993786 | [
"s723247360",
"s641548087"
] |
u226108478 | p03283 | python | s246112377 | s282241022 | 1,971 | 1,263 | 78,424 | 80,008 | Accepted | Accepted | 35.92 | # -*- coding: utf-8 -*-
def main():
n, m, q = list(map(int, input().split()))
lr = [[0 for _ in range(n + 1)] for _ in range(n + 1)]
c = [[0 for _ in range(n + 1)] for _ in range(n + 1)]
for _ in range(m):
li, ri = list(map(int, input().split()))
lr[li][ri] += 1
for i... | # -*- coding: utf-8 -*-
def main():
n, m, q = list(map(int, input().split()))
summed = [[0 for _ in range(n + 1)] for _ in range(n + 1)]
for _ in range(m):
li, ri = list(map(int, input().split()))
summed[li][ri] += 1
for i in range(1, n + 1):
for j in range(1, n +... | 32 | 29 | 710 | 754 | # -*- coding: utf-8 -*-
def main():
n, m, q = list(map(int, input().split()))
lr = [[0 for _ in range(n + 1)] for _ in range(n + 1)]
c = [[0 for _ in range(n + 1)] for _ in range(n + 1)]
for _ in range(m):
li, ri = list(map(int, input().split()))
lr[li][ri] += 1
for i in range(n + 1)... | # -*- coding: utf-8 -*-
def main():
n, m, q = list(map(int, input().split()))
summed = [[0 for _ in range(n + 1)] for _ in range(n + 1)]
for _ in range(m):
li, ri = list(map(int, input().split()))
summed[li][ri] += 1
for i in range(1, n + 1):
for j in range(1, n + 1):
... | false | 9.375 | [
"- lr = [[0 for _ in range(n + 1)] for _ in range(n + 1)]",
"- c = [[0 for _ in range(n + 1)] for _ in range(n + 1)]",
"+ summed = [[0 for _ in range(n + 1)] for _ in range(n + 1)]",
"- lr[li][ri] += 1",
"- for i in range(n + 1):",
"- for j in range(n + 1):",
"- c[i]... | false | 0.046391 | 0.037511 | 1.236743 | [
"s246112377",
"s282241022"
] |
u185896732 | p03240 | python | s719036856 | s998339362 | 197 | 39 | 40,560 | 3,836 | Accepted | Accepted | 80.2 | import os,re,sys,operator
from collections import Counter,deque
from operator import itemgetter
from itertools import accumulate,combinations,groupby
from sys import stdin,setrecursionlimit
from copy import deepcopy
setrecursionlimit(10**6)
n=int(eval(input()))
x=sorted([[int(i) for i in input().split()] for ... | #import pysnooper
import os,re,sys,operator,math,heapq,string
#from collections import Counter,deque
#from operator import itemgetter
#from itertools import accumulate,combinations,groupby,combinations_with_replacement
from sys import stdin,setrecursionlimit
#from copy import deepcopy
setrecursionlimit(10**6)
i... | 21 | 24 | 664 | 744 | import os, re, sys, operator
from collections import Counter, deque
from operator import itemgetter
from itertools import accumulate, combinations, groupby
from sys import stdin, setrecursionlimit
from copy import deepcopy
setrecursionlimit(10**6)
n = int(eval(input()))
x = sorted(
[[int(i) for i in input().split(... | # import pysnooper
import os, re, sys, operator, math, heapq, string
# from collections import Counter,deque
# from operator import itemgetter
# from itertools import accumulate,combinations,groupby,combinations_with_replacement
from sys import stdin, setrecursionlimit
# from copy import deepcopy
setrecursionlimit(10... | false | 12.5 | [
"-import os, re, sys, operator",
"-from collections import Counter, deque",
"-from operator import itemgetter",
"-from itertools import accumulate, combinations, groupby",
"+# import pysnooper",
"+import os, re, sys, operator, math, heapq, string",
"+",
"+# from collections import Counter,deque",
"+... | false | 0.084 | 0.039172 | 2.144419 | [
"s719036856",
"s998339362"
] |
u832039789 | p03808 | python | s680487691 | s166716076 | 92 | 64 | 14,492 | 14,228 | Accepted | Accepted | 30.43 | n = int(eval(input()))
a = list(map(int,input().split()))
s = sum(a)
one = n * (n+1) // 2
if s % one:
print('NO')
exit()
times = s // one
cnt = 0
b = a[1:]+[a[0]]
for i,j in zip(a,b):
dif = j - i
if (times - dif) % n:
print('NO')
exit()
if (times-dif) // n < 0:
... | N = int(eval(input()))
A = list(map(int,input().split()))
def solve():
q = N * (N + 1) // 2
if sum(A) % q:
return False
times = sum(A) // q
cnt = 0
for i, j in zip(A, A[1:] + [A[0]]):
dif = times + i - j
if dif % N or dif < 0:
return False
cn... | 25 | 17 | 437 | 390 | n = int(eval(input()))
a = list(map(int, input().split()))
s = sum(a)
one = n * (n + 1) // 2
if s % one:
print("NO")
exit()
times = s // one
cnt = 0
b = a[1:] + [a[0]]
for i, j in zip(a, b):
dif = j - i
if (times - dif) % n:
print("NO")
exit()
if (times - dif) // n < 0:
print... | N = int(eval(input()))
A = list(map(int, input().split()))
def solve():
q = N * (N + 1) // 2
if sum(A) % q:
return False
times = sum(A) // q
cnt = 0
for i, j in zip(A, A[1:] + [A[0]]):
dif = times + i - j
if dif % N or dif < 0:
return False
cnt += dif //... | false | 32 | [
"-n = int(eval(input()))",
"-a = list(map(int, input().split()))",
"-s = sum(a)",
"-one = n * (n + 1) // 2",
"-if s % one:",
"- print(\"NO\")",
"- exit()",
"-times = s // one",
"-cnt = 0",
"-b = a[1:] + [a[0]]",
"-for i, j in zip(a, b):",
"- dif = j - i",
"- if (times - dif) % n:... | false | 0.078696 | 0.13268 | 0.593127 | [
"s680487691",
"s166716076"
] |
u713492631 | p03060 | python | s054373395 | s057400145 | 227 | 18 | 3,064 | 3,060 | Accepted | Accepted | 92.07 | # coding: utf-8
from itertools import combinations, chain
N = int(eval(input()))
values = list(map(int, input().split()))
costs = list(map(int, input().split()))
sales = [v - c for v, c in zip(values, costs)]
print((max(chain.from_iterable(list(map(sum, combinations(sales, i))) for i in range(0, N+1)))))
| n = int(input().strip())
values = list(map(int, input().split()))
costs = list(map(int, input().split()))
sales = [v - c for v, c in zip(values, costs) if v > c]
print((sum(sales))) | 11 | 7 | 294 | 189 | # coding: utf-8
from itertools import combinations, chain
N = int(eval(input()))
values = list(map(int, input().split()))
costs = list(map(int, input().split()))
sales = [v - c for v, c in zip(values, costs)]
print(
(
max(
chain.from_iterable(
list(map(sum, combinations(sales, i... | n = int(input().strip())
values = list(map(int, input().split()))
costs = list(map(int, input().split()))
sales = [v - c for v, c in zip(values, costs) if v > c]
print((sum(sales)))
| false | 36.363636 | [
"-# coding: utf-8",
"-from itertools import combinations, chain",
"-",
"-N = int(eval(input()))",
"+n = int(input().strip())",
"-sales = [v - c for v, c in zip(values, costs)]",
"-print(",
"- (",
"- max(",
"- chain.from_iterable(",
"- list(map(sum, combination... | false | 0.041803 | 0.036272 | 1.152486 | [
"s054373395",
"s057400145"
] |
u411858517 | p03290 | python | s957559497 | s040153155 | 581 | 52 | 11,508 | 3,188 | Accepted | Accepted | 91.05 | import itertools
from collections import Counter
D, G = list(map(int, input().split()))
P = [list(map(int, input().split())) for i in range(D)]
min_num = 10**8
judge_list = list(itertools.product([0, 1, 2], repeat=D)) #0:中途半端に解く 1:一問も解かない 2: 全部解く
for judge in judge_list:
score = 0
num = 0
d =... | import itertools
D, G = list(map(int, input().split()))
L = [list(map(int, input().split())) for _ in range(D)]
num = D #生成するビット数
bit_list = list(itertools.product([0, 1], repeat=num))
tmp = 10 ** 6
for bit in bit_list:
count = 0
num = 0
for i in range(D):
if bit[i] == 1:
... | 37 | 34 | 1,005 | 840 | import itertools
from collections import Counter
D, G = list(map(int, input().split()))
P = [list(map(int, input().split())) for i in range(D)]
min_num = 10**8
judge_list = list(itertools.product([0, 1, 2], repeat=D)) # 0:中途半端に解く 1:一問も解かない 2: 全部解く
for judge in judge_list:
score = 0
num = 0
d = Counter() ... | import itertools
D, G = list(map(int, input().split()))
L = [list(map(int, input().split())) for _ in range(D)]
num = D # 生成するビット数
bit_list = list(itertools.product([0, 1], repeat=num))
tmp = 10**6
for bit in bit_list:
count = 0
num = 0
for i in range(D):
if bit[i] == 1:
count += L[i][... | false | 8.108108 | [
"-from collections import Counter",
"-P = [list(map(int, input().split())) for i in range(D)]",
"-min_num = 10**8",
"-judge_list = list(itertools.product([0, 1, 2], repeat=D)) # 0:中途半端に解く 1:一問も解かない 2: 全部解く",
"-for judge in judge_list:",
"- score = 0",
"+L = [list(map(int, input().split())) for _ in ... | false | 0.046904 | 0.037761 | 1.242129 | [
"s957559497",
"s040153155"
] |
u689890477 | p02681 | python | s623433835 | s467920355 | 25 | 23 | 9,036 | 9,052 | Accepted | Accepted | 8 | s = eval(input())
t = eval(input())
num = len(t)
if s == t[:num-1]:
print("Yes")
else:
print("No") | s = list(eval(input()))
t = list(eval(input()))
if s == t[:-1]:
print("Yes")
else:
print("No")
| 7 | 7 | 100 | 99 | s = eval(input())
t = eval(input())
num = len(t)
if s == t[: num - 1]:
print("Yes")
else:
print("No")
| s = list(eval(input()))
t = list(eval(input()))
if s == t[:-1]:
print("Yes")
else:
print("No")
| false | 0 | [
"-s = eval(input())",
"-t = eval(input())",
"-num = len(t)",
"-if s == t[: num - 1]:",
"+s = list(eval(input()))",
"+t = list(eval(input()))",
"+if s == t[:-1]:"
] | false | 0.046966 | 0.047766 | 0.98325 | [
"s623433835",
"s467920355"
] |
u156815136 | p02756 | python | s443086021 | s729758524 | 680 | 344 | 5,972 | 17,644 | Accepted | Accepted | 49.41 | from collections import deque
d = deque([])
ans = eval(input())
d.append(ans)
q = int(eval(input()))
rev = True # Trueなら後ろに # Falseなら前に
for i in range(q):
Query = list(map(str,input().split()))
if Query[0] == '2':
if Query[1] == '1':
if rev:
d.append(Query[2])
... | #from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations,accumulate # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counte... | 28 | 54 | 651 | 1,213 | from collections import deque
d = deque([])
ans = eval(input())
d.append(ans)
q = int(eval(input()))
rev = True # Trueなら後ろに # Falseなら前に
for i in range(q):
Query = list(map(str, input().split()))
if Query[0] == "2":
if Query[1] == "1":
if rev:
d.append(Query[2])
... | # from statistics import median
# import collections
# aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations, permutations, accumulate # (string,3) 3回
# from collections import deque
from collections import deque, defaultdict, Co... | false | 48.148148 | [
"-from collections import deque",
"+# from statistics import median",
"+# import collections",
"+# aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]",
"+from fractions import gcd",
"+from itertools import combinations, permutations, accumulate # (string,3) 3回",
"-d = deq... | false | 0.039202 | 0.007971 | 4.91816 | [
"s443086021",
"s729758524"
] |
u391731808 | p03576 | python | s775883181 | s274368776 | 101 | 87 | 3,064 | 3,064 | Accepted | Accepted | 13.86 | N,K = list(map(int,input().split()))
XY = [list(map(int,input().split())) for _ in [0]*N]
iX = sorted(x for x,y in XY)
iY = sorted(y for x,y in XY)
X = {x:i for i,x in enumerate(iX)}
Y = {y:i for i,y in enumerate(iY)}
c = [[0]*(N+1) for i in [0]*(N+1)]
for x,y in XY:
c[Y[y]+1][X[x]+1] = 1
for i in ra... | N,K = list(map(int,input().split()))
XY = [list(map(int,input().split())) for _ in [0]*N]
iX = sorted(x for x,y in XY)
iY = sorted(y for x,y in XY)
X = {x:i for i,x in enumerate(iX)}
Y = {y:i for i,y in enumerate(iY)}
c = [[0]*(N+1) for i in [0]*(N+1)]
for x,y in XY:
c[Y[y]+1][X[x]+1] = 1
for i in ra... | 32 | 37 | 769 | 837 | N, K = list(map(int, input().split()))
XY = [list(map(int, input().split())) for _ in [0] * N]
iX = sorted(x for x, y in XY)
iY = sorted(y for x, y in XY)
X = {x: i for i, x in enumerate(iX)}
Y = {y: i for i, y in enumerate(iY)}
c = [[0] * (N + 1) for i in [0] * (N + 1)]
for x, y in XY:
c[Y[y] + 1][X[x] + 1] = 1
fo... | N, K = list(map(int, input().split()))
XY = [list(map(int, input().split())) for _ in [0] * N]
iX = sorted(x for x, y in XY)
iY = sorted(y for x, y in XY)
X = {x: i for i, x in enumerate(iX)}
Y = {y: i for i, y in enumerate(iY)}
c = [[0] * (N + 1) for i in [0] * (N + 1)]
for x, y in XY:
c[Y[y] + 1][X[x] + 1] = 1
fo... | false | 13.513514 | [
"+ ci1 = c[i + 1]",
"- c[i + 1][j + 1] += c[i + 1][j]",
"+ ci1[j + 1] += ci1[j]",
"+ ci1 = c[i + 1]",
"+ ci = c[i]",
"- c[i + 1][j + 1] += c[i][j + 1]",
"+ ci1[j + 1] += ci[j + 1]",
"-for l in range(N):",
"- for r in range(l + 1, N):",
"- u = 0",
"-... | false | 0.043222 | 0.140129 | 0.308444 | [
"s775883181",
"s274368776"
] |
u653931433 | p02659 | python | s754195581 | s861964806 | 26 | 23 | 10,048 | 9,164 | Accepted | Accepted | 11.54 | from decimal import*
a,b=list(map(Decimal,input().split()))
print((int(a*b))) | a,b = input().split()
b = int(float(b)*100+0.5)
print((int(a)*b//100)) | 3 | 3 | 71 | 70 | from decimal import *
a, b = list(map(Decimal, input().split()))
print((int(a * b)))
| a, b = input().split()
b = int(float(b) * 100 + 0.5)
print((int(a) * b // 100))
| false | 0 | [
"-from decimal import *",
"-",
"-a, b = list(map(Decimal, input().split()))",
"-print((int(a * b)))",
"+a, b = input().split()",
"+b = int(float(b) * 100 + 0.5)",
"+print((int(a) * b // 100))"
] | false | 0.038104 | 0.036738 | 1.037199 | [
"s754195581",
"s861964806"
] |
u332906195 | p03553 | python | s433359359 | s439690326 | 285 | 26 | 50,028 | 3,572 | Accepted | Accepted | 90.88 | # -*- coding: utf-8 -*-
import copy
import queue
N = int(eval(input()))
a_list = list(map(int, input().split()))
gain = sum([a for a in a_list if a > 0])
# Flow network
S = 0
T = N + 1
c = [{} for i in range(N + 2)]
for i, a in enumerate(a_list):
index = i + 1
if a <= 0:
c[S][index]... | import copy
import collections
N = int(eval(input()))
A = list(map(int, input().split()))
gain = sum([max(a, 0) for a in A])
# Flow network
S, T = 0, N + 1
c = [{} for i in range(N + 2)]
for i in range(N):
ix = i + 1
if A[i] <= 0:
c[S][ix] = -A[i]
else:
c[ix][T] = A[i]
... | 60 | 57 | 1,411 | 1,358 | # -*- coding: utf-8 -*-
import copy
import queue
N = int(eval(input()))
a_list = list(map(int, input().split()))
gain = sum([a for a in a_list if a > 0])
# Flow network
S = 0
T = N + 1
c = [{} for i in range(N + 2)]
for i, a in enumerate(a_list):
index = i + 1
if a <= 0:
c[S][index] = -a
else:
... | import copy
import collections
N = int(eval(input()))
A = list(map(int, input().split()))
gain = sum([max(a, 0) for a in A])
# Flow network
S, T = 0, N + 1
c = [{} for i in range(N + 2)]
for i in range(N):
ix = i + 1
if A[i] <= 0:
c[S][ix] = -A[i]
else:
c[ix][T] = A[i]
for j in range(2 ... | false | 5 | [
"-# -*- coding: utf-8 -*-",
"-import queue",
"+import collections",
"-a_list = list(map(int, input().split()))",
"-gain = sum([a for a in a_list if a > 0])",
"+A = list(map(int, input().split()))",
"+gain = sum([max(a, 0) for a in A])",
"-S = 0",
"-T = N + 1",
"+S, T = 0, N + 1",
"-for i, a in e... | false | 0.037084 | 0.042967 | 0.86308 | [
"s433359359",
"s439690326"
] |
u630546605 | p00001 | python | s793953125 | s013491427 | 30 | 10 | 6,720 | 4,652 | Accepted | Accepted | 66.67 | # Python 3+
#-------------------------------------------------------------------------------
import sys
#ff = open("test.txt", "r")
ff = sys.stdin
arr = [ int(x) for x in ff.readlines() ]
arr.sort(reverse=True)
for x in arr[0:3] : print(x) |
cnt = 10
top3 = [0,0,0]
for x in range(cnt):
n = int( input() )
if top3[2] > n: continue
top3[2] = n
if top3[1] > top3[2]: continue
top3[1], top3[2] = top3[2], top3[1]
if top3[0] > top3[1]: continue
top3[0], top3[1] = top3[1], top3[0]
print(top3[0])
print(top3[1])
pri... | 12 | 20 | 254 | 336 | # Python 3+
# -------------------------------------------------------------------------------
import sys
# ff = open("test.txt", "r")
ff = sys.stdin
arr = [int(x) for x in ff.readlines()]
arr.sort(reverse=True)
for x in arr[0:3]:
print(x)
| cnt = 10
top3 = [0, 0, 0]
for x in range(cnt):
n = int(input())
if top3[2] > n:
continue
top3[2] = n
if top3[1] > top3[2]:
continue
top3[1], top3[2] = top3[2], top3[1]
if top3[0] > top3[1]:
continue
top3[0], top3[1] = top3[1], top3[0]
print(top3[0])
print(top3[1])
pri... | false | 40 | [
"-# Python 3+",
"-import sys",
"-",
"-# ff = open(\"test.txt\", \"r\")",
"-ff = sys.stdin",
"-arr = [int(x) for x in ff.readlines()]",
"-arr.sort(reverse=True)",
"-for x in arr[0:3]:",
"- print(x)",
"+cnt = 10",
"+top3 = [0, 0, 0]",
"+for x in range(cnt):",
"+ n = int(input())",
"+ ... | false | 0.036107 | 0.055492 | 0.650667 | [
"s793953125",
"s013491427"
] |
u798260206 | p02678 | python | s558260853 | s030677365 | 1,426 | 615 | 35,256 | 35,440 | Accepted | Accepted | 56.87 | n,m = list(map(int,input().split()))
map_li = [[] for i in range(n)]
for i in range(m):
a,b = list(map(int,input().split()))
a,b = a-1,b-1
map_li[a].append(b)
map_li[b].append(a)
ans_li = [-1]*n
queue=[0]
visited = [False]*n
while queue:
x = queue.pop(0)
for g in map_li[x]:
... | from collections import deque
n,m = list(map(int,input().split()))
map_li = [[] for i in range(n)]
for i in range(m):
a,b = list(map(int,input().split()))
a,b = a-1,b-1
map_li[a].append(b)
map_li[b].append(a)
ans_li = [-1]*n
queue=deque([0])
visited = [False]*n
while queue:
x = queue... | 26 | 27 | 570 | 612 | n, m = list(map(int, input().split()))
map_li = [[] for i in range(n)]
for i in range(m):
a, b = list(map(int, input().split()))
a, b = a - 1, b - 1
map_li[a].append(b)
map_li[b].append(a)
ans_li = [-1] * n
queue = [0]
visited = [False] * n
while queue:
x = queue.pop(0)
for g in map_li[x]:
... | from collections import deque
n, m = list(map(int, input().split()))
map_li = [[] for i in range(n)]
for i in range(m):
a, b = list(map(int, input().split()))
a, b = a - 1, b - 1
map_li[a].append(b)
map_li[b].append(a)
ans_li = [-1] * n
queue = deque([0])
visited = [False] * n
while queue:
x = queu... | false | 3.703704 | [
"+from collections import deque",
"+",
"-queue = [0]",
"+queue = deque([0])",
"- x = queue.pop(0)",
"+ x = queue.popleft()"
] | false | 0.042304 | 0.035306 | 1.198236 | [
"s558260853",
"s030677365"
] |
u113971909 | p03013 | python | s503687407 | s879728084 | 1,605 | 191 | 9,108 | 13,216 | Accepted | Accepted | 88.1 | N,M=list(map(int,input().split()))
mod = 10**9+7
fram = [1]
for i in range(1,N+1):
fram.append(fram[-1]*i%mod)
#def framod(n, mod, a=1):
# for i in range(1,n+1):
# a = a * i % mod
# return a
def power(n, r, mod):
if r == 0: return 1
if r%2 == 0:
return power(n*n % mod, r//... | #!/usr/bin python3
# -*- coding: utf-8 -*-
def main():
N, M = list(map(int, input().split()))
a = set([int(eval(input())) for i in range(M)])
mod = 10**9+7
#dp[i] iの位置に到達する最小の値
dp = [0]*(N+1)
dp[0] = 1
for i in range(N):
if (i+1)<=N and (not i+1 in a):
dp[i+1... | 37 | 22 | 776 | 507 | N, M = list(map(int, input().split()))
mod = 10**9 + 7
fram = [1]
for i in range(1, N + 1):
fram.append(fram[-1] * i % mod)
# def framod(n, mod, a=1):
# for i in range(1,n+1):
# a = a * i % mod
# return a
def power(n, r, mod):
if r == 0:
return 1
if r % 2 == 0:
return power(n * ... | #!/usr/bin python3
# -*- coding: utf-8 -*-
def main():
N, M = list(map(int, input().split()))
a = set([int(eval(input())) for i in range(M)])
mod = 10**9 + 7
# dp[i] iの位置に到達する最小の値
dp = [0] * (N + 1)
dp[0] = 1
for i in range(N):
if (i + 1) <= N and (not i + 1 in a):
dp[i +... | false | 40.540541 | [
"-N, M = list(map(int, input().split()))",
"-mod = 10**9 + 7",
"-fram = [1]",
"-for i in range(1, N + 1):",
"- fram.append(fram[-1] * i % mod)",
"-# def framod(n, mod, a=1):",
"-# for i in range(1,n+1):",
"-# a = a * i % mod",
"-# return a",
"-def power(n, r, mod):",
"- if r =... | false | 0.064032 | 0.044444 | 1.440749 | [
"s503687407",
"s879728084"
] |
u952708174 | p03293 | python | s100451218 | s149402705 | 20 | 17 | 2,940 | 2,940 | Accepted | Accepted | 15 | S = input().strip()
T = input().strip()
ans = 'No'
for _ in range(len(S)):
S = S[-1] + S[:-1]
if S == T:
ans = 'Yes'
break
print(ans) | S = input().strip()
T = input().strip()
# S+SはSを回転させた文字列のすべてを含む
ans = 'Yes' if T in S+S else 'No'
print(ans) | 9 | 5 | 153 | 112 | S = input().strip()
T = input().strip()
ans = "No"
for _ in range(len(S)):
S = S[-1] + S[:-1]
if S == T:
ans = "Yes"
break
print(ans)
| S = input().strip()
T = input().strip()
# S+SはSを回転させた文字列のすべてを含む
ans = "Yes" if T in S + S else "No"
print(ans)
| false | 44.444444 | [
"-ans = \"No\"",
"-for _ in range(len(S)):",
"- S = S[-1] + S[:-1]",
"- if S == T:",
"- ans = \"Yes\"",
"- break",
"+# S+SはSを回転させた文字列のすべてを含む",
"+ans = \"Yes\" if T in S + S else \"No\""
] | false | 0.043968 | 0.098624 | 0.445812 | [
"s100451218",
"s149402705"
] |
u864197622 | p03033 | python | s276225271 | s774425144 | 1,956 | 476 | 124,380 | 116,604 | Accepted | Accepted | 75.66 | import sys
input = sys.stdin.readline
from heapq import *
N, Q = list(map(int, input().split()))
X = []
for _ in range(N):
s, t, x = list(map(int, input().split()))
X.append((s-x,t-x,x))
X = sorted(X, key = lambda x: x[0])
i = 0
A, B, C = [], [], []
for _ in range(Q):
d = int(eval(input()))
... | import sys
input = sys.stdin.readline
from bisect import bisect_left as bl
class segtree:
def __init__(self, nn):
self.NN = nn
self.XX = [0] * (2**(nn+1)-1)
def getmax(self, i):
j = 2**self.NN + i - 1
ma = -1
while j >= 0:
ma = max(ma, self.XX[j])
... | 26 | 43 | 656 | 1,097 | import sys
input = sys.stdin.readline
from heapq import *
N, Q = list(map(int, input().split()))
X = []
for _ in range(N):
s, t, x = list(map(int, input().split()))
X.append((s - x, t - x, x))
X = sorted(X, key=lambda x: x[0])
i = 0
A, B, C = [], [], []
for _ in range(Q):
d = int(eval(input()))
while ... | import sys
input = sys.stdin.readline
from bisect import bisect_left as bl
class segtree:
def __init__(self, nn):
self.NN = nn
self.XX = [0] * (2 ** (nn + 1) - 1)
def getmax(self, i):
j = 2**self.NN + i - 1
ma = -1
while j >= 0:
ma = max(ma, self.XX[j])
... | false | 39.534884 | [
"-from heapq import *",
"+from bisect import bisect_left as bl",
"+",
"+",
"+class segtree:",
"+ def __init__(self, nn):",
"+ self.NN = nn",
"+ self.XX = [0] * (2 ** (nn + 1) - 1)",
"+",
"+ def getmax(self, i):",
"+ j = 2**self.NN + i - 1",
"+ ma = -1",
"+ ... | false | 0.036399 | 0.095156 | 0.38252 | [
"s276225271",
"s774425144"
] |
u644907318 | p02744 | python | s492426423 | s764691633 | 184 | 168 | 110,300 | 110,152 | Accepted | Accepted | 8.7 | from collections import deque
D1 = {i:chr(i+96) for i in range(1,27)}
D2 = {val:key for key,val in list(D1.items())}
N = int(eval(input()))
heap = deque([(D1[1],1)])
A = []
while heap:
a,n = heap.popleft()
if n<N:
imax = 0
for i in range(len(a)):
imax = max(imax,D2[a[i]]... | from collections import deque
D1 = {i:chr(i+96) for i in range(1,27)}
D2 = {val:key for key,val in list(D1.items())}
N = int(eval(input()))
que = deque([("a",1)])
A = []
while que:
x,n = que.popleft()
if n<N:
imax = 0
for i in range(len(x)):
imax = max(imax,D2[x[i]])
... | 20 | 19 | 497 | 486 | from collections import deque
D1 = {i: chr(i + 96) for i in range(1, 27)}
D2 = {val: key for key, val in list(D1.items())}
N = int(eval(input()))
heap = deque([(D1[1], 1)])
A = []
while heap:
a, n = heap.popleft()
if n < N:
imax = 0
for i in range(len(a)):
imax = max(imax, D2[a[i]])... | from collections import deque
D1 = {i: chr(i + 96) for i in range(1, 27)}
D2 = {val: key for key, val in list(D1.items())}
N = int(eval(input()))
que = deque([("a", 1)])
A = []
while que:
x, n = que.popleft()
if n < N:
imax = 0
for i in range(len(x)):
imax = max(imax, D2[x[i]])
... | false | 5 | [
"-heap = deque([(D1[1], 1)])",
"+que = deque([(\"a\", 1)])",
"-while heap:",
"- a, n = heap.popleft()",
"+while que:",
"+ x, n = que.popleft()",
"- for i in range(len(a)):",
"- imax = max(imax, D2[a[i]])",
"- for i in range(1, min(imax + 1, 26) + 1):",
"- ... | false | 0.043395 | 0.134177 | 0.323416 | [
"s492426423",
"s764691633"
] |
u151037808 | p03855 | python | s156085057 | s403093165 | 1,092 | 910 | 71,428 | 72,940 | Accepted | Accepted | 16.67 | # -*- coding: utf-8 -*-
import sys
from collections import defaultdict
input = sys.stdin.readline
def main():
n, k, l = map(int, input().split())
p, q = [], []
for _ in range(k):
pi, qi = map(int, input().split())
p.append(pi)
q.append(qi)
r, s = [], []
for _ ... | # -*- coding: utf-8 -*-
import sys
from collections import defaultdict
input = sys.stdin.readline
def main():
n, k, l = map(int, input().split())
p, q = [], []
for _ in range(k):
pi, qi = map(int, input().split())
p.append(pi)
q.append(qi)
r, s = [], []
for _ ... | 57 | 72 | 1,354 | 1,683 | # -*- coding: utf-8 -*-
import sys
from collections import defaultdict
input = sys.stdin.readline
def main():
n, k, l = map(int, input().split())
p, q = [], []
for _ in range(k):
pi, qi = map(int, input().split())
p.append(pi)
q.append(qi)
r, s = [], []
for _ in range(l):
... | # -*- coding: utf-8 -*-
import sys
from collections import defaultdict
input = sys.stdin.readline
def main():
n, k, l = map(int, input().split())
p, q = [], []
for _ in range(k):
pi, qi = map(int, input().split())
p.append(pi)
q.append(qi)
r, s = [], []
for _ in range(l):
... | false | 20.833333 | [
"+ # print(\"\\n\")",
"+ # print(road_tree)",
"+ # print(rail_tree)",
"- union_find_tree[x] = y",
"+ union_find_tree[x] = min(x, y)",
"+ union_find_tree[y] = union_find_tree[x]",
"+# def make_union_find(a, b, n):",
"+# x = [i for i in range(n)]",
"+# ... | false | 0.041905 | 0.040268 | 1.040657 | [
"s156085057",
"s403093165"
] |
u437351386 | p02536 | python | s424694095 | s219316194 | 502 | 459 | 89,472 | 87,892 | Accepted | Accepted | 8.57 | n,m=list(map(int,input().split()))
#Union-Find木
#par[i]:iの親 deep[i]:iの深さ size[i]:iの大きさ
par=[i for i in range(n)]
deep=[1]*n
size=[1]*n
#親を見つける
def find(x):
if par[x]==x:
return x
else:
return find(par[x])
#二つのグループを統合する
def unite(x,y):
x=find(x)
y=find(y)
if x==y:
return
i... | n,m=list(map(int,input().split()))
#Union-Find木
#par[i]:iの親 deep[i]:iの深さ size[i]:iの大きさ
par=[i for i in range(n)]
deep=[1]*n
size=[1]*n
#親を見つける
def find(x):
if par[x]==x:
return x
else:
return find(par[x])
#二つのグループを統合する
def unite(x,y):
x=find(x)
y=find(y)
if x==y:
return
if ... | 50 | 53 | 779 | 854 | n, m = list(map(int, input().split()))
# Union-Find木
# par[i]:iの親 deep[i]:iの深さ size[i]:iの大きさ
par = [i for i in range(n)]
deep = [1] * n
size = [1] * n
# 親を見つける
def find(x):
if par[x] == x:
return x
else:
return find(par[x])
# 二つのグループを統合する
def unite(x, y):
x = find(x)
y = find(y)
if... | n, m = list(map(int, input().split()))
# Union-Find木
# par[i]:iの親 deep[i]:iの深さ size[i]:iの大きさ
par = [i for i in range(n)]
deep = [1] * n
size = [1] * n
# 親を見つける
def find(x):
if par[x] == x:
return x
else:
return find(par[x])
# 二つのグループを統合する
def unite(x, y):
x = find(x)
y = find(y)
if... | false | 5.660377 | [
"+# 連結成分の個数を返す",
"+def count():",
"+ check = set()",
"+ for i in range(n):",
"+ parent = find(i)",
"+ if parent not in check:",
"+ check.add(parent)",
"+ return len(check)",
"+",
"+",
"-from collections import Counter",
"-",
"-x = []",
"-for i in par:",
... | false | 0.035668 | 0.053409 | 0.667828 | [
"s424694095",
"s219316194"
] |
u735069283 | p03814 | python | s785734329 | s171658486 | 64 | 38 | 3,512 | 3,512 | Accepted | Accepted | 40.62 | s=eval(input())
p=0
q=0
r=0
m=0
for i in s:
r +=1
if i =='A':
if p==0:
p=r
elif p!=0 and i=='Z':
q = r
print((q-p+1)) | s = str(eval(input()))
N = len(s)
for i in range(N):
if s[i] =='A':
break
for j in range(1,N):
if s[-j] =='Z':
break
print((N-i-j+1)) | 13 | 9 | 141 | 145 | s = eval(input())
p = 0
q = 0
r = 0
m = 0
for i in s:
r += 1
if i == "A":
if p == 0:
p = r
elif p != 0 and i == "Z":
q = r
print((q - p + 1))
| s = str(eval(input()))
N = len(s)
for i in range(N):
if s[i] == "A":
break
for j in range(1, N):
if s[-j] == "Z":
break
print((N - i - j + 1))
| false | 30.769231 | [
"-s = eval(input())",
"-p = 0",
"-q = 0",
"-r = 0",
"-m = 0",
"-for i in s:",
"- r += 1",
"- if i == \"A\":",
"- if p == 0:",
"- p = r",
"- elif p != 0 and i == \"Z\":",
"- q = r",
"-print((q - p + 1))",
"+s = str(eval(input()))",
"+N = len(s)",
"+for ... | false | 0.097216 | 0.035729 | 2.720916 | [
"s785734329",
"s171658486"
] |
u454524105 | p02983 | python | s689954752 | s929024839 | 743 | 525 | 2,940 | 3,060 | Accepted | Accepted | 29.34 | l, r = list(map(int, input().split()))
if r - l > 2030: print((0))
else:
ans = 2018
for i in range(l, r):
for j in range(i+1, r+1):
ans = min(ans, i*j%2019)
print(ans) | l, r = list(map(int, input().split()))
if r - l > 2030: print((0))
else:
ans = 2018
for i in range(l, r):
for j in range(i+1, r+1):
ans_ = i*j%2019
if ans_ < ans:
ans = ans_
print(ans) | 8 | 10 | 198 | 245 | l, r = list(map(int, input().split()))
if r - l > 2030:
print((0))
else:
ans = 2018
for i in range(l, r):
for j in range(i + 1, r + 1):
ans = min(ans, i * j % 2019)
print(ans)
| l, r = list(map(int, input().split()))
if r - l > 2030:
print((0))
else:
ans = 2018
for i in range(l, r):
for j in range(i + 1, r + 1):
ans_ = i * j % 2019
if ans_ < ans:
ans = ans_
print(ans)
| false | 20 | [
"- ans = min(ans, i * j % 2019)",
"+ ans_ = i * j % 2019",
"+ if ans_ < ans:",
"+ ans = ans_"
] | false | 0.042769 | 0.039024 | 1.095972 | [
"s689954752",
"s929024839"
] |
u908349502 | p03283 | python | s610387721 | s268488994 | 1,648 | 729 | 15,588 | 15,784 | Accepted | Accepted | 55.76 | n, m, Q = list(map(int,input().split()))
lr = [[0 for i in range(n+1)] for j in range(n+1)]
for i in range(m):
l,r = list(map(int,input().split()))
lr[l][r] += 1
# 二次元累積和(indexに注意)
s = [[0 for i in range(n+1)] for j in range(n+1)]
# s[x][y]:=[0,x-1]×[0,y-1]の長方形区間の総和
for i in range(n):
for j in ra... | import sys
input = sys.stdin.readline
n, m, Q = list(map(int,input().split()))
lr = [[0 for i in range(n+1)] for j in range(n+1)]
for i in range(m):
l,r = list(map(int,input().split()))
lr[l][r] += 1
# 二次元累積和(indexに注意)
s = [[0 for i in range(n+1)] for j in range(n+1)]
# s[x][y]:=[0,x-1]×[0,y-1]の長方... | 19 | 22 | 524 | 568 | n, m, Q = list(map(int, input().split()))
lr = [[0 for i in range(n + 1)] for j in range(n + 1)]
for i in range(m):
l, r = list(map(int, input().split()))
lr[l][r] += 1
# 二次元累積和(indexに注意)
s = [[0 for i in range(n + 1)] for j in range(n + 1)]
# s[x][y]:=[0,x-1]×[0,y-1]の長方形区間の総和
for i in range(n):
for j in ra... | import sys
input = sys.stdin.readline
n, m, Q = list(map(int, input().split()))
lr = [[0 for i in range(n + 1)] for j in range(n + 1)]
for i in range(m):
l, r = list(map(int, input().split()))
lr[l][r] += 1
# 二次元累積和(indexに注意)
s = [[0 for i in range(n + 1)] for j in range(n + 1)]
# s[x][y]:=[0,x-1]×[0,y-1]の長方形区... | false | 13.636364 | [
"+import sys",
"+",
"+input = sys.stdin.readline"
] | false | 0.037902 | 0.035436 | 1.069599 | [
"s610387721",
"s268488994"
] |
u760794812 | p03043 | python | s087390058 | s806203001 | 40 | 35 | 3,864 | 3,956 | Accepted | Accepted | 12.5 | import math
N, K = list(map(int, input().split()))
t = []
if K > N:
max = N
for i in range(max):
t.append(math.ceil((math.log10(K) - math.log10(i+1))/math.log10(2)))
else:
max = K
for i in range(max):
t.append(math.ceil((math.log10(K) - math.log10(i+1))/math.log10(2)))
for i in range(N ... | import math
N, K = list(map(int, input().split()))
prob = []
for i in range(N):
if i+1 >= K:
prob.append(1)
else:
temp = i+1
x = 0
while temp < K:
temp *=2
x += 1
prob.append(0.5**x)
Answer = sum(prob)/N
print(Answer) | 23 | 16 | 436 | 263 | import math
N, K = list(map(int, input().split()))
t = []
if K > N:
max = N
for i in range(max):
t.append(math.ceil((math.log10(K) - math.log10(i + 1)) / math.log10(2)))
else:
max = K
for i in range(max):
t.append(math.ceil((math.log10(K) - math.log10(i + 1)) / math.log10(2)))
for i... | import math
N, K = list(map(int, input().split()))
prob = []
for i in range(N):
if i + 1 >= K:
prob.append(1)
else:
temp = i + 1
x = 0
while temp < K:
temp *= 2
x += 1
prob.append(0.5**x)
Answer = sum(prob) / N
print(Answer)
| false | 30.434783 | [
"-t = []",
"-if K > N:",
"- max = N",
"- for i in range(max):",
"- t.append(math.ceil((math.log10(K) - math.log10(i + 1)) / math.log10(2)))",
"-else:",
"- max = K",
"- for i in range(max):",
"- t.append(math.ceil((math.log10(K) - math.log10(i + 1)) / math.log10(2)))",
"- ... | false | 0.066707 | 0.049105 | 1.358472 | [
"s087390058",
"s806203001"
] |
u492929439 | p02713 | python | s503776773 | s701530030 | 1,557 | 692 | 9,208 | 68,572 | Accepted | Accepted | 55.56 | def GCD(a, b):
r = a % b
while(r!=0):
a = b
b = r
r = a % b
return b
def main():
ans = 0
K = int(eval(input()))
for i in range(1, K+1):
for j in range(1, K+1):
if(i < j):
gcd1 = GCD(j, i)
else:
... | def GCD(a, b):
r = a % b
while(r!=0):
a = b
b = r
r = a % b
return b
def main():
ans = 0
K = int(eval(input()))
for i in range(1, K+1):
for j in range(1, K+1):
if(i == 1 or j == 1):
gcd1 = 1
elif(i <... | 27 | 30 | 474 | 539 | def GCD(a, b):
r = a % b
while r != 0:
a = b
b = r
r = a % b
return b
def main():
ans = 0
K = int(eval(input()))
for i in range(1, K + 1):
for j in range(1, K + 1):
if i < j:
gcd1 = GCD(j, i)
else:
gcd1 = G... | def GCD(a, b):
r = a % b
while r != 0:
a = b
b = r
r = a % b
return b
def main():
ans = 0
K = int(eval(input()))
for i in range(1, K + 1):
for j in range(1, K + 1):
if i == 1 or j == 1:
gcd1 = 1
elif i < j:
... | false | 10 | [
"- if i < j:",
"+ if i == 1 or j == 1:",
"+ gcd1 = 1",
"+ elif i < j:"
] | false | 0.170674 | 0.124835 | 1.36719 | [
"s503776773",
"s701530030"
] |
u279605379 | p02297 | python | s898564732 | s416292867 | 30 | 20 | 7,732 | 7,716 | Accepted | Accepted | 33.33 | def cross(a,b):return a[0]*b[1] - a[1]*b[0]
n = int(eval(input()))
P =[]
s = 0
for i in range(n):P.append([int(i) for i in input().split()])
P = P*2
for i in range(n):s += cross(P[i],P[i+1])
print((abs(s)/2)) | def cross(a,b):return a[0]*b[1] - a[1]*b[0]
n = int(eval(input()))
P =[]
s = 0
for i in range(n):P.append([int(i) for i in input().split()])
P.append(P[0])
for i in range(n):s += cross(P[i],P[i+1])
print((abs(s)*0.5)) | 9 | 9 | 217 | 226 | def cross(a, b):
return a[0] * b[1] - a[1] * b[0]
n = int(eval(input()))
P = []
s = 0
for i in range(n):
P.append([int(i) for i in input().split()])
P = P * 2
for i in range(n):
s += cross(P[i], P[i + 1])
print((abs(s) / 2))
| def cross(a, b):
return a[0] * b[1] - a[1] * b[0]
n = int(eval(input()))
P = []
s = 0
for i in range(n):
P.append([int(i) for i in input().split()])
P.append(P[0])
for i in range(n):
s += cross(P[i], P[i + 1])
print((abs(s) * 0.5))
| false | 0 | [
"-P = P * 2",
"+P.append(P[0])",
"-print((abs(s) / 2))",
"+print((abs(s) * 0.5))"
] | false | 0.046054 | 0.006971 | 6.606355 | [
"s898564732",
"s416292867"
] |
u580920947 | p03835 | python | s460340236 | s690028742 | 1,748 | 208 | 3,064 | 40,940 | Accepted | Accepted | 88.1 | # -*- coding: utf-8 -*-
# problem B
k, s = list(map(int, input().split()))
ans = 0
for i in range(k+1):
for j in range(k+1):
z = s-i-j
if 0 <= z and z <=k:
ans = ans+1
print(ans) | #!/usr/bin/env python
def main():
k, s = list(map(int, input().split()))
ans = 0
for x in range(k+1):
for y in range(k+1):
z = s - x - y
if z >= 0 and z <= k:
ans += 1
print(ans)
if __name__ == '__main__':
main()
| 14 | 18 | 221 | 308 | # -*- coding: utf-8 -*-
# problem B
k, s = list(map(int, input().split()))
ans = 0
for i in range(k + 1):
for j in range(k + 1):
z = s - i - j
if 0 <= z and z <= k:
ans = ans + 1
print(ans)
| #!/usr/bin/env python
def main():
k, s = list(map(int, input().split()))
ans = 0
for x in range(k + 1):
for y in range(k + 1):
z = s - x - y
if z >= 0 and z <= k:
ans += 1
print(ans)
if __name__ == "__main__":
main()
| false | 22.222222 | [
"-# -*- coding: utf-8 -*-",
"-# problem B",
"-k, s = list(map(int, input().split()))",
"-ans = 0",
"-for i in range(k + 1):",
"- for j in range(k + 1):",
"- z = s - i - j",
"- if 0 <= z and z <= k:",
"- ans = ans + 1",
"-print(ans)",
"+#!/usr/bin/env python",
"+def ... | false | 0.045842 | 0.082282 | 0.557133 | [
"s460340236",
"s690028742"
] |
u506858457 | p03013 | python | s815380523 | s666360677 | 450 | 257 | 460,020 | 7,668 | Accepted | Accepted | 42.89 | MOD=10**9+7
N,M=list(map(int,input().split()))
dp=[1]*(N+1)
for i in range(M):
dp[int(eval(input()))]=0
for n in range(2,N+1):
if dp[n]!=0:
dp[n]=(dp[n-1]+dp[n-2])
print((dp[N]%MOD))
| MOD = 10**9 + 7
n, m = list(map(int, input().split()))
ban = [False] * (n + 1)#踏めない階段の配列、最初は全てOK
for i in range(m):
a = int(eval(input()))
ban[a] = True#壊れている段をTrueに変える
dp = [0] * (n+1)#DPテーブルは余裕が必要
dp[0] = 1#最初は1通り
for i in range(n):
dp[i] %= MOD#MODで割っておく
if(ban[i]):dp[i] = 0#壊れている段に行く... | 9 | 20 | 185 | 460 | MOD = 10**9 + 7
N, M = list(map(int, input().split()))
dp = [1] * (N + 1)
for i in range(M):
dp[int(eval(input()))] = 0
for n in range(2, N + 1):
if dp[n] != 0:
dp[n] = dp[n - 1] + dp[n - 2]
print((dp[N] % MOD))
| MOD = 10**9 + 7
n, m = list(map(int, input().split()))
ban = [False] * (n + 1) # 踏めない階段の配列、最初は全てOK
for i in range(m):
a = int(eval(input()))
ban[a] = True # 壊れている段をTrueに変える
dp = [0] * (n + 1) # DPテーブルは余裕が必要
dp[0] = 1 # 最初は1通り
for i in range(n):
dp[i] %= MOD # MODで割っておく
if ban[i]:
dp[i] = 0 ... | false | 55 | [
"-N, M = list(map(int, input().split()))",
"-dp = [1] * (N + 1)",
"-for i in range(M):",
"- dp[int(eval(input()))] = 0",
"-for n in range(2, N + 1):",
"- if dp[n] != 0:",
"- dp[n] = dp[n - 1] + dp[n - 2]",
"-print((dp[N] % MOD))",
"+n, m = list(map(int, input().split()))",
"+ban = [Fa... | false | 0.061445 | 0.044763 | 1.372672 | [
"s815380523",
"s666360677"
] |
u089230684 | p03307 | python | s403403225 | s912317025 | 164 | 17 | 38,384 | 2,940 | Accepted | Accepted | 89.63 | a = int(eval(input()))
if a % 2 == 1: a *= 2
print(a)
# Source code should be longer than 50 characters | n = int(eval(input()))
contador = 0
res = 0
while(True):
contador += n
if contador % 2 == 0 and contador % n == 0:
res = contador
break;
print((res,'\n')) | 4 | 9 | 100 | 178 | a = int(eval(input()))
if a % 2 == 1:
a *= 2
print(a)
# Source code should be longer than 50 characters
| n = int(eval(input()))
contador = 0
res = 0
while True:
contador += n
if contador % 2 == 0 and contador % n == 0:
res = contador
break
print((res, "\n"))
| false | 55.555556 | [
"-a = int(eval(input()))",
"-if a % 2 == 1:",
"- a *= 2",
"-print(a)",
"-# Source code should be longer than 50 characters",
"+n = int(eval(input()))",
"+contador = 0",
"+res = 0",
"+while True:",
"+ contador += n",
"+ if contador % 2 == 0 and contador % n == 0:",
"+ res = cont... | false | 0.044952 | 0.03872 | 1.160975 | [
"s403403225",
"s912317025"
] |
u227020436 | p03252 | python | s174349513 | s838827534 | 63 | 52 | 6,832 | 6,832 | Accepted | Accepted | 17.46 | S = eval(input())
T = eval(input())
assert len(S) == len(T)
def normalized(S):
dic = {} # char -> occurence order
last = -1
T = []
for s in S:
if s not in dic:
last += 1
dic[s] = last
T.append(dic[s])
return T
print(("Yes" if normalized(S) ==... | S = eval(input())
T = eval(input())
assert len(S) == len(T)
def uniq(s):
'''Return the list obtained from s by removing repeating chars.'''
appeared = set()
for c in s:
if c not in appeared:
appeared.add(c)
yield c
def normalized(s):
dic = {c: i for i, c in... | 16 | 17 | 332 | 420 | S = eval(input())
T = eval(input())
assert len(S) == len(T)
def normalized(S):
dic = {} # char -> occurence order
last = -1
T = []
for s in S:
if s not in dic:
last += 1
dic[s] = last
T.append(dic[s])
return T
print(("Yes" if normalized(S) == normalized(T... | S = eval(input())
T = eval(input())
assert len(S) == len(T)
def uniq(s):
"""Return the list obtained from s by removing repeating chars."""
appeared = set()
for c in s:
if c not in appeared:
appeared.add(c)
yield c
def normalized(s):
dic = {c: i for i, c in enumerate(... | false | 5.882353 | [
"-def normalized(S):",
"- dic = {} # char -> occurence order",
"- last = -1",
"- T = []",
"- for s in S:",
"- if s not in dic:",
"- last += 1",
"- dic[s] = last",
"- T.append(dic[s])",
"- return T",
"+def uniq(s):",
"+ \"\"\"Return the lis... | false | 0.039086 | 0.038314 | 1.020154 | [
"s174349513",
"s838827534"
] |
u843175622 | p03959 | python | s551799533 | s090817943 | 148 | 135 | 19,012 | 24,604 | Accepted | Accepted | 8.78 | import sys
n = int(eval(input()))
t = list(map(int, input().split()))
a = list(map(int, input().split()))
h = [min(t[i],a[i]) for i in range(n)]
fixed = [False] * n
fixed[0] = True; fixed[n-1] = True
if a[n-1] > t[n-1] or t[0] > a[0]:
print((0))
sys.exit(0)
# takahashi check
for i in range(1,n):
... | n = int(eval(input()))
t = list(map(int, input().split()))
a = list(map(int, input().split()))
mod = 10 ** 9 + 7
yama = [0] * n
# tは、t[i] == t[i + 1]だったら左の以外全部ありうる
yama[0] = t[0]
if t[0] > a[0]:
print((0))
exit()
for i in range(n - 1):
if t[i] < t[i + 1]:
# i + 1の高さ確定
yama... | 33 | 36 | 711 | 761 | import sys
n = int(eval(input()))
t = list(map(int, input().split()))
a = list(map(int, input().split()))
h = [min(t[i], a[i]) for i in range(n)]
fixed = [False] * n
fixed[0] = True
fixed[n - 1] = True
if a[n - 1] > t[n - 1] or t[0] > a[0]:
print((0))
sys.exit(0)
# takahashi check
for i in range(1, n):
if ... | n = int(eval(input()))
t = list(map(int, input().split()))
a = list(map(int, input().split()))
mod = 10**9 + 7
yama = [0] * n
# tは、t[i] == t[i + 1]だったら左の以外全部ありうる
yama[0] = t[0]
if t[0] > a[0]:
print((0))
exit()
for i in range(n - 1):
if t[i] < t[i + 1]:
# i + 1の高さ確定
yama[i + 1] = t[i + 1]
... | false | 8.333333 | [
"-import sys",
"-",
"-h = [min(t[i], a[i]) for i in range(n)]",
"-fixed = [False] * n",
"-fixed[0] = True",
"-fixed[n - 1] = True",
"-if a[n - 1] > t[n - 1] or t[0] > a[0]:",
"+mod = 10**9 + 7",
"+yama = [0] * n",
"+# tは、t[i] == t[i + 1]だったら左の以外全部ありうる",
"+yama[0] = t[0]",
"+if t[0] > a[0]:",
... | false | 0.063877 | 0.046359 | 1.377881 | [
"s551799533",
"s090817943"
] |
u416011173 | p02606 | python | s216155700 | s546734946 | 28 | 24 | 9,080 | 9,068 | Accepted | Accepted | 14.29 | # -*- coding: utf-8 -*-
# 標準入力を取得
L, R, d = list(map(int, input().split()))
# 求解処理
ans = R // d - (L - 1) // d
# 結果出力
print(ans)
| # -*- coding: utf-8 -*-
def get_input() -> tuple:
"""
標準入力を取得する.
Returns:\n
tuple: 標準入力
"""
L, R, d = list(map(int, input().split()))
return L, R, d
def main(L: int, R: int, d: int) -> None:
"""
メイン処理.
Args:\n
L (int): 整数(1 <= L <= R <= 100)
... | 9 | 36 | 139 | 588 | # -*- coding: utf-8 -*-
# 標準入力を取得
L, R, d = list(map(int, input().split()))
# 求解処理
ans = R // d - (L - 1) // d
# 結果出力
print(ans)
| # -*- coding: utf-8 -*-
def get_input() -> tuple:
"""
標準入力を取得する.
Returns:\n
tuple: 標準入力
"""
L, R, d = list(map(int, input().split()))
return L, R, d
def main(L: int, R: int, d: int) -> None:
"""
メイン処理.
Args:\n
L (int): 整数(1 <= L <= R <= 100)
R (int): 整数(1 <=... | false | 75 | [
"-# 標準入力を取得",
"-L, R, d = list(map(int, input().split()))",
"-# 求解処理",
"-ans = R // d - (L - 1) // d",
"-# 結果出力",
"-print(ans)",
"+def get_input() -> tuple:",
"+ \"\"\"",
"+ 標準入力を取得する.",
"+ Returns:\\n",
"+ tuple: 標準入力",
"+ \"\"\"",
"+ L, R, d = list(map(int, input().sp... | false | 0.042783 | 0.044185 | 0.968264 | [
"s216155700",
"s546734946"
] |
u077291787 | p03606 | python | s112150808 | s706364410 | 21 | 18 | 3,188 | 3,188 | Accepted | Accepted | 14.29 | # ABC073B - Theater
n = int(eval(input()))
lst = [list(map(int, input().rstrip().split())) for _ in range(n)]
total = 0
for i in lst:
total += i[1] - i[0] + 1
print(total) | # ABC073B - Theater
def main():
N, *LR = list(map(int, open(0).read().split()))
ans = sum(r - l + 1 for l, r in zip(*[iter(LR)] * 2))
print(ans)
if __name__ == "__main__":
main() | 7 | 9 | 175 | 198 | # ABC073B - Theater
n = int(eval(input()))
lst = [list(map(int, input().rstrip().split())) for _ in range(n)]
total = 0
for i in lst:
total += i[1] - i[0] + 1
print(total)
| # ABC073B - Theater
def main():
N, *LR = list(map(int, open(0).read().split()))
ans = sum(r - l + 1 for l, r in zip(*[iter(LR)] * 2))
print(ans)
if __name__ == "__main__":
main()
| false | 22.222222 | [
"-n = int(eval(input()))",
"-lst = [list(map(int, input().rstrip().split())) for _ in range(n)]",
"-total = 0",
"-for i in lst:",
"- total += i[1] - i[0] + 1",
"-print(total)",
"+def main():",
"+ N, *LR = list(map(int, open(0).read().split()))",
"+ ans = sum(r - l + 1 for l, r in zip(*[iter... | false | 0.044982 | 0.045472 | 0.989206 | [
"s112150808",
"s706364410"
] |
u450956662 | p03452 | python | s793784723 | s525951439 | 1,332 | 1,060 | 10,708 | 93,800 | Accepted | Accepted | 20.42 | def root(v):
if par[v] == v:
return v
r = root(par[v])
diff_weight[v] += diff_weight[par[v]]
par[v] = r
return r
def weight(v):
root(v)
return diff_weight[v]
def diff(u, v):
return weight(v) - weight(u)
def unite(u, v, w):
w += diff(v, u)
u = root(u)
... | from collections import deque
import sys
input = sys.stdin.readline
def bfs(s):
que = deque([(0, s)])
while que:
d, v = que.popleft()
if visited[v]:
if d != dist[v]:
return False
continue
visited[v] = True
dist[v] = d
... | 49 | 36 | 919 | 760 | def root(v):
if par[v] == v:
return v
r = root(par[v])
diff_weight[v] += diff_weight[par[v]]
par[v] = r
return r
def weight(v):
root(v)
return diff_weight[v]
def diff(u, v):
return weight(v) - weight(u)
def unite(u, v, w):
w += diff(v, u)
u = root(u)
v = root(v)... | from collections import deque
import sys
input = sys.stdin.readline
def bfs(s):
que = deque([(0, s)])
while que:
d, v = que.popleft()
if visited[v]:
if d != dist[v]:
return False
continue
visited[v] = True
dist[v] = d
for w, u in... | false | 26.530612 | [
"-def root(v):",
"- if par[v] == v:",
"- return v",
"- r = root(par[v])",
"- diff_weight[v] += diff_weight[par[v]]",
"- par[v] = r",
"- return r",
"+from collections import deque",
"+import sys",
"+",
"+input = sys.stdin.readline",
"-def weight(v):",
"- root(v)",
"... | false | 0.087448 | 0.081657 | 1.070918 | [
"s793784723",
"s525951439"
] |
u130900604 | p02683 | python | s657230152 | s896647652 | 213 | 160 | 27,436 | 9,256 | Accepted | Accepted | 24.88 | n,m,x=list(map(int,input().split()))
c=[0]*n
a=[0]*n
ans=10**10
for i in range(n):
d,*b=list(map(int,input().split()))
c[i]=d
a[i]=b
import numpy as np
a=np.array(a)
from itertools import product
r=list(product([0,1],repeat=n))
for i in r:
tmp=np.array([0]*m)
cost=0
for j,k in enumerate(i):
... | from itertools import product
n,m,x=list(map(int,input().split()))
c=[0]*n
a=[0]*n
INF=10**9
for i in range(n):
d,*b=list(map(int,input().split()))
c[i]=d
a[i]=b
ans=INF
for z in product([0,1],repeat=n):
u=[0]*m
cost=0
for i in range(n):
cost+=c[i]*z[i]
for j in range(m):
u[j]+... | 23 | 26 | 420 | 458 | n, m, x = list(map(int, input().split()))
c = [0] * n
a = [0] * n
ans = 10**10
for i in range(n):
d, *b = list(map(int, input().split()))
c[i] = d
a[i] = b
import numpy as np
a = np.array(a)
from itertools import product
r = list(product([0, 1], repeat=n))
for i in r:
tmp = np.array([0] * m)
cost ... | from itertools import product
n, m, x = list(map(int, input().split()))
c = [0] * n
a = [0] * n
INF = 10**9
for i in range(n):
d, *b = list(map(int, input().split()))
c[i] = d
a[i] = b
ans = INF
for z in product([0, 1], repeat=n):
u = [0] * m
cost = 0
for i in range(n):
cost += c[i] * z... | false | 11.538462 | [
"+from itertools import product",
"+",
"-ans = 10**10",
"+INF = 10**9",
"-import numpy as np",
"-",
"-a = np.array(a)",
"-from itertools import product",
"-",
"-r = list(product([0, 1], repeat=n))",
"-for i in r:",
"- tmp = np.array([0] * m)",
"+ans = INF",
"+for z in product([0, 1], re... | false | 0.705475 | 0.046819 | 15.068058 | [
"s657230152",
"s896647652"
] |
u229660384 | p03557 | python | s820512315 | s460016008 | 1,561 | 895 | 24,052 | 24,096 | Accepted | Accepted | 42.66 | 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()
total = 0
for i in range(N):
low1 = 0
high = N
while low1 < high:
mid = (low1 + high) // 2
if A[mid] < B[i]:
... | N = int(eval(input()))
A = sorted([int(i) for i in input().split()])
B = [int(i) for i in input().split()]
C = sorted([int(i)-1 for i in input().split()])
def bis(x,y):
low = 0
high = N
while low < high:
mid = (low + high) // 2
if x[mid] < y:
low = mid + 1
el... | 30 | 21 | 601 | 440 | 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()
total = 0
for i in range(N):
low1 = 0
high = N
while low1 < high:
mid = (low1 + high) // 2
if A[mid] < B[i]:
low1 = mid + ... | N = int(eval(input()))
A = sorted([int(i) for i in input().split()])
B = [int(i) for i in input().split()]
C = sorted([int(i) - 1 for i in input().split()])
def bis(x, y):
low = 0
high = N
while low < high:
mid = (low + high) // 2
if x[mid] < y:
low = mid + 1
else:
... | false | 30 | [
"-A = list(map(int, input().split()))",
"-B = list(map(int, input().split()))",
"-C = list(map(int, input().split()))",
"-A.sort()",
"-B.sort()",
"-C.sort()",
"-total = 0",
"-for i in range(N):",
"- low1 = 0",
"+A = sorted([int(i) for i in input().split()])",
"+B = [int(i) for i in input().sp... | false | 0.121634 | 0.038626 | 3.148996 | [
"s820512315",
"s460016008"
] |
u227082700 | p02851 | python | s065859316 | s540406616 | 297 | 229 | 33,256 | 36,100 | Accepted | Accepted | 22.9 | n,k=list(map(int,input().split()))
a=[0]+list(map(int,input().split()))
for i in range(n):a[i+1]=(a[i+1]+a[i]-1)%k
from collections import defaultdict
d=defaultdict(int)
x=0
d[0]=1
for i in range(1,n+1):
if i-k>=0:d[a[i-k]]-=1
x+=d[a[i]]
d[a[i]]+=1
print(x) | from collections import defaultdict
n,k=list(map(int,input().split()))
a=list(map(int,input().split()))
a[0]=(a[0]-1)%k
for i in range(n-1):a[i+1]=(a[i+1]+a[i]-1)%k
d=defaultdict(int)
ans=0
d[0]=1
for i in range(n):
if i==k-1:d[0]-=1
if i>=k:d[a[i-k]]-=1
ans+=d[a[i]]
d[a[i]]+=1
print(ans) | 12 | 14 | 268 | 304 | n, k = list(map(int, input().split()))
a = [0] + list(map(int, input().split()))
for i in range(n):
a[i + 1] = (a[i + 1] + a[i] - 1) % k
from collections import defaultdict
d = defaultdict(int)
x = 0
d[0] = 1
for i in range(1, n + 1):
if i - k >= 0:
d[a[i - k]] -= 1
x += d[a[i]]
d[a[i]] += 1
pr... | from collections import defaultdict
n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
a[0] = (a[0] - 1) % k
for i in range(n - 1):
a[i + 1] = (a[i + 1] + a[i] - 1) % k
d = defaultdict(int)
ans = 0
d[0] = 1
for i in range(n):
if i == k - 1:
d[0] -= 1
if i >= k:
d[a[i... | false | 14.285714 | [
"-n, k = list(map(int, input().split()))",
"-a = [0] + list(map(int, input().split()))",
"-for i in range(n):",
"- a[i + 1] = (a[i + 1] + a[i] - 1) % k",
"+n, k = list(map(int, input().split()))",
"+a = list(map(int, input().split()))",
"+a[0] = (a[0] - 1) % k",
"+for i in range(n - 1):",
"+ a... | false | 0.04107 | 0.0417 | 0.984881 | [
"s065859316",
"s540406616"
] |
u681444474 | p02880 | python | s043192653 | s065492557 | 190 | 173 | 38,384 | 38,384 | Accepted | Accepted | 8.95 | N=int(eval(input()))
cnt=0
if 1<=N<10:
cnt+=1
elif N>81:
pass
else:
for i in range(2,10):
if N%i==0 and (N/i)<10:
cnt+=1
if cnt==0:
print("No")
else:
print("Yes") | N = int(eval(input()))
cnt = 0
for i in range(1,10):
if N % i == 0 and 1<=N/i<=9:
cnt = 1
break
if cnt == 1:
print("Yes")
else:
print("No") | 14 | 11 | 189 | 160 | N = int(eval(input()))
cnt = 0
if 1 <= N < 10:
cnt += 1
elif N > 81:
pass
else:
for i in range(2, 10):
if N % i == 0 and (N / i) < 10:
cnt += 1
if cnt == 0:
print("No")
else:
print("Yes")
| N = int(eval(input()))
cnt = 0
for i in range(1, 10):
if N % i == 0 and 1 <= N / i <= 9:
cnt = 1
break
if cnt == 1:
print("Yes")
else:
print("No")
| false | 21.428571 | [
"-if 1 <= N < 10:",
"- cnt += 1",
"-elif N > 81:",
"- pass",
"+for i in range(1, 10):",
"+ if N % i == 0 and 1 <= N / i <= 9:",
"+ cnt = 1",
"+ break",
"+if cnt == 1:",
"+ print(\"Yes\")",
"- for i in range(2, 10):",
"- if N % i == 0 and (N / i) < 10:",
"-... | false | 0.054727 | 0.05343 | 1.024283 | [
"s043192653",
"s065492557"
] |
u279493135 | p02642 | python | s131896797 | s835796190 | 1,162 | 486 | 36,552 | 52,184 | Accepted | Accepted | 58.18 | import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
from itertools import accumulate, permutations, combinations, product, groupby, combinations_with_replacement
from operator import itemgetter, mul
from copy import deepcopy
... | import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
from itertools import accumulate, permutations, combinations, product, groupby, combinations_with_replacement
from operator import itemgetter, mul
from copy import deepcopy
... | 41 | 38 | 1,134 | 1,126 | import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
from itertools import (
accumulate,
permutations,
combinations,
product,
groupby,
combinations_with_replacement,
)
from operator import itemgetter, mul
fro... | import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
from itertools import (
accumulate,
permutations,
combinations,
product,
groupby,
combinations_with_replacement,
)
from operator import itemgetter, mul
fro... | false | 7.317073 | [
"+ans = 0",
"-cnt = [0] * lim",
"-is_prime = [1] * lim",
"-for x in A:",
"- cnt[x] += 1",
"-for i in range(2, lim):",
"- if not is_prime[i]:",
"- continue",
"- for j in range(2 * i, lim, i):",
"- is_prime[j] = 0",
"- for j in range(1, -(-lim // i)):",
"- cnt[i ... | false | 0.121686 | 0.11287 | 1.078109 | [
"s131896797",
"s835796190"
] |
u073549161 | p03160 | python | s576559794 | s717235950 | 131 | 98 | 13,928 | 85,204 | Accepted | Accepted | 25.19 | n = int(eval(input()))
dat_n = list(map(int, input().split()))
dp = [0] * n
dp [0]
for i in range(1, n):
if i > 1:
dp[i] = min(dp[i - 1] + abs(dat_n[i] - dat_n[i-1]),dp[i - 2] + abs(dat_n[i] - dat_n[i-2]) )
else:
dp[i] = dp[i - 1] + abs(dat_n[i] - dat_n[i-1])
print((dp[n-1]))
| n = int(eval(input()))
dat = list(map(int, input().split()))
inf = 10**10
dp = [inf] * (n + 10)
dp[0] = 0
for i in range(n):
if i+1 > n-1:
continue
dp[i+1] = min(dp[i+1], dp[i] + abs(dat[i] - dat[i+1]))
if i+2 > n-1:
continue
dp[i+2] = min(dp[i+2], dp[i] + abs(dat[i] - dat[i+2... | 10 | 13 | 302 | 334 | n = int(eval(input()))
dat_n = list(map(int, input().split()))
dp = [0] * n
dp[0]
for i in range(1, n):
if i > 1:
dp[i] = min(
dp[i - 1] + abs(dat_n[i] - dat_n[i - 1]),
dp[i - 2] + abs(dat_n[i] - dat_n[i - 2]),
)
else:
dp[i] = dp[i - 1] + abs(dat_n[i] - dat_n[i - ... | n = int(eval(input()))
dat = list(map(int, input().split()))
inf = 10**10
dp = [inf] * (n + 10)
dp[0] = 0
for i in range(n):
if i + 1 > n - 1:
continue
dp[i + 1] = min(dp[i + 1], dp[i] + abs(dat[i] - dat[i + 1]))
if i + 2 > n - 1:
continue
dp[i + 2] = min(dp[i + 2], dp[i] + abs(dat[i] - ... | false | 23.076923 | [
"-dat_n = list(map(int, input().split()))",
"-dp = [0] * n",
"-dp[0]",
"-for i in range(1, n):",
"- if i > 1:",
"- dp[i] = min(",
"- dp[i - 1] + abs(dat_n[i] - dat_n[i - 1]),",
"- dp[i - 2] + abs(dat_n[i] - dat_n[i - 2]),",
"- )",
"- else:",
"- dp... | false | 0.047205 | 0.047417 | 0.995517 | [
"s576559794",
"s717235950"
] |
u380524497 | p02584 | python | s536497517 | s673503858 | 34 | 28 | 9,200 | 9,180 | Accepted | Accepted | 17.65 | import sys
input = sys.stdin.readline
def main():
x, k, d = list(map(int, input().split()))
if x < 0:
step = abs(x) // d
if step >= k:
ans = abs(x + k*d)
else:
residue = k - step
residue %= 2
ans = abs(x + (step+residue)*d)... | import sys
input = sys.stdin.readline
def main():
x, k, d = list(map(int, input().split()))
x = abs(x)
step = x // d
if step >= k:
ans = x - d * k
print(ans)
return
k -= step
x = x - step * d
k %= 2
ans = abs(x - d*k)
print(ans)
if __n... | 33 | 22 | 646 | 347 | import sys
input = sys.stdin.readline
def main():
x, k, d = list(map(int, input().split()))
if x < 0:
step = abs(x) // d
if step >= k:
ans = abs(x + k * d)
else:
residue = k - step
residue %= 2
ans = abs(x + (step + residue) * d)
eli... | import sys
input = sys.stdin.readline
def main():
x, k, d = list(map(int, input().split()))
x = abs(x)
step = x // d
if step >= k:
ans = x - d * k
print(ans)
return
k -= step
x = x - step * d
k %= 2
ans = abs(x - d * k)
print(ans)
if __name__ == "__main__... | false | 33.333333 | [
"- if x < 0:",
"- step = abs(x) // d",
"- if step >= k:",
"- ans = abs(x + k * d)",
"- else:",
"- residue = k - step",
"- residue %= 2",
"- ans = abs(x + (step + residue) * d)",
"- elif x == 0:",
"- k %= 2",
"- ... | false | 0.126913 | 0.035387 | 3.586433 | [
"s536497517",
"s673503858"
] |
u729133443 | p02987 | python | s100778317 | s325386980 | 182 | 17 | 38,384 | 2,940 | Accepted | Accepted | 90.66 | s=eval(input());print(('YNeos'[any(s.count(t)!=2for t in s)::2])) | print(('YNeos'[len(set(eval(input())))!=2::2])) | 1 | 1 | 57 | 39 | s = eval(input())
print(("YNeos"[any(s.count(t) != 2 for t in s) :: 2]))
| print(("YNeos"[len(set(eval(input()))) != 2 :: 2]))
| false | 0 | [
"-s = eval(input())",
"-print((\"YNeos\"[any(s.count(t) != 2 for t in s) :: 2]))",
"+print((\"YNeos\"[len(set(eval(input()))) != 2 :: 2]))"
] | false | 0.076741 | 0.035738 | 2.147314 | [
"s100778317",
"s325386980"
] |
u682672120 | p02580 | python | s309862532 | s718084131 | 1,348 | 1,038 | 123,996 | 173,184 | Accepted | Accepted | 23 | h, w, m = list(map(int, input().split()))
target = set()
rows = [0] * h
cols = [0] * w
for i in range(m):
y, x = [int(x) - 1 for x in input().split()]
rows[y] += 1
cols[x] += 1
target.add((y, x))
rows_sorted = [(a, i) for i, a in enumerate(rows)]
rows_sorted.sort(reverse=True)
cols_sorted... | h, w, m = list(map(int, input().split()))
target_pos = set()
target_n_row = [0] * h
target_n_col = [0] * w
for i in range(m):
y, x = [int(x) - 1 for x in input().split()]
target_n_row[y] += 1
target_n_col[x] += 1
target_pos.add((y, x))
sorted_row = [(a, i) for i, a in enumerate(target_n_row... | 34 | 30 | 869 | 828 | h, w, m = list(map(int, input().split()))
target = set()
rows = [0] * h
cols = [0] * w
for i in range(m):
y, x = [int(x) - 1 for x in input().split()]
rows[y] += 1
cols[x] += 1
target.add((y, x))
rows_sorted = [(a, i) for i, a in enumerate(rows)]
rows_sorted.sort(reverse=True)
cols_sorted = [(a, i) for ... | h, w, m = list(map(int, input().split()))
target_pos = set()
target_n_row = [0] * h
target_n_col = [0] * w
for i in range(m):
y, x = [int(x) - 1 for x in input().split()]
target_n_row[y] += 1
target_n_col[x] += 1
target_pos.add((y, x))
sorted_row = [(a, i) for i, a in enumerate(target_n_row)]
sorted_row... | false | 11.764706 | [
"-target = set()",
"-rows = [0] * h",
"-cols = [0] * w",
"+target_pos = set()",
"+target_n_row = [0] * h",
"+target_n_col = [0] * w",
"- rows[y] += 1",
"- cols[x] += 1",
"- target.add((y, x))",
"-rows_sorted = [(a, i) for i, a in enumerate(rows)]",
"-rows_sorted.sort(reverse=True)",
"... | false | 0.045272 | 0.093552 | 0.483923 | [
"s309862532",
"s718084131"
] |
u910756197 | p03636 | python | s258592758 | s990694712 | 19 | 17 | 2,940 | 2,940 | Accepted | Accepted | 10.53 | a, *b, c = input()
print(a, len(b), c, sep="")
| s = eval(input())
print((s[0] + str(len(s) - 2) + s[-1])) | 2 | 2 | 47 | 50 | a, *b, c = input()
print(a, len(b), c, sep="")
| s = eval(input())
print((s[0] + str(len(s) - 2) + s[-1]))
| false | 0 | [
"-a, *b, c = input()",
"-print(a, len(b), c, sep=\"\")",
"+s = eval(input())",
"+print((s[0] + str(len(s) - 2) + s[-1]))"
] | false | 0.044908 | 0.043108 | 1.041745 | [
"s258592758",
"s990694712"
] |
u864197622 | p02788 | python | s913594144 | s279751683 | 886 | 819 | 35,012 | 35,304 | Accepted | Accepted | 7.56 | import sys
input = sys.stdin.readline
from collections import deque
N, D, A = list(map(int, input().split()))
X = []
for _ in range(N):
x, h = list(map(int, input().split()))
X.append((x, h))
X = sorted(X)[::-1]
Q = deque([])
ans = 0
k = 0
while X:
if len(Q) == 0 or X[-1][0] <= Q[0][0]:
... | import sys
input = sys.stdin.readline
from collections import deque
N, D, A = list(map(int, input().split()))
X = []
for _ in range(N):
x, h = list(map(int, input().split()))
X.append((x, h))
X = sorted(X, key = lambda x: x[0])[::-1]
Q = deque([])
ans = 0
k = 0
while X:
if len(Q) == 0 or X[... | 27 | 27 | 538 | 560 | import sys
input = sys.stdin.readline
from collections import deque
N, D, A = list(map(int, input().split()))
X = []
for _ in range(N):
x, h = list(map(int, input().split()))
X.append((x, h))
X = sorted(X)[::-1]
Q = deque([])
ans = 0
k = 0
while X:
if len(Q) == 0 or X[-1][0] <= Q[0][0]:
x, h = X.p... | import sys
input = sys.stdin.readline
from collections import deque
N, D, A = list(map(int, input().split()))
X = []
for _ in range(N):
x, h = list(map(int, input().split()))
X.append((x, h))
X = sorted(X, key=lambda x: x[0])[::-1]
Q = deque([])
ans = 0
k = 0
while X:
if len(Q) == 0 or X[-1][0] <= Q[0][0]... | false | 0 | [
"-X = sorted(X)[::-1]",
"+X = sorted(X, key=lambda x: x[0])[::-1]"
] | false | 0.043265 | 0.040045 | 1.080407 | [
"s913594144",
"s279751683"
] |
u254871849 | p02821 | python | s361679032 | s058317148 | 1,222 | 563 | 14,392 | 16,740 | Accepted | Accepted | 53.93 | import sys
from itertools import accumulate
from bisect import bisect_left as bi_l, bisect_right as bisect_right
n, m, *a = list(map(int, sys.stdin.read().split()))
a.sort()
def possible(border):
pair_cnt = 0
for i in range(n):
aj = border - a[i]
j = bi_l(a, aj)
pair_cnt +=... | import sys
from itertools import accumulate
n, m, *a = list(map(int, sys.stdin.read().split()))
a.sort()
ma = a[-1]
cnt = [0] * (ma + 1)
cur = ma
for i in range(n-1, -1, -1):
if a[i] == cur:
cnt[cur] += 1
else:
while True:
cur -= 1
cnt[cur] = cnt[cur+1]
... | 44 | 65 | 979 | 1,381 | import sys
from itertools import accumulate
from bisect import bisect_left as bi_l, bisect_right as bisect_right
n, m, *a = list(map(int, sys.stdin.read().split()))
a.sort()
def possible(border):
pair_cnt = 0
for i in range(n):
aj = border - a[i]
j = bi_l(a, aj)
pair_cnt += n - j
... | import sys
from itertools import accumulate
n, m, *a = list(map(int, sys.stdin.read().split()))
a.sort()
ma = a[-1]
cnt = [0] * (ma + 1)
cur = ma
for i in range(n - 1, -1, -1):
if a[i] == cur:
cnt[cur] += 1
else:
while True:
cur -= 1
cnt[cur] = cnt[cur + 1]
i... | false | 32.307692 | [
"-from bisect import bisect_left as bi_l, bisect_right as bisect_right",
"+ma = a[-1]",
"+cnt = [0] * (ma + 1)",
"+cur = ma",
"+for i in range(n - 1, -1, -1):",
"+ if a[i] == cur:",
"+ cnt[cur] += 1",
"+ else:",
"+ while True:",
"+ cur -= 1",
"+ cnt[cur]... | false | 0.037175 | 0.060792 | 0.611519 | [
"s361679032",
"s058317148"
] |
u888092736 | p03724 | python | s891469678 | s514741628 | 114 | 99 | 31,708 | 31,808 | Accepted | Accepted | 13.16 | from itertools import accumulate
N, M, *ab = map(int, open(0).read().split())
acc = [0] * (N + 1)
for a, b in zip(*[iter(ab)] * 2):
if a > b:
a, b = b, a
acc[a - 1] += 1
acc[b - 1] -= 1
acc = list(accumulate(acc, initial=0))
print("NO") if any(a % 2 for a in acc) else print("YES")
| N, M, *ab = map(int, open(0).read().split())
ans = [0] * N
for a, b in zip(*[iter(ab)] * 2):
ans[a - 1] += 1
ans[b - 1] -= 1
print("NO") if any(a % 2 for a in ans) else print("YES")
| 11 | 6 | 313 | 195 | from itertools import accumulate
N, M, *ab = map(int, open(0).read().split())
acc = [0] * (N + 1)
for a, b in zip(*[iter(ab)] * 2):
if a > b:
a, b = b, a
acc[a - 1] += 1
acc[b - 1] -= 1
acc = list(accumulate(acc, initial=0))
print("NO") if any(a % 2 for a in acc) else print("YES")
| N, M, *ab = map(int, open(0).read().split())
ans = [0] * N
for a, b in zip(*[iter(ab)] * 2):
ans[a - 1] += 1
ans[b - 1] -= 1
print("NO") if any(a % 2 for a in ans) else print("YES")
| false | 45.454545 | [
"-from itertools import accumulate",
"-",
"-acc = [0] * (N + 1)",
"+ans = [0] * N",
"- if a > b:",
"- a, b = b, a",
"- acc[a - 1] += 1",
"- acc[b - 1] -= 1",
"-acc = list(accumulate(acc, initial=0))",
"-print(\"NO\") if any(a % 2 for a in acc) else print(\"YES\")",
"+ ans[a - ... | false | 0.041672 | 0.086301 | 0.482862 | [
"s891469678",
"s514741628"
] |
u506858457 | p03436 | python | s813584883 | s326144425 | 39 | 34 | 9,424 | 9,516 | Accepted | Accepted | 12.82 | from collections import deque
def MI(): return list(map(int, input().split()))
def bfs():
dist=[[INF] * (W+1) for _ in range(H+1)]
dist[sx][sy]=0
que=deque([])
que.append((sx,sy))
di=(-1,0,1,0)
dj=(0,-1,0,1)
while que:
(x,y)=que.popleft()
if x==gx and y==gy:
break
for k in r... | from collections import deque
def MI(): return list(map(int, input().split()))
INF=float('inf')
def bfs():
que=deque()
que.append((sx,sy))
dist=[[INF] *W for _ in range(H)]
dist[sx][sy]=0
dx=[1,0,-1,0]
dy=[0,1,0,-1]
while que:
x,y=que.popleft()
if x==gx and y==gy:
break
for... | 39 | 37 | 855 | 788 | from collections import deque
def MI():
return list(map(int, input().split()))
def bfs():
dist = [[INF] * (W + 1) for _ in range(H + 1)]
dist[sx][sy] = 0
que = deque([])
que.append((sx, sy))
di = (-1, 0, 1, 0)
dj = (0, -1, 0, 1)
while que:
(x, y) = que.popleft()
if x ... | from collections import deque
def MI():
return list(map(int, input().split()))
INF = float("inf")
def bfs():
que = deque()
que.append((sx, sy))
dist = [[INF] * W for _ in range(H)]
dist[sx][sy] = 0
dx = [1, 0, -1, 0]
dy = [0, 1, 0, -1]
while que:
x, y = que.popleft()
... | false | 5.128205 | [
"+INF = float(\"inf\")",
"+",
"+",
"- dist = [[INF] * (W + 1) for _ in range(H + 1)]",
"+ que = deque()",
"+ que.append((sx, sy))",
"+ dist = [[INF] * W for _ in range(H)]",
"- que = deque([])",
"- que.append((sx, sy))",
"- di = (-1, 0, 1, 0)",
"- dj = (0, -1, 0, 1)",
"... | false | 0.037975 | 0.070355 | 0.539771 | [
"s813584883",
"s326144425"
] |
u021019433 | p02785 | python | s448526330 | s791832157 | 162 | 149 | 26,180 | 26,764 | Accepted | Accepted | 8.02 | R = lambda: list(map(int, input().split()))
n, k = R()
print((sum(sorted(R())[:n - min(k,n)])))
| R = lambda: list(map(int, input().split()))
n, k = R()
print((sum(sorted(R())[:n - k]) if k < n else 0)) | 3 | 3 | 90 | 98 | R = lambda: list(map(int, input().split()))
n, k = R()
print((sum(sorted(R())[: n - min(k, n)])))
| R = lambda: list(map(int, input().split()))
n, k = R()
print((sum(sorted(R())[: n - k]) if k < n else 0))
| false | 0 | [
"-print((sum(sorted(R())[: n - min(k, n)])))",
"+print((sum(sorted(R())[: n - k]) if k < n else 0))"
] | false | 0.03671 | 0.03723 | 0.986044 | [
"s448526330",
"s791832157"
] |
u334712262 | p02694 | python | s692530975 | s516067050 | 227 | 59 | 78,456 | 63,608 | Accepted | Accepted | 74.01 | # -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, produc... | # -*- coding: utf-8 -*-
INF = 2**62-1
def read_int():
return int(eval(input()))
def slv(X):
T = 100
for i in range(INF):
T += T // 100
T = int(T)
if X <= T:
return i + 1
def main():
X = read_int()
print((slv(X)))
if __name__ == '__mai... | 75 | 24 | 1,342 | 330 | # -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permut... | # -*- coding: utf-8 -*-
INF = 2**62 - 1
def read_int():
return int(eval(input()))
def slv(X):
T = 100
for i in range(INF):
T += T // 100
T = int(T)
if X <= T:
return i + 1
def main():
X = read_int()
print((slv(X)))
if __name__ == "__main__":
main()
| false | 68 | [
"-import bisect",
"-import heapq",
"-import math",
"-import random",
"-import sys",
"-from collections import Counter, defaultdict, deque",
"-from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal",
"-from functools import lru_cache, reduce",
"-from itertools import combinations, combinations_wit... | false | 0.089952 | 0.130616 | 0.68867 | [
"s692530975",
"s516067050"
] |
u790710233 | p03283 | python | s939461646 | s359118428 | 1,646 | 1,412 | 26,252 | 34,160 | Accepted | Accepted | 14.22 | import numpy as np
n, m, q = list(map(int, input().split()))
cnt = [[0]*(n+1)for _ in range(n+1)]
for _ in range(m):
L, R = list(map(int, input().split()))
cnt[L][R] += 1
S = np.cumsum(cnt, axis=0).cumsum(axis=1).tolist()
for _ in range(q):
L, R = list(map(int, input().split()))
ans = S[R][... | import numpy as np
n, m, q = map(int, input().split())
cnt = [[0]*(n+1)for _ in range(n+1)]
for _ in range(m):
L, R = map(int, input().split())
cnt[L][R] += 1
S = np.cumsum(cnt, axis=0).cumsum(axis=1)
L, R = map(np.array, zip(
*[tuple(map(int, input().split())) for _ in range(q)]))
ans = S[... | 13 | 15 | 352 | 380 | import numpy as np
n, m, q = list(map(int, input().split()))
cnt = [[0] * (n + 1) for _ in range(n + 1)]
for _ in range(m):
L, R = list(map(int, input().split()))
cnt[L][R] += 1
S = np.cumsum(cnt, axis=0).cumsum(axis=1).tolist()
for _ in range(q):
L, R = list(map(int, input().split()))
ans = S[R][R] - ... | import numpy as np
n, m, q = map(int, input().split())
cnt = [[0] * (n + 1) for _ in range(n + 1)]
for _ in range(m):
L, R = map(int, input().split())
cnt[L][R] += 1
S = np.cumsum(cnt, axis=0).cumsum(axis=1)
L, R = map(np.array, zip(*[tuple(map(int, input().split())) for _ in range(q)]))
ans = S[R, R] - S[R, L... | false | 13.333333 | [
"-n, m, q = list(map(int, input().split()))",
"+n, m, q = map(int, input().split())",
"- L, R = list(map(int, input().split()))",
"+ L, R = map(int, input().split())",
"-S = np.cumsum(cnt, axis=0).cumsum(axis=1).tolist()",
"-for _ in range(q):",
"- L, R = list(map(int, input().split()))",
"- ... | false | 0.38371 | 0.447094 | 0.858231 | [
"s939461646",
"s359118428"
] |
u490553751 | p03607 | python | s135442527 | s510521333 | 586 | 234 | 50,008 | 16,624 | Accepted | Accepted | 60.07 | n=int(eval(input()))
s=set()
for i in range(n):
a=int(eval(input()))
if a in s:
s.remove(a)
else:
s.add(a)
print((len(s)))
| #template
from collections import Counter
def inputlist(): return [int(k) for k in input().split()]
#template
N = int(eval(input()))
A = [0]*N
for i in range(N):
A[i] = int(eval(input()))
c = Counter(A)
keys = list(c.keys())
ans = 0
for i in keys:
if c[i] % 2 != 0:
ans +=1
print(ans) | 9 | 15 | 145 | 296 | n = int(eval(input()))
s = set()
for i in range(n):
a = int(eval(input()))
if a in s:
s.remove(a)
else:
s.add(a)
print((len(s)))
| # template
from collections import Counter
def inputlist():
return [int(k) for k in input().split()]
# template
N = int(eval(input()))
A = [0] * N
for i in range(N):
A[i] = int(eval(input()))
c = Counter(A)
keys = list(c.keys())
ans = 0
for i in keys:
if c[i] % 2 != 0:
ans += 1
print(ans)
| false | 40 | [
"-n = int(eval(input()))",
"-s = set()",
"-for i in range(n):",
"- a = int(eval(input()))",
"- if a in s:",
"- s.remove(a)",
"- else:",
"- s.add(a)",
"-print((len(s)))",
"+# template",
"+from collections import Counter",
"+",
"+",
"+def inputlist():",
"+ return ... | false | 0.061829 | 0.038657 | 1.599418 | [
"s135442527",
"s510521333"
] |
u784022244 | p03387 | python | s319550913 | s130702852 | 169 | 17 | 38,256 | 3,060 | Accepted | Accepted | 89.94 | A,B,C=list(map(int, input().split()))
L=sorted([A,B,C])
ans=(L[2]-L[1]+L[2]-L[0])//2+((L[2]-L[1]+L[2]-L[0])%2)*2
print(ans) | from math import ceil
A,B,C=list(map(int, input().split()))
L=sorted([A,B,C])
n1=L[0]
n2=L[1]
n3=L[2]
fir=ceil((n2-n1)/2)
if n1+2*fir!=n2:
sec=1
else:
sec=0
ans=n3+sec-(n1+2*fir)+fir+sec
print(ans)
#print(fir, sec)
#6+1-(4) | 4 | 17 | 120 | 243 | A, B, C = list(map(int, input().split()))
L = sorted([A, B, C])
ans = (L[2] - L[1] + L[2] - L[0]) // 2 + ((L[2] - L[1] + L[2] - L[0]) % 2) * 2
print(ans)
| from math import ceil
A, B, C = list(map(int, input().split()))
L = sorted([A, B, C])
n1 = L[0]
n2 = L[1]
n3 = L[2]
fir = ceil((n2 - n1) / 2)
if n1 + 2 * fir != n2:
sec = 1
else:
sec = 0
ans = n3 + sec - (n1 + 2 * fir) + fir + sec
print(ans)
# print(fir, sec)
# 6+1-(4)
| false | 76.470588 | [
"+from math import ceil",
"+",
"-ans = (L[2] - L[1] + L[2] - L[0]) // 2 + ((L[2] - L[1] + L[2] - L[0]) % 2) * 2",
"+n1 = L[0]",
"+n2 = L[1]",
"+n3 = L[2]",
"+fir = ceil((n2 - n1) / 2)",
"+if n1 + 2 * fir != n2:",
"+ sec = 1",
"+else:",
"+ sec = 0",
"+ans = n3 + sec - (n1 + 2 * fir) + fir... | false | 0.03631 | 0.036682 | 0.989865 | [
"s319550913",
"s130702852"
] |
u037430802 | p03504 | python | s830859836 | s936668140 | 688 | 449 | 26,612 | 26,612 | Accepted | Accepted | 34.74 |
def main():
N,C = list(map(int, input().split()))
# 各時間各チャンネルで録画機が動いてるかどうか
R = [[0]*(10**5) for _ in range(C)]
for _ in range(N):
s,t,c = list(map(int, input().split()))
#チャンネルcをsからtまで録画、sの0.5秒前から録画機を使うのでs-1始まりにする
R[c-1][s-1:t] = [1] * (t-(s-1))
ans ... |
def main():
N,C = list(map(int, input().split()))
# 各時間各チャンネルで録画機が動いてるかどうか
R = [[0]*(10**5) for _ in range(C)]
for _ in range(N):
s,t,c = list(map(int, input().split()))
#チャンネルcをsからtまで録画、sの0.5秒前から録画機を使うのでs-1始まりにする
R[c-1][s-1:t] = [1] * (t-(s-1))
ans ... | 26 | 28 | 560 | 610 | def main():
N, C = list(map(int, input().split()))
# 各時間各チャンネルで録画機が動いてるかどうか
R = [[0] * (10**5) for _ in range(C)]
for _ in range(N):
s, t, c = list(map(int, input().split()))
# チャンネルcをsからtまで録画、sの0.5秒前から録画機を使うのでs-1始まりにする
R[c - 1][s - 1 : t] = [1] * (t - (s - 1))
ans = 0
f... | def main():
N, C = list(map(int, input().split()))
# 各時間各チャンネルで録画機が動いてるかどうか
R = [[0] * (10**5) for _ in range(C)]
for _ in range(N):
s, t, c = list(map(int, input().split()))
# チャンネルcをsからtまで録画、sの0.5秒前から録画機を使うのでs-1始まりにする
R[c - 1][s - 1 : t] = [1] * (t - (s - 1))
ans = max(lis... | false | 7.142857 | [
"+ ans = max(list(map(sum, list(zip(*R)))))",
"+ \"\"\"",
"- # 時刻ごとにそれぞれのチャンネルで録画機を使ってるかどうか数え上げる",
"+ #時刻ごとにそれぞれのチャンネルで録画機を使ってるかどうか数え上げる",
"- if R[ch][t] == 1:",
"- cnt += 1",
"+ if R[ch][t] == 1: cnt += 1",
"+ \"\"\""
] | false | 0.289264 | 0.076831 | 3.764945 | [
"s830859836",
"s936668140"
] |
u874059570 | p02898 | python | s989028612 | s749810930 | 53 | 48 | 11,916 | 11,908 | Accepted | Accepted | 9.43 | n, k = list(map(int,input().split()))
h = list(map(int, input().split()))
cnt = 0
for i in range(len(h)):
if h[i] >= k:
cnt += 1
print(cnt) | N, K = list(map(int, input().split()))
h_lis = list(map(int, input().split()))
cnt=0
for h in h_lis:
if h>=K:cnt+=1
print(cnt)
| 7 | 7 | 151 | 132 | n, k = list(map(int, input().split()))
h = list(map(int, input().split()))
cnt = 0
for i in range(len(h)):
if h[i] >= k:
cnt += 1
print(cnt)
| N, K = list(map(int, input().split()))
h_lis = list(map(int, input().split()))
cnt = 0
for h in h_lis:
if h >= K:
cnt += 1
print(cnt)
| false | 0 | [
"-n, k = list(map(int, input().split()))",
"-h = list(map(int, input().split()))",
"+N, K = list(map(int, input().split()))",
"+h_lis = list(map(int, input().split()))",
"-for i in range(len(h)):",
"- if h[i] >= k:",
"+for h in h_lis:",
"+ if h >= K:"
] | false | 0.038381 | 0.043434 | 0.883677 | [
"s989028612",
"s749810930"
] |
u926817789 | p03170 | python | s265134190 | s445376645 | 429 | 372 | 51,632 | 47,344 | Accepted | Accepted | 13.29 | n,k=list(map(int,input().split()))
a=list(map(int,input().split()))
mini=min(a)
dp1=[-1 for i in range(k+1)]
dp2=[-1 for i in range(k+1)]
for x in range(k+1):
if x == 0 or mini > x:
dp1[x]=False
dp2[x]=False
continue
dp1[x]=False
dp2[x]=False
for v in a:
if v>x:
continue
dp1[x]=dp1[x] or... | n,k=list(map(int,input().split()))
a=list(map(int,input().split()))
mini=min(a)
dp=[-1 for i in range(k+1)]
for x in range(k+1):
if x == 0 or mini > x:
dp[x]=False
continue
dp[x]=False
for v in a:
if v>x:
continue
dp[x]=dp[x] or not dp[x-v]
if dp[k]:
print("First")
else:
print("Secon... | 22 | 19 | 422 | 323 | n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
mini = min(a)
dp1 = [-1 for i in range(k + 1)]
dp2 = [-1 for i in range(k + 1)]
for x in range(k + 1):
if x == 0 or mini > x:
dp1[x] = False
dp2[x] = False
continue
dp1[x] = False
dp2[x] = False
for v in a... | n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
mini = min(a)
dp = [-1 for i in range(k + 1)]
for x in range(k + 1):
if x == 0 or mini > x:
dp[x] = False
continue
dp[x] = False
for v in a:
if v > x:
continue
dp[x] = dp[x] or not dp[x - v... | false | 13.636364 | [
"-dp1 = [-1 for i in range(k + 1)]",
"-dp2 = [-1 for i in range(k + 1)]",
"+dp = [-1 for i in range(k + 1)]",
"- dp1[x] = False",
"- dp2[x] = False",
"+ dp[x] = False",
"- dp1[x] = False",
"- dp2[x] = False",
"+ dp[x] = False",
"- dp1[x] = dp1[x] or not dp2[x -... | false | 0.048193 | 0.043183 | 1.116036 | [
"s265134190",
"s445376645"
] |
u930705402 | p03090 | python | s413322590 | s142734851 | 33 | 29 | 9,228 | 9,368 | Accepted | Accepted | 12.12 | N=int(eval(input()))
if N%2:
print((N*(N-1)//2-N//2))
for i in range(1,N+1):
for j in range(1,i):
if i+j==N:
continue
print((i,j))
else:
print((N*(N-1)//2-N//2))
for i in range(1,N+1):
for j in range(1,i):
if i+j==N+1:
... | N=int(eval(input()))
P=N if N%2 else N+1
print((N*(N-1)//2-N//2))
for i in range(1,N+1):
for j in range(1,i):
if i+j==P:
continue
print((i,j)) | 16 | 8 | 354 | 171 | N = int(eval(input()))
if N % 2:
print((N * (N - 1) // 2 - N // 2))
for i in range(1, N + 1):
for j in range(1, i):
if i + j == N:
continue
print((i, j))
else:
print((N * (N - 1) // 2 - N // 2))
for i in range(1, N + 1):
for j in range(1, i):
... | N = int(eval(input()))
P = N if N % 2 else N + 1
print((N * (N - 1) // 2 - N // 2))
for i in range(1, N + 1):
for j in range(1, i):
if i + j == P:
continue
print((i, j))
| false | 50 | [
"-if N % 2:",
"- print((N * (N - 1) // 2 - N // 2))",
"- for i in range(1, N + 1):",
"- for j in range(1, i):",
"- if i + j == N:",
"- continue",
"- print((i, j))",
"-else:",
"- print((N * (N - 1) // 2 - N // 2))",
"- for i in range(1, N + 1)... | false | 0.046555 | 0.048141 | 0.967056 | [
"s413322590",
"s142734851"
] |
u515740713 | p02973 | python | s306592602 | s997209845 | 279 | 127 | 85,188 | 89,784 | Accepted | Accepted | 54.48 | # -*- coding: utf-8 -*-
# E - Sequence Decomposing
import sys
from bisect import bisect_left
from collections import deque
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N = int(readline())
A = list(map(int,read().split()))
INF = 10**31
q = deq... | # -*- coding: utf-8 -*-
# E - Sequence Decomposing
import sys
from bisect import bisect_right
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N = int(readline())
A = list(map(int,read().split()))
X = [-1]*N
for a in A:
i = bisect_right(X,a-1)-1
... | 23 | 15 | 461 | 358 | # -*- coding: utf-8 -*-
# E - Sequence Decomposing
import sys
from bisect import bisect_left
from collections import deque
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N = int(readline())
A = list(map(int, read().split()))
INF = 10**31
q = deque([])
for a in ... | # -*- coding: utf-8 -*-
# E - Sequence Decomposing
import sys
from bisect import bisect_right
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N = int(readline())
A = list(map(int, read().split()))
X = [-1] * N
for a in A:
i = bisect_right(X, a - 1) - 1
X... | false | 34.782609 | [
"-from bisect import bisect_left",
"-from collections import deque",
"+from bisect import bisect_right",
"-INF = 10**31",
"-q = deque([])",
"+X = [-1] * N",
"- idx = bisect_left(q, a)",
"- if idx == 0:",
"- q.appendleft(a)",
"- else:",
"- q[idx - 1] = a",
"-print((len(q)... | false | 0.036656 | 0.03687 | 0.994193 | [
"s306592602",
"s997209845"
] |
u874395007 | p02383 | python | s083855813 | s133653431 | 60 | 50 | 7,188 | 7,180 | Accepted | Accepted | 16.67 | from typing import List
class Dice:
def __init__(self, surface: List[int]):
self.surface = surface
def get_upper_sursurface(self) -> int:
return self.surface[0]
def invoke_method(self, mkey: str) -> None:
if mkey == 'S':
self.S()
return None... | from typing import List
class Dice:
def __init__(self, s: List[int]):
self.s = s
def get_s(self) -> int:
return self.s[0]
def invoke_method(self, mkey: str) -> None:
if mkey == 'S':
self.S()
return None
if mkey == 'N':
... | 76 | 64 | 1,965 | 1,552 | from typing import List
class Dice:
def __init__(self, surface: List[int]):
self.surface = surface
def get_upper_sursurface(self) -> int:
return self.surface[0]
def invoke_method(self, mkey: str) -> None:
if mkey == "S":
self.S()
return None
if mke... | from typing import List
class Dice:
def __init__(self, s: List[int]):
self.s = s
def get_s(self) -> int:
return self.s[0]
def invoke_method(self, mkey: str) -> None:
if mkey == "S":
self.S()
return None
if mkey == "N":
self.N()
... | false | 15.789474 | [
"- def __init__(self, surface: List[int]):",
"- self.surface = surface",
"+ def __init__(self, s: List[int]):",
"+ self.s = s",
"- def get_upper_sursurface(self) -> int:",
"- return self.surface[0]",
"+ def get_s(self) -> int:",
"+ return self.s[0]",
"+ def... | false | 0.050961 | 0.040503 | 1.2582 | [
"s083855813",
"s133653431"
] |
u621935300 | p02690 | python | s252460700 | s806272095 | 317 | 55 | 87,332 | 72,940 | Accepted | Accepted | 82.65 | # -*- coding: utf-8 -*-
N=eval(input())
#約数列挙
def make_divisors(n):
divisors=[]
for i in range(1, int(n**0.5)+1):
if n%i==0:
divisors.append(i)
if i!=n/i:
divisors.append(n/i)
return divisors
def func(a,b):
return a**5-b**5
L=make_divi... | # -*- coding: utf-8 -*-
N=eval(input())
#約数列挙
def make_divisors(n):
divisors=[]
for i in range(1, int(n**0.5)+1):
if n%i==0:
divisors.append(i)
if i!=n/i:
divisors.append(n/i)
return divisors
def func(a,b):
return a**5-b**5
L=make_divi... | 25 | 24 | 476 | 459 | # -*- coding: utf-8 -*-
N = eval(input())
# 約数列挙
def make_divisors(n):
divisors = []
for i in range(1, int(n**0.5) + 1):
if n % i == 0:
divisors.append(i)
if i != n / i:
divisors.append(n / i)
return divisors
def func(a, b):
return a**5 - b**5
L = make... | # -*- coding: utf-8 -*-
N = eval(input())
# 約数列挙
def make_divisors(n):
divisors = []
for i in range(1, int(n**0.5) + 1):
if n % i == 0:
divisors.append(i)
if i != n / i:
divisors.append(n / i)
return divisors
def func(a, b):
return a**5 - b**5
L = make... | false | 4 | [
"- ret = func(a, b)",
"- if ret == N:",
"+ if func(a, b) == N:"
] | false | 0.048447 | 0.038695 | 1.252032 | [
"s252460700",
"s806272095"
] |
u939026953 | p04045 | python | s403191835 | s965074556 | 83 | 56 | 3,060 | 3,060 | Accepted | Accepted | 32.53 | n,k=list(map(int,input().split()))
D = list(map(str,input().split()))
x = n
while True:
y = str(x)
for i in range(len(y)):
if y[i] in D:
break
else:
ans = x
break
x += 1
print(ans) | n,k=list(map(int,input().split()))
D = list(map(str,input().split()))
x = n
while True:
y = str(x)
for i in y:
if i in D:
break
else:
ans = x
break
x += 1
print(ans) | 13 | 13 | 212 | 197 | n, k = list(map(int, input().split()))
D = list(map(str, input().split()))
x = n
while True:
y = str(x)
for i in range(len(y)):
if y[i] in D:
break
else:
ans = x
break
x += 1
print(ans)
| n, k = list(map(int, input().split()))
D = list(map(str, input().split()))
x = n
while True:
y = str(x)
for i in y:
if i in D:
break
else:
ans = x
break
x += 1
print(ans)
| false | 0 | [
"- for i in range(len(y)):",
"- if y[i] in D:",
"+ for i in y:",
"+ if i in D:"
] | false | 0.047133 | 0.083925 | 0.561608 | [
"s403191835",
"s965074556"
] |
u038021590 | p02888 | python | s962271593 | s611165011 | 1,579 | 339 | 3,188 | 73,840 | Accepted | Accepted | 78.53 | import bisect
N = int(eval(input()))
L = list(map(int, input().split()))
L.sort()
ans = 0
for i in range(N-2):
for j in range(i+1, N-1):
index = bisect.bisect_right(L, L[i] + L[j]-1)
ans += index - j - 1
print(ans)
| from bisect import bisect_left
N = int(eval(input()))
L = list(map(int, input().split()))
L.sort()
ans = 0
for i in range(N):
for j in range(i+1, N):
x = L[i] + L[j]
y = bisect_left(L, x)
ans += y - j - 1
print(ans) | 16 | 12 | 250 | 249 | import bisect
N = int(eval(input()))
L = list(map(int, input().split()))
L.sort()
ans = 0
for i in range(N - 2):
for j in range(i + 1, N - 1):
index = bisect.bisect_right(L, L[i] + L[j] - 1)
ans += index - j - 1
print(ans)
| from bisect import bisect_left
N = int(eval(input()))
L = list(map(int, input().split()))
L.sort()
ans = 0
for i in range(N):
for j in range(i + 1, N):
x = L[i] + L[j]
y = bisect_left(L, x)
ans += y - j - 1
print(ans)
| false | 25 | [
"-import bisect",
"+from bisect import bisect_left",
"-for i in range(N - 2):",
"- for j in range(i + 1, N - 1):",
"- index = bisect.bisect_right(L, L[i] + L[j] - 1)",
"- ans += index - j - 1",
"+for i in range(N):",
"+ for j in range(i + 1, N):",
"+ x = L[i] + L[j]",
"+... | false | 0.03605 | 0.060585 | 0.59503 | [
"s962271593",
"s611165011"
] |
u852690916 | p02794 | python | s549453237 | s599315213 | 1,542 | 349 | 43,484 | 42,732 | Accepted | Accepted | 77.37 | import sys
def main():
input = sys.stdin.readline
N = int(eval(input()))
E = [[] for _ in range(N)]
for i in range(N-1):
a, b = list(map(int, input().split()))
a, b = a-1, b-1
E[a].append((b,i))
E[b].append((a,i))
def dfs(s, g):
par = [(-1,-1)... | import sys
def main():
input = sys.stdin.readline
N = int(eval(input()))
E = [[] for _ in range(N)]
for i in range(N-1):
a, b = list(map(int, input().split()))
a, b = a-1, b-1
E[a].append((b,i))
E[b].append((a,i))
def dfs(s, g):
par = [(-1,-1)... | 54 | 62 | 1,291 | 1,710 | import sys
def main():
input = sys.stdin.readline
N = int(eval(input()))
E = [[] for _ in range(N)]
for i in range(N - 1):
a, b = list(map(int, input().split()))
a, b = a - 1, b - 1
E[a].append((b, i))
E[b].append((a, i))
def dfs(s, g):
par = [(-1, -1)] * N... | import sys
def main():
input = sys.stdin.readline
N = int(eval(input()))
E = [[] for _ in range(N)]
for i in range(N - 1):
a, b = list(map(int, input().split()))
a, b = a - 1, b - 1
E[a].append((b, i))
E[b].append((a, i))
def dfs(s, g):
par = [(-1, -1)] * N... | false | 12.903226 | [
"- return 1 << (N - 1 - bin(s).count(\"1\"))",
"+ return 1 << (N - 1 - popcount(s))",
"+def popcount(x):",
"+ x = (x & 0x5555555555555555) + (x >> 1 & 0x5555555555555555)",
"+ x = (x & 0x3333333333333333) + (x >> 2 & 0x3333333333333333)",
"+ x = (x & 0x0F0F0F0F0F0F0F0F) + (x >> 4 & ... | false | 0.037505 | 0.037622 | 0.996872 | [
"s549453237",
"s599315213"
] |
u427344224 | p03776 | python | s320577043 | s916946541 | 21 | 18 | 3,188 | 3,064 | Accepted | Accepted | 14.29 | def combination(n, r):
r = min(n - r, r)
result = 1
for i in range(n, n - r, -1):
result *= i
for i in range(1, r + 1):
result //= i
return result
N, A, B = list(map(int, input().split()))
v_list = list(map(int, input().split()))
v_list.sort(reverse=True)
mean_max = ... | def combination(n, r):
r = min(n - r, r)
result = 1
for i in range(n, n - r, -1):
result *= i
for i in range(1, r + 1):
result //= i
return result
N, A, B = list(map(int, input().split()))
v_list = list(map(int, input().split()))
v_list.sort(reverse=True)
mean_max = ... | 28 | 28 | 678 | 676 | def combination(n, r):
r = min(n - r, r)
result = 1
for i in range(n, n - r, -1):
result *= i
for i in range(1, r + 1):
result //= i
return result
N, A, B = list(map(int, input().split()))
v_list = list(map(int, input().split()))
v_list.sort(reverse=True)
mean_max = sum(v_list[:A])... | def combination(n, r):
r = min(n - r, r)
result = 1
for i in range(n, n - r, -1):
result *= i
for i in range(1, r + 1):
result //= i
return result
N, A, B = list(map(int, input().split()))
v_list = list(map(int, input().split()))
v_list.sort(reverse=True)
mean_max = sum(v_list[:A])... | false | 0 | [
"-print(mean_max)",
"-print((comb if comb != 0 else 1))",
"+print((\"{:.10f}\".format(mean_max)))",
"+print(comb)"
] | false | 0.043944 | 0.043018 | 1.021516 | [
"s320577043",
"s916946541"
] |
u372144784 | p02763 | python | s317948680 | s841904138 | 626 | 411 | 80,772 | 68,100 | Accepted | Accepted | 34.35 | import sys
readline = sys.stdin.buffer.readline
kijun = ord("a")
n = int(readline())
s = readline().rstrip().decode('utf-8')
q = int(readline())
lst1 = [0]*n
def pow(n,p): #繰り返し二乗法(nのp乗)
res = 1
while p > 0:
if p % 2 == 0:
n = n ** 2
p //= 2
else:
... | #ABC157-E Simple String Queries
"""
英小文字26字が含まれるか否かを、2**26のint型で管理するセグ木。
これをbitwise-segment treeと言うらしい。
解法:
葉はその英小文字のbitで管理する。
segfuncにはx|yを登録することで、区間クエリをとった時に
2進数表記で1が出てくる回数が答えになる。
"""
import sys
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0
#input
n = int(readline())
s = ... | 88 | 93 | 1,915 | 2,085 | import sys
readline = sys.stdin.buffer.readline
kijun = ord("a")
n = int(readline())
s = readline().rstrip().decode("utf-8")
q = int(readline())
lst1 = [0] * n
def pow(n, p): # 繰り返し二乗法(nのp乗)
res = 1
while p > 0:
if p % 2 == 0:
n = n**2
p //= 2
else:
res = ... | # ABC157-E Simple String Queries
"""
英小文字26字が含まれるか否かを、2**26のint型で管理するセグ木。
これをbitwise-segment treeと言うらしい。
解法:
葉はその英小文字のbitで管理する。
segfuncにはx|yを登録することで、区間クエリをとった時に
2進数表記で1が出てくる回数が答えになる。
"""
import sys
readline = sys.stdin.buffer.readline
def even(n):
return 1 if n % 2 == 0 else 0
# input
n = int(readline())
s = r... | false | 5.376344 | [
"+# ABC157-E Simple String Queries",
"+\"\"\"",
"+英小文字26字が含まれるか否かを、2**26のint型で管理するセグ木。",
"+これをbitwise-segment treeと言うらしい。",
"+解法:",
"+葉はその英小文字のbitで管理する。",
"+segfuncにはx|yを登録することで、区間クエリをとった時に",
"+2進数表記で1が出てくる回数が答えになる。",
"+\"\"\"",
"-kijun = ord(\"a\")",
"+",
"+",
"+def even(n):",
"+ retur... | false | 0.045032 | 0.038972 | 1.1555 | [
"s317948680",
"s841904138"
] |
u042209706 | p02595 | python | s414708143 | s519142264 | 589 | 510 | 67,520 | 9,188 | Accepted | Accepted | 13.41 | n,d = list(map(int,input().split()))
x = [input().split() for i in range(n)]
D = d**2
ans = 0
for i in range(n):
kyori = int(x[i][0])**2 + int(x[i][1])**2
if kyori <= D:
ans = ans + 1
print(ans) | n,d = list(map(int,input().split()))
ans = 0
for i in range(n):
x,y = list(map(int,input().split()))
D = x **2 + y ** 2
if D <= d **2:
ans = ans + 1
print(ans) | 9 | 8 | 210 | 164 | n, d = list(map(int, input().split()))
x = [input().split() for i in range(n)]
D = d**2
ans = 0
for i in range(n):
kyori = int(x[i][0]) ** 2 + int(x[i][1]) ** 2
if kyori <= D:
ans = ans + 1
print(ans)
| n, d = list(map(int, input().split()))
ans = 0
for i in range(n):
x, y = list(map(int, input().split()))
D = x**2 + y**2
if D <= d**2:
ans = ans + 1
print(ans)
| false | 11.111111 | [
"-x = [input().split() for i in range(n)]",
"-D = d**2",
"- kyori = int(x[i][0]) ** 2 + int(x[i][1]) ** 2",
"- if kyori <= D:",
"+ x, y = list(map(int, input().split()))",
"+ D = x**2 + y**2",
"+ if D <= d**2:"
] | false | 0.039088 | 0.085499 | 0.457172 | [
"s414708143",
"s519142264"
] |
u046187684 | p02918 | python | s456461724 | s955261915 | 28 | 19 | 3,316 | 3,316 | Accepted | Accepted | 32.14 | def solve(string):
n, k, s = string.split()
k = int(k)
ans = change = 0
for s0, s1 in zip(s, s[1:]):
if s0 == s1:
ans += 1
else:
change += 1
return str(ans + min(2 * k, change))
if __name__ == '__main__':
print((solve('\n'.join([eval(input()... | def solve(string):
n, k, s = string.split()
n, k = list(map(int, [n, k]))
ans = n - 1 - s.count("RL") - s.count("LR")
return str(min(ans + 2 * k, n - 1))
if __name__ == '__main__':
print((solve('\n'.join([eval(input()), eval(input())]))))
| 14 | 9 | 328 | 249 | def solve(string):
n, k, s = string.split()
k = int(k)
ans = change = 0
for s0, s1 in zip(s, s[1:]):
if s0 == s1:
ans += 1
else:
change += 1
return str(ans + min(2 * k, change))
if __name__ == "__main__":
print((solve("\n".join([eval(input()), eval(input... | def solve(string):
n, k, s = string.split()
n, k = list(map(int, [n, k]))
ans = n - 1 - s.count("RL") - s.count("LR")
return str(min(ans + 2 * k, n - 1))
if __name__ == "__main__":
print((solve("\n".join([eval(input()), eval(input())]))))
| false | 35.714286 | [
"- k = int(k)",
"- ans = change = 0",
"- for s0, s1 in zip(s, s[1:]):",
"- if s0 == s1:",
"- ans += 1",
"- else:",
"- change += 1",
"- return str(ans + min(2 * k, change))",
"+ n, k = list(map(int, [n, k]))",
"+ ans = n - 1 - s.count(\"RL\") - ... | false | 0.036114 | 0.03709 | 0.973687 | [
"s456461724",
"s955261915"
] |
u695811449 | p03171 | python | s515718941 | s638404498 | 1,740 | 1,575 | 173,576 | 173,320 | Accepted | Accepted | 9.48 | import sys
input = sys.stdin.readline
N=int(eval(input()))
A=list(map(int,input().split()))
SCORE=[[None for i in range(N+1)] for j in range(N+1)]
def score(i,j,k,l):#A[i:j)が残っているときのscore,1:Xの手番,-1:Yの手番
#print(i,j,k,l)
if SCORE[i][j]!=None:
return SCORE[i][j]+k
if i==j:
... | import sys
input = sys.stdin.readline
N=int(eval(input()))
A=list(map(int,input().split()))
SCORE=[[None for i in range(N+1)] for j in range(N+1)]
def score(i,j,k,l):#A[i:j)が残っているときのscore,1:Xの手番,-1:Yの手番
if i==j:
SCORE[i][j]=0
return
if SCORE[i][j]!=None:
retur... | 34 | 31 | 732 | 625 | import sys
input = sys.stdin.readline
N = int(eval(input()))
A = list(map(int, input().split()))
SCORE = [[None for i in range(N + 1)] for j in range(N + 1)]
def score(i, j, k, l): # A[i:j)が残っているときのscore,1:Xの手番,-1:Yの手番
# print(i,j,k,l)
if SCORE[i][j] != None:
return SCORE[i][j] + k
if i == j:
... | import sys
input = sys.stdin.readline
N = int(eval(input()))
A = list(map(int, input().split()))
SCORE = [[None for i in range(N + 1)] for j in range(N + 1)]
def score(i, j, k, l): # A[i:j)が残っているときのscore,1:Xの手番,-1:Yの手番
if i == j:
SCORE[i][j] = 0
return
if SCORE[i][j] != None:
return ... | false | 8.823529 | [
"- # print(i,j,k,l)",
"+ if i == j:",
"+ SCORE[i][j] = 0",
"+ return",
"- if i == j:",
"- SCORE[i][j] = 0",
"- return k",
"- SCORE[i][j] = (",
"- max(score(i + 1, j, k + A[i], -l), score(i, j - 1, k + A[j - 1], -l)) - k",
"- )",
"- ... | false | 0.098616 | 0.055116 | 1.789231 | [
"s515718941",
"s638404498"
] |
u048867491 | p03107 | python | s035888391 | s759311971 | 524 | 19 | 3,316 | 3,188 | Accepted | Accepted | 96.37 | A = eval(input())
len0 = lenA = len(A)
while(True):
A = A.replace("10","").replace("01","").replace("1"*1000 + "0"*1000,"").replace("0"*1000 + "1"*1000,"")
if lenA == len(A):
break
lenA = len(A)
print((len0 - lenA))
| A = eval(input())
C0 = A.count('0')
C1 = A.count('1')
print((2*min(C0,C1)))
| 9 | 7 | 238 | 82 | A = eval(input())
len0 = lenA = len(A)
while True:
A = (
A.replace("10", "")
.replace("01", "")
.replace("1" * 1000 + "0" * 1000, "")
.replace("0" * 1000 + "1" * 1000, "")
)
if lenA == len(A):
break
lenA = len(A)
print((len0 - lenA))
| A = eval(input())
C0 = A.count("0")
C1 = A.count("1")
print((2 * min(C0, C1)))
| false | 22.222222 | [
"-len0 = lenA = len(A)",
"-while True:",
"- A = (",
"- A.replace(\"10\", \"\")",
"- .replace(\"01\", \"\")",
"- .replace(\"1\" * 1000 + \"0\" * 1000, \"\")",
"- .replace(\"0\" * 1000 + \"1\" * 1000, \"\")",
"- )",
"- if lenA == len(A):",
"- break",
"- ... | false | 0.044194 | 0.037389 | 1.181994 | [
"s035888391",
"s759311971"
] |
u006880673 | p02793 | python | s699619425 | s936508518 | 1,564 | 211 | 75,132 | 75,908 | Accepted | Accepted | 86.51 | from math import gcd
def lcm(a, b):
return a*b//gcd(a,b)
def main():
N = int(eval(input()))
A = list(map(int, input().split()))
mod = 10**9 + 7
LCM = 1
for a in A:
LCM = lcm(LCM, a)
ans = 0
for a in A:
ans += (LCM//a)
print((ans % mod))
mai... | ### 素因数分解する。
from collections import defaultdict
def factorize(n):
"""
"""
tmp = n
for i in range(2, int(n**0.5)+1):
if tmp % i==0:
cnt = 0
while tmp % i == 0:
cnt += 1
tmp //= i
if i in LCM:
LCM... | 18 | 51 | 315 | 1,029 | from math import gcd
def lcm(a, b):
return a * b // gcd(a, b)
def main():
N = int(eval(input()))
A = list(map(int, input().split()))
mod = 10**9 + 7
LCM = 1
for a in A:
LCM = lcm(LCM, a)
ans = 0
for a in A:
ans += LCM // a
print((ans % mod))
main()
| ### 素因数分解する。
from collections import defaultdict
def factorize(n):
""" """
tmp = n
for i in range(2, int(n**0.5) + 1):
if tmp % i == 0:
cnt = 0
while tmp % i == 0:
cnt += 1
tmp //= i
if i in LCM:
LCM[i] = max(LCM[i... | false | 64.705882 | [
"-from math import gcd",
"+### 素因数分解する。",
"+from collections import defaultdict",
"-def lcm(a, b):",
"- return a * b // gcd(a, b)",
"+def factorize(n):",
"+ \"\"\" \"\"\"",
"+ tmp = n",
"+ for i in range(2, int(n**0.5) + 1):",
"+ if tmp % i == 0:",
"+ cnt = 0",
"+... | false | 0.067751 | 0.057682 | 1.174546 | [
"s699619425",
"s936508518"
] |
u030626972 | p03111 | python | s618938356 | s476089719 | 485 | 398 | 3,064 | 3,064 | Accepted | Accepted | 17.94 | def main():
#入力をとる
n,a,b,c = list(map(int,input().split()))
moto = [int(eval(input())) for i in range(n)]
take = []
take.append(a)
take.append(b)
take.append(c)
mp = 10000000000
pt= []
#全探索
for i in range(2**(2*n)):
pt = []
for j in range(n):
... | minmp = 10000000
def dfs(depth, pt):
if depth==n:
mp_tmp = 0
all_used = True
for k in range(3):
if pt.count(k) == 0:
all_used = False
break
sum_tmp = 0
mp_tmp += (pt.count(k) - 1)*10
for l in range... | 48 | 47 | 1,124 | 911 | def main():
# 入力をとる
n, a, b, c = list(map(int, input().split()))
moto = [int(eval(input())) for i in range(n)]
take = []
take.append(a)
take.append(b)
take.append(c)
mp = 10000000000
pt = []
# 全探索
for i in range(2 ** (2 * n)):
pt = []
for j in range(n):
... | minmp = 10000000
def dfs(depth, pt):
if depth == n:
mp_tmp = 0
all_used = True
for k in range(3):
if pt.count(k) == 0:
all_used = False
break
sum_tmp = 0
mp_tmp += (pt.count(k) - 1) * 10
for l in range(n):
... | false | 2.083333 | [
"-def main():",
"- # 入力をとる",
"- n, a, b, c = list(map(int, input().split()))",
"- moto = [int(eval(input())) for i in range(n)]",
"- take = []",
"- take.append(a)",
"- take.append(b)",
"- take.append(c)",
"- mp = 10000000000",
"- pt = []",
"- # 全探索",
"- for i i... | false | 0.39196 | 0.366306 | 1.070035 | [
"s618938356",
"s476089719"
] |
u372144784 | p03161 | python | s169543057 | s959909047 | 434 | 348 | 56,800 | 52,464 | Accepted | Accepted | 19.82 | n,k = list(map(int,input().split()))
lst1 = list(map(int,input().split()))
dp = [float("inf") for _ in range(n)]
dp[0] = 0
for i in range(1,n):
for j in range(max(0,i-k),i):
dp[i] = min(dp[i],dp[j]+abs(lst1[i]-lst1[j]))
print((dp[-1])) | import sys
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0
n,k = list(map(int,readline().split()))
lst1 = list(map(int,readline().split()))
dp = [10**10 for _ in range(n)]
dp[0] = 0
for i in range(1,n):
for j in range(1,k+1):
if i-j < 0:
break
dp[i] = min(dp[i],dp[i-j]... | 12 | 16 | 254 | 356 | n, k = list(map(int, input().split()))
lst1 = list(map(int, input().split()))
dp = [float("inf") for _ in range(n)]
dp[0] = 0
for i in range(1, n):
for j in range(max(0, i - k), i):
dp[i] = min(dp[i], dp[j] + abs(lst1[i] - lst1[j]))
print((dp[-1]))
| import sys
readline = sys.stdin.buffer.readline
def even(n):
return 1 if n % 2 == 0 else 0
n, k = list(map(int, readline().split()))
lst1 = list(map(int, readline().split()))
dp = [10**10 for _ in range(n)]
dp[0] = 0
for i in range(1, n):
for j in range(1, k + 1):
if i - j < 0:
break
... | false | 25 | [
"-n, k = list(map(int, input().split()))",
"-lst1 = list(map(int, input().split()))",
"-dp = [float(\"inf\") for _ in range(n)]",
"+import sys",
"+",
"+readline = sys.stdin.buffer.readline",
"+",
"+",
"+def even(n):",
"+ return 1 if n % 2 == 0 else 0",
"+",
"+",
"+n, k = list(map(int, rea... | false | 0.049842 | 0.049875 | 0.999347 | [
"s169543057",
"s959909047"
] |
u912237403 | p00124 | python | s564765404 | s152127496 | 20 | 10 | 4,228 | 4,228 | Accepted | Accepted | 50 | f=0
while 1:
n=eval(input())
if n==0: break
C=[()]*n
for i in range(n):
s=input()
p=s.index(" ")
a,b,c=list(map(int,s[p+1:].split(" ")))
C[i]=(i,a*3+c,s[:p])
C=sorted(C,key=lambda x:(-x[1]))
if f>0: print()
for e in C: print(e[2]+","+str(e[1]))
f=1 | f=0
while 1:
n=eval(input())
if n==0: break
C=[()]*n
for i in range(n):
s=input().split(" ")
C[i]=(i,int(s[1])*3+int(s[3]),s[0])
C=sorted(C,key=lambda x:(-x[1]))
if f>0: print()
for e in C: print(e[2]+","+str(e[1]))
f=1 | 14 | 12 | 282 | 249 | f = 0
while 1:
n = eval(input())
if n == 0:
break
C = [()] * n
for i in range(n):
s = input()
p = s.index(" ")
a, b, c = list(map(int, s[p + 1 :].split(" ")))
C[i] = (i, a * 3 + c, s[:p])
C = sorted(C, key=lambda x: (-x[1]))
if f > 0:
print()
f... | f = 0
while 1:
n = eval(input())
if n == 0:
break
C = [()] * n
for i in range(n):
s = input().split(" ")
C[i] = (i, int(s[1]) * 3 + int(s[3]), s[0])
C = sorted(C, key=lambda x: (-x[1]))
if f > 0:
print()
for e in C:
print(e[2] + "," + str(e[1]))
f ... | false | 14.285714 | [
"- s = input()",
"- p = s.index(\" \")",
"- a, b, c = list(map(int, s[p + 1 :].split(\" \")))",
"- C[i] = (i, a * 3 + c, s[:p])",
"+ s = input().split(\" \")",
"+ C[i] = (i, int(s[1]) * 3 + int(s[3]), s[0])"
] | false | 0.035586 | 0.036305 | 0.980192 | [
"s564765404",
"s152127496"
] |
u644972721 | p03013 | python | s777215684 | s877157377 | 198 | 153 | 6,900 | 12,528 | Accepted | Accepted | 22.73 | n, m = list(map(int, input().split()))
p = 1000000007
dp = [0] * n
c = 0
for _ in range(m):
a = int(eval(input()))
dp[a - 1] = -1
for i in range(1, n):
if i <= 1:
if dp[0] != -1 and dp[1] != -1:
dp[0], dp[1] = 1, 2
elif dp[0] == -1 and dp[1] != -1:
dp[0], ... | n, m = list(map(int, input().split()))
mod = pow(10, 9) + 7
dp = [0] * (n + 5)
for _ in range(m):
a = int(eval(input()))
dp[a] = -1
dp[0] = 1
for i in range(n):
if not dp[i] == -1:
dp[i] %= mod
else:
continue
if not dp[i + 1] == -1:
dp[i + 1] += dp[i]
if not... | 32 | 18 | 844 | 384 | n, m = list(map(int, input().split()))
p = 1000000007
dp = [0] * n
c = 0
for _ in range(m):
a = int(eval(input()))
dp[a - 1] = -1
for i in range(1, n):
if i <= 1:
if dp[0] != -1 and dp[1] != -1:
dp[0], dp[1] = 1, 2
elif dp[0] == -1 and dp[1] != -1:
dp[0], dp[1] = 0, 1... | n, m = list(map(int, input().split()))
mod = pow(10, 9) + 7
dp = [0] * (n + 5)
for _ in range(m):
a = int(eval(input()))
dp[a] = -1
dp[0] = 1
for i in range(n):
if not dp[i] == -1:
dp[i] %= mod
else:
continue
if not dp[i + 1] == -1:
dp[i + 1] += dp[i]
if not dp[i + 2] == ... | false | 43.75 | [
"-p = 1000000007",
"-dp = [0] * n",
"-c = 0",
"+mod = pow(10, 9) + 7",
"+dp = [0] * (n + 5)",
"- dp[a - 1] = -1",
"-for i in range(1, n):",
"- if i <= 1:",
"- if dp[0] != -1 and dp[1] != -1:",
"- dp[0], dp[1] = 1, 2",
"- elif dp[0] == -1 and dp[1] != -1:",
"- ... | false | 0.036552 | 0.037189 | 0.982862 | [
"s777215684",
"s877157377"
] |
u644907318 | p03032 | python | s992994771 | s788362708 | 250 | 101 | 44,140 | 74,644 | Accepted | Accepted | 59.6 | N,K = list(map(int,input().split()))
V = list(map(int,input().split()))
vmax = -10**9
for n1 in range(K+1):
A = V[:n1]
ind = min(n1,N)
m = N-ind
for n2 in range(min(K-n1,m)+1):
B = V[N-n2:]
C = A+B
C = sorted(C,reverse=True)
k = K-n1-n2
for i in range(... | N,K = list(map(int,input().split()))
V = list(map(int,input().split()))
vmax = 0
for i in range(K+1):
for j in range(K-i+1):
cnt = sum(V[:j])
A = V[:j]
n = N-(K-i-j)
if n>=j:
cnt += sum(V[n:])
A += V[n:]
else:
cnt += sum(V[j:])
... | 17 | 23 | 439 | 559 | N, K = list(map(int, input().split()))
V = list(map(int, input().split()))
vmax = -(10**9)
for n1 in range(K + 1):
A = V[:n1]
ind = min(n1, N)
m = N - ind
for n2 in range(min(K - n1, m) + 1):
B = V[N - n2 :]
C = A + B
C = sorted(C, reverse=True)
k = K - n1 - n2
fo... | N, K = list(map(int, input().split()))
V = list(map(int, input().split()))
vmax = 0
for i in range(K + 1):
for j in range(K - i + 1):
cnt = sum(V[:j])
A = V[:j]
n = N - (K - i - j)
if n >= j:
cnt += sum(V[n:])
A += V[n:]
else:
cnt += sum(V[... | false | 26.086957 | [
"-vmax = -(10**9)",
"-for n1 in range(K + 1):",
"- A = V[:n1]",
"- ind = min(n1, N)",
"- m = N - ind",
"- for n2 in range(min(K - n1, m) + 1):",
"- B = V[N - n2 :]",
"- C = A + B",
"- C = sorted(C, reverse=True)",
"- k = K - n1 - n2",
"- for i in ra... | false | 0.0382 | 0.03768 | 1.013805 | [
"s992994771",
"s788362708"
] |
u168489836 | p03457 | python | s530239855 | s005832845 | 528 | 335 | 89,356 | 3,060 | Accepted | Accepted | 36.55 | n = int(eval(input()))
time_space = [(int(x) for x in input().split()) for i in range(n)]
pos = [0,0]
for t, x, y in time_space:
if (x+y) > t or (x+y+t)%2:
print('No')
exit()
print('Yes') | n = int(eval(input()))
for i in range(n):
t, x, y = [int(x) for x in input().split()]
if (x+y) > t or (x+y+t)%2:
print('No')
exit()
print('Yes') | 8 | 7 | 208 | 168 | n = int(eval(input()))
time_space = [(int(x) for x in input().split()) for i in range(n)]
pos = [0, 0]
for t, x, y in time_space:
if (x + y) > t or (x + y + t) % 2:
print("No")
exit()
print("Yes")
| n = int(eval(input()))
for i in range(n):
t, x, y = [int(x) for x in input().split()]
if (x + y) > t or (x + y + t) % 2:
print("No")
exit()
print("Yes")
| false | 12.5 | [
"-time_space = [(int(x) for x in input().split()) for i in range(n)]",
"-pos = [0, 0]",
"-for t, x, y in time_space:",
"+for i in range(n):",
"+ t, x, y = [int(x) for x in input().split()]"
] | false | 0.075227 | 0.045663 | 1.647433 | [
"s530239855",
"s005832845"
] |
u846101221 | p02784 | python | s834083845 | s018902706 | 87 | 41 | 13,964 | 13,964 | Accepted | Accepted | 52.87 | h, n = list(map(int, input().split()))
a = list(map(int, input().split()))
a_sum = 0
for a_i in sorted(a, reverse=True):
a_sum += a_i
if a_sum >= h:
print('Yes')
break
else:
print('No') | h, n = list(map(int, input().split()))
a = list(map(int, input().split()))
if sum(a) >= h:
print('Yes')
else:
print('No') | 11 | 7 | 218 | 130 | h, n = list(map(int, input().split()))
a = list(map(int, input().split()))
a_sum = 0
for a_i in sorted(a, reverse=True):
a_sum += a_i
if a_sum >= h:
print("Yes")
break
else:
print("No")
| h, n = list(map(int, input().split()))
a = list(map(int, input().split()))
if sum(a) >= h:
print("Yes")
else:
print("No")
| false | 36.363636 | [
"-a_sum = 0",
"-for a_i in sorted(a, reverse=True):",
"- a_sum += a_i",
"- if a_sum >= h:",
"- print(\"Yes\")",
"- break",
"+if sum(a) >= h:",
"+ print(\"Yes\")"
] | false | 0.077056 | 0.035175 | 2.190659 | [
"s834083845",
"s018902706"
] |
u012484950 | p03545 | python | s753786069 | s811009445 | 30 | 26 | 9,156 | 9,132 | Accepted | Accepted | 13.33 | # -*- coding: utf-8 -*-
s = input()
nums = list(map(int, list(s)))
operators = ['+', '+', '+']
def exec(nums, operators):
num = 0
num += nums[0]
i = 1
for op in operators:
if op == '+':
num += nums[i]
elif op == '-':
num -= nums[i]
... | # -*- coding: utf-8 -*-
a,b,c,d = list(map(int, list(eval(input()))))
for i in range(2):
for j in range(2):
for k in range(2):
ops = ['-'] * 3
r = a
if i % 2 == 0:
r += b
ops[0] = '+'
else:
r -= b
... | 47 | 34 | 923 | 724 | # -*- coding: utf-8 -*-
s = input()
nums = list(map(int, list(s)))
operators = ["+", "+", "+"]
def exec(nums, operators):
num = 0
num += nums[0]
i = 1
for op in operators:
if op == "+":
num += nums[i]
elif op == "-":
num -= nums[i]
i += 1
return num
... | # -*- coding: utf-8 -*-
a, b, c, d = list(map(int, list(eval(input()))))
for i in range(2):
for j in range(2):
for k in range(2):
ops = ["-"] * 3
r = a
if i % 2 == 0:
r += b
ops[0] = "+"
else:
r -= b
... | false | 27.659574 | [
"-s = input()",
"-nums = list(map(int, list(s)))",
"-operators = [\"+\", \"+\", \"+\"]",
"-",
"-",
"-def exec(nums, operators):",
"- num = 0",
"- num += nums[0]",
"- i = 1",
"- for op in operators:",
"- if op == \"+\":",
"- num += nums[i]",
"- elif op == ... | false | 0.045913 | 0.090526 | 0.50718 | [
"s753786069",
"s811009445"
] |
u644907318 | p02803 | python | s681675154 | s872974233 | 1,439 | 299 | 167,004 | 79,568 | Accepted | Accepted | 79.22 | import heapq
INFTY = 10**3
H,W = list(map(int,input().split()))
S = [input().strip() for _ in range(H)]
dist = {(i,j):{(k,l):INFTY for k in range(H) for l in range(W)} for j in range(W) for i in range(H)}
for i in range(H):
for j in range(W):
if S[i][j]==".":
hist = {(k,l):0 for k in ran... | from collections import deque
INFTY = 10**3
H,W = list(map(int,input().split()))
S = [input().strip() for _ in range(H)]
cmax = 0
for x in range(H):
for y in range(W):
if S[x][y]==".":
A = [[INFTY for _ in range(W)] for _ in range(H)]
hist = {(i,j):0 for i in range(H) for j ... | 40 | 38 | 1,719 | 1,437 | import heapq
INFTY = 10**3
H, W = list(map(int, input().split()))
S = [input().strip() for _ in range(H)]
dist = {
(i, j): {(k, l): INFTY for k in range(H) for l in range(W)}
for j in range(W)
for i in range(H)
}
for i in range(H):
for j in range(W):
if S[i][j] == ".":
hist = {(k, l... | from collections import deque
INFTY = 10**3
H, W = list(map(int, input().split()))
S = [input().strip() for _ in range(H)]
cmax = 0
for x in range(H):
for y in range(W):
if S[x][y] == ".":
A = [[INFTY for _ in range(W)] for _ in range(H)]
hist = {(i, j): 0 for i in range(H) for j in... | false | 5 | [
"-import heapq",
"+from collections import deque",
"-dist = {",
"- (i, j): {(k, l): INFTY for k in range(H) for l in range(W)}",
"- for j in range(W)",
"- for i in range(H)",
"-}",
"-for i in range(H):",
"- for j in range(W):",
"- if S[i][j] == \".\":",
"- hist = {(... | false | 0.046761 | 0.044671 | 1.046783 | [
"s681675154",
"s872974233"
] |
u564902833 | p03126 | python | s503531212 | s861866751 | 29 | 19 | 3,828 | 3,060 | Accepted | Accepted | 34.48 | from functools import reduce
N, M = list(map(int, input().split()))
prod = set(range(1, M + 1))
for _ in range(N):
prod &= set(list(map(int, input().split()))[1:])
ans = len(prod)
print(ans) | # 入力
N, M = list(map(int, input().split()))
K, A = list(zip(*(
(int(t[0]), list(map(int, t[1].split())))
for t in (input().split(maxsplit=1) for _ in range(N))
)))
# 素直にカウント
ans = sum(
all(k in a for a in A)
for k in range(1, M + 1)
)
# 出力
print(ans)
| 7 | 15 | 194 | 271 | from functools import reduce
N, M = list(map(int, input().split()))
prod = set(range(1, M + 1))
for _ in range(N):
prod &= set(list(map(int, input().split()))[1:])
ans = len(prod)
print(ans)
| # 入力
N, M = list(map(int, input().split()))
K, A = list(
zip(
*(
(int(t[0]), list(map(int, t[1].split())))
for t in (input().split(maxsplit=1) for _ in range(N))
)
)
)
# 素直にカウント
ans = sum(all(k in a for a in A) for k in range(1, M + 1))
# 出力
print(ans)
| false | 53.333333 | [
"-from functools import reduce",
"-",
"+# 入力",
"-prod = set(range(1, M + 1))",
"-for _ in range(N):",
"- prod &= set(list(map(int, input().split()))[1:])",
"-ans = len(prod)",
"+K, A = list(",
"+ zip(",
"+ *(",
"+ (int(t[0]), list(map(int, t[1].split())))",
"+ ... | false | 0.03919 | 0.069349 | 0.565112 | [
"s503531212",
"s861866751"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.