problem_id stringlengths 6 6 | buggy_code stringlengths 8 526k | fixed_code stringlengths 12 526k | labels listlengths 0 15 ⌀ | buggy_submission_id int64 1 1.54M | fixed_submission_id int64 2 1.54M | user_id stringlengths 10 10 | language stringclasses 8
values |
|---|---|---|---|---|---|---|---|
p02664 | s=input().strip()
for i in s:
if(i=="?"):
print("P",end="")
else:
print(i,end="")
print()
| s=input().strip()
for i in s:
if(i=="?"):
print("D",end="")
else:
print(i,end="")
print()
| [
"literal.string.change",
"call.arguments.change",
"io.output.change"
] | 388,454 | 388,455 | u180645294 | python |
p02664 | s=input()
for i in s:
if(i=="?"):
print("P",end="")
else:
print(i,end="")
print()
| s=input().strip()
for i in s:
if(i=="?"):
print("D",end="")
else:
print(i,end="")
print()
| [
"literal.string.change",
"call.arguments.change",
"io.output.change"
] | 388,456 | 388,455 | u180645294 | python |
p02664 | print(input().reaplce('?','D'))
| print(input().replace('?','D')) | [
"identifier.change",
"call.arguments.change",
"io.output.change"
] | 388,457 | 388,458 | u060793972 | python |
p02664 | Vt = input()
print(t.replace("?", "D")) | t = input()
print(t.replace("?", "D")) | [
"assignment.variable.change",
"identifier.change"
] | 388,463 | 388,464 | u691896522 | python |
p02664 | n=input()
ans=""
for i in n:
if i=="?":
ans=ans+"D"
else:
ans=ans+i
print(i) | n=input()
ans=""
for i in n:
if i=="?":
ans=ans+"D"
else:
ans=ans+i
print(ans) | [
"identifier.change",
"call.arguments.change",
"io.output.change"
] | 388,503 | 388,504 | u901598613 | python |
p02664 | S = input()
ns = ""
for i in S:
if i == '?':
ns += 'D'
else:
ns += 'P'
print(ns) | S = input()
ns = ""
for i in S:
if i == '?':
ns += 'D'
else:
ns += i
print(ns) | [] | 388,519 | 388,520 | u514390882 | python |
p02664 | print(input().replace('?', 'P'))
| print(input().replace('?', 'D'))
| [
"literal.string.change",
"call.arguments.change",
"io.output.change"
] | 388,529 | 388,530 | u021019433 | python |
p02661 | import statistics
n = int(input())
la = []
lb = []
for i in range(n):
a, b = map(int, input().split())
la.append(a)
lb.append(b)
a = statistics.median(la)
b = statistics.median(lb)
if n % 2 == 1:
print(b - a + 1)
else:
print((b - a) * 2 - 1)
| import statistics
n = int(input())
la = []
lb = []
for i in range(n):
a, b = map(int, input().split())
la.append(a)
lb.append(b)
a = statistics.median(la)
b = statistics.median(lb)
if n % 2 == 1:
print(b - a + 1)
else:
print(int((b - a) * 2 + 1)) | [
"call.arguments.add",
"misc.opposites",
"expression.operator.arithmetic.change",
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change"
] | 388,549 | 388,548 | u955474478 | python |
p02661 | n = int(input())
la = []
lb = []
for i in range(n):
a, b = map(int, input().split())
la.append(a)
lb.append(b)
a = statistics.median(la)
b = statistics.median(lb)
if n % 2 == 1:
print(b - a + 1)
else:
print((b - a) * 2 - 1) | import statistics
n = int(input())
la = []
lb = []
for i in range(n):
a, b = map(int, input().split())
la.append(a)
lb.append(b)
a = statistics.median(la)
b = statistics.median(lb)
if n % 2 == 1:
print(b - a + 1)
else:
print(int((b - a) * 2 + 1)) | [
"call.add",
"misc.opposites",
"expression.operator.arithmetic.change",
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change"
] | 388,550 | 388,548 | u955474478 | python |
p02661 | from statistics import median
N = int(input())
A, B = [], []
for _ in range(N):
a, b = map(int, input().split())
A.append(a)
B.append(b)
mn = median(A)
mx = median(B)
if N % 2 == 1:
print(int(mx - mn + 1)) # mn, mn + 1, mn + 2, ..., mx
else:
print(int(mx - mn * 2 + 1)) # mn, mn + 0.5, m... | from statistics import median
N = int(input())
A, B = [], []
for _ in range(N):
a, b = map(int, input().split())
A.append(a)
B.append(b)
mn = median(A)
mx = median(B)
if N % 2 == 1:
print(int(mx - mn + 1)) # mn, mn + 1, mn + 2, ..., mx
else:
print(int((mx - mn) * 2 + 1)) # mn, mn + 0.5,... | [
"call.arguments.change"
] | 388,557 | 388,558 | u019685451 | python |
p02661 | from statistics import median
N = int(input())
A, B = [], []
for _ in range(N):
a, b = map(int, input().split())
A.append(a)
B.append(b)
mn = median(A)
mx = median(B)
if N % 2 == 1:
print(int(mx - mn) + 1) # mn, mn + 1, mn + 2, ..., mx
else:
print(int(mx - mn) * 2 + 1) # mn, mn + 0.5,... | from statistics import median
N = int(input())
A, B = [], []
for _ in range(N):
a, b = map(int, input().split())
A.append(a)
B.append(b)
mn = median(A)
mx = median(B)
if N % 2 == 1:
print(int(mx - mn + 1)) # mn, mn + 1, mn + 2, ..., mx
else:
print(int((mx - mn) * 2 + 1)) # mn, mn + 0.5,... | [
"call.arguments.change"
] | 388,559 | 388,558 | u019685451 | python |
p02661 | import sys
readline=sys.stdin.readline
N=int(readline())
A = [None] * N
B = [None] * N
for i in range(N):
A[i],B[i] = map(int,readline().split())
A = sorted(A)
B = sorted(B)
if N % 2 == 1:
# 奇数の場合
Amid = A[N // 2]
Bmid = B[N // 2]
print(Bmid - Amid + 1)
else:
# 偶数の場合
Amid = (A[N // 2] + A[(N // 2) - 1... | import sys
readline=sys.stdin.readline
N=int(readline())
A = [None] * N
B = [None] * N
for i in range(N):
A[i],B[i] = map(int,readline().split())
A = sorted(A)
B = sorted(B)
if N % 2 == 1:
# 奇数の場合
Amid = A[N // 2]
Bmid = B[N // 2]
print(Bmid - Amid + 1)
else:
# 偶数の場合
Amid = (A[N // 2] + A[(N // 2) - 1... | [
"expression.operation.binary.remove"
] | 388,560 | 388,561 | u936985471 | python |
p02661 | n = int(input())
A = []
B = []
for _ in range(n):
v1, v2 = list(map(int, input().split(' ')))
A.append(v1)
B.append(v2)
A.sort()
B.sort()
if n % 2:
print(B[n//2] - A[n//1] + 1)
else:
print((B[n//2]+B[n//2-1]) - (A[n//2]+A[n//2-1]) + 1) | n = int(input())
A = []
B = []
for _ in range(n):
v1, v2 = list(map(int, input().split(' ')))
A.append(v1)
B.append(v2)
A.sort()
B.sort()
if n % 2:
print(B[n//2] - A[n//2] + 1)
else:
print((B[n//2]+B[n//2-1]) - (A[n//2]+A[n//2-1]) + 1) | [
"literal.number.integer.change",
"variable_access.subscript.index.change",
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change"
] | 388,571 | 388,572 | u953251929 | python |
p02661 | import sys
input = lambda: sys.stdin.readline().rstrip()
def solve():
N = int(input())
A = [0] * N
B = [0] * N
for i in range(N):
A[i], B[i] = map(int, input().split())
As = sorted(A)
Bs = sorted(B)
if N % 2 == 0:
i1 = N // 2
i2 = N // 2 - 1
low = As[i1] +... | import sys
input = lambda: sys.stdin.readline().rstrip()
def solve():
N = int(input())
A = [0] * N
B = [0] * N
for i in range(N):
A[i], B[i] = map(int, input().split())
As = sorted(A)
Bs = sorted(B)
if N % 2 == 0:
i1 = N // 2
i2 = N // 2 - 1
low = As[i1] +... | [
"assignment.value.change",
"identifier.change",
"expression.operation.binary.change"
] | 388,576 | 388,577 | u163783894 | python |
p02661 | N = int(input())
ab = []
for i in range(N):
ab.append(tuple(map(int,input().split())))
up = sorted(ab,key=lambda a:a[1],reverse=True)
down = sorted(ab,key=lambda a:a[0],reverse=True)
if N%2 == 1:
print(up[N//2][1]-down[N//2][0]+1)
else:
up2 = sorted(ab,key=lambda a:a[1],reverse=True)
down2 = sorted(... | N = int(input())
ab = []
for i in range(N):
ab.append(tuple(map(int,input().split())))
up = sorted(ab,key=lambda a:a[1],reverse=True)
down = sorted(ab,key=lambda a:a[0],reverse=True)
if N%2 == 1:
print(up[N//2][1]-down[N//2][0]+1)
else:
up2 = sorted(ab,key=lambda a:a[1],reverse=False)
down2 = sorted... | [
"misc.opposites",
"assignment.value.change",
"call.arguments.change",
"call.arguments.keyword_argument.change"
] | 388,599 | 388,600 | u497952650 | python |
p02661 | n = int(input())
min_s = []
max_s = []
for i in range(n):
a, b = map(int, input().split())
min_s.append(a)
max_s.append(b)
min_s.sort()
max_s.sort()
if n % 2 == 0:
min_med = (min_s[n//2-1] + min_s[n//2])/2
max_med = (max_s[n//2-1] + max_s[n//2])/2
print(int(max_med-min_med)*2+1)
else:
min_... | n = int(input())
min_s = []
max_s = []
for i in range(n):
a, b = map(int, input().split())
min_s.append(a)
max_s.append(b)
min_s.sort()
max_s.sort()
if n % 2 == 0:
min_med = (min_s[n // 2 - 1] + min_s[n // 2]) / 2
max_med = (max_s[n // 2 - 1] + max_s[n // 2]) / 2
print(int((max_med - min_med) *... | [
"call.arguments.change"
] | 388,605 | 388,606 | u204208382 | python |
p02661 | n = int(input())
min_s = []
max_s = []
for i in range(n):
a, b = map(int, input().split())
min_s.append(a)
max_s.append(b)
min_s.sort()
max_s.sort()
if n % 2 == 0:
min_med = (min_s[n//2-1] + min_s[n//2-1])/2
max_med = (max_s[n//2-1] + max_s[n//2-1])/2
print(int(max_med-min_med)*2+1)
else:
... | n = int(input())
min_s = []
max_s = []
for i in range(n):
a, b = map(int, input().split())
min_s.append(a)
max_s.append(b)
min_s.sort()
max_s.sort()
if n % 2 == 0:
min_med = (min_s[n // 2 - 1] + min_s[n // 2]) / 2
max_med = (max_s[n // 2 - 1] + max_s[n // 2]) / 2
print(int((max_med - min_med) *... | [
"expression.operation.binary.remove",
"call.arguments.change"
] | 388,607 | 388,606 | u204208382 | python |
p02661 | n = int(input())
min_s = []
max_s = []
for i in range(n):
a, b = map(int, input().split())
min_s.append(a)
max_s.append(b)
min_s.sort()
max_s.sort()
if n % 2 == 0:
min_med = (min_s[n//2-1] + min_s[n//2-1])/2
max_med = (max_s[n//2-1] + max_s[n//2-1])/2
print(int((max_med-min_med)*2+1))
else:
... | n = int(input())
min_s = []
max_s = []
for i in range(n):
a, b = map(int, input().split())
min_s.append(a)
max_s.append(b)
min_s.sort()
max_s.sort()
if n % 2 == 0:
min_med = (min_s[n // 2 - 1] + min_s[n // 2]) / 2
max_med = (max_s[n // 2 - 1] + max_s[n // 2]) / 2
print(int((max_med - min_med) *... | [
"expression.operation.binary.remove"
] | 388,609 | 388,606 | u204208382 | python |
p02661 | N = int(input())
AB = []
for i in range(N):
AB.append(list(map(int, input().split())))
AB.sort()
if N % 2 == 0:
l1 = AB[N//2][0]
l2 = AB[N//2 - 1][0]
else:
l = AB[N//2][0]
AB.sort(key = lambda x: x[1])
if N % 2 == 0:
r1 = AB[N//2][1]
r2 = AB[N//2 - 1][1]
else:
r = AB[N//2][1]
if N % 2 == 0:
ans = ... | N = int(input())
AB = []
for i in range(N):
AB.append(list(map(int, input().split())))
AB.sort()
if N % 2 == 0:
l1 = AB[N//2][0]
l2 = AB[N//2 - 1][0]
else:
l = AB[N//2][0]
AB.sort(key = lambda x: x[1])
if N % 2 == 0:
r1 = AB[N//2][1]
r2 = AB[N//2 - 1][1]
else:
r = AB[N//2][1]
if N % 2 == 0:
ans = ... | [
"expression.operator.change"
] | 388,628 | 388,629 | u456353530 | python |
p02661 | from statistics import median
N=int(input())
A,B=[],[]
for i in range(N):
a,b=map(int,input().split())
A.append(a);B.append(b)
mA=median(A);mB=median(B)
if N%2:
ans=int(mB-mA)+1
else:
if mA//1==mA and mB//1==mB:
ans=int(mB-mA)*2-1
elif mA//1!=mA and mB//1==mB:
ans=(mB-(mA//1))*2
... | from statistics import median
N=int(input())
A,B=[],[]
for i in range(N):
a,b=map(int,input().split())
A.append(a);B.append(b)
mA=median(A);mB=median(B)
if N%2:
ans=int(mB-mA)+1
else:
if mA//1==mA and mB//1==mB:
ans=int(mB-mA)*2+1
elif mA//1!=mA and mB//1==mB:
ans=(mB-(mA//1))*2
... | [
"misc.opposites",
"expression.operator.arithmetic.change",
"assignment.value.change",
"expression.operation.binary.change"
] | 388,632 | 388,633 | u930705402 | python |
p02661 | # coding: utf-8
import sys
stdin = sys.stdin
ns = lambda: stdin.readline().rstrip() # ignore trailing spaces
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
def main():
n = ni()
bo = []
up = []
for _ in range(n):
a,b = na()
bo += [a]
up += [b]
... | # coding: utf-8
import sys
stdin = sys.stdin
ns = lambda: stdin.readline().rstrip() # ignore trailing spaces
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
def main():
n = ni()
bo = []
up = []
for _ in range(n):
a,b = na()
bo += [a]
up += [b]
... | [
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change"
] | 388,651 | 388,652 | u183284051 | python |
p02661 | # coding: utf-8
import sys
stdin = sys.stdin
ns = lambda: stdin.readline().rstrip() # ignore trailing spaces
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
def main():
n = ni()
bo = []
up = []
for _ in range(n):
a,b = na()
bo += [a]
up += [b]
... | # coding: utf-8
import sys
stdin = sys.stdin
ns = lambda: stdin.readline().rstrip() # ignore trailing spaces
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
def main():
n = ni()
bo = []
up = []
for _ in range(n):
a,b = na()
bo += [a]
up += [b]
... | [
"expression.operation.binary.remove"
] | 388,653 | 388,652 | u183284051 | python |
p02661 | from sys import stdin
input = stdin.readline
N = int(input())
ab = [list(map(int, input().split())) for _ in range(N)]
A = []
B = []
for a, b in ab:
A.append(a)
B.append(b)
A.sort()
B.sort
if N % 2 == 0:
a1 = A[N // 2 - 1]
b1 = B[N // 2 - 1]
a2 = A[N // 2]
b2 = B[N // 2]
xa = (a2 + a1) /... | from sys import stdin
input = stdin.readline
N = int(input())
ab = [list(map(int, input().split())) for _ in range(N)]
A = []
B = []
for a, b in ab:
A.append(a)
B.append(b)
A.sort()
B.sort()
if N % 2 == 0:
a1 = A[N // 2 - 1]
b1 = B[N // 2 - 1]
a2 = A[N // 2]
b2 = B[N // 2]
xa = (a2 + a1)... | [
"call.add"
] | 388,656 | 388,657 | u278057806 | python |
p02661 | arr = []
a,b = [],[]
for _ in range(int(input())):
x,y = list(map(int,input().split()))
a.append(x)
b.append(y)
a.sort()
b.sort()
n = len(a)
if n%2!=0:
x = n//2
print(b[x]-a[x]+1)
else:
x = n//2
y = x-1
a1 = (a[y]+a[y])/2
b1 = (b[x]+b[y])/2
ans = (b1-a1)/0.5
print(int(ans)) | arr = []
a,b = [],[]
for _ in range(int(input())):
x,y = list(map(int,input().split()))
a.append(x)
b.append(y)
a.sort()
b.sort()
n = len(a)
if n%2!=0:
x = n//2
print(b[x]-a[x]+1)
else:
x = n//2
y = x-1
a1 = (a[x]+a[y])/2
b1 = (b[x]+b[y])/2
ans = (b1-a1)/0.5
print(int(ans)+1)... | [
"assignment.value.change",
"identifier.change",
"variable_access.subscript.index.change",
"expression.operation.binary.change"
] | 388,671 | 388,672 | u437990671 | python |
p02661 | import numpy as np
N = int(input())
A = np.zeros(N)
B = np.zeros(N)
for i in range(N):
A[i], B[i] = map(int, input().split())
am = np.median(A)
bm = np.median(B)
if n % 2 == 0:
print(int((bm - am) * 2 + 1))
else:
print(int((bm - am) + 1)) | import numpy as np
N = int(input())
A = np.zeros(N)
B = np.zeros(N)
for i in range(N):
A[i], B[i] = map(int, input().split())
am = np.median(A)
bm = np.median(B)
if N % 2 == 0:
print(int((bm - am) * 2 + 1))
else:
print(int((bm - am) + 1)) | [
"identifier.change",
"control_flow.branch.if.condition.change"
] | 388,685 | 388,686 | u343021464 | python |
p02661 | import heapq as hp
n = int(input())
if n%2 ==0:
m = n//2 + 1
else:
m = (n+1) //2
a,b = [],[]
for i in range(0,n):
c = list(map(int, input().split()))
a.append(c[0])
b.append(c[1])
print(a,b)
la = hp.nlargest(m,a)
lb = hp.nlargest(m,b)
if n%2 == 0:
c = la[-1] + la[-2]
d = lb[-1] + lb[-2]
... | import heapq as hp
n = int(input())
if n%2 ==0:
m = n//2 + 1
else:
m = (n+1) //2
a,b = [],[]
for i in range(0,n):
c = list(map(int, input().split()))
a.append(c[0])
b.append(c[1])
la = hp.nlargest(m,a)
lb = hp.nlargest(m,b)
if n%2 == 0:
c = la[-1] + la[-2]
d = lb[-1] + lb[-2]
print(d-c... | [
"call.remove"
] | 388,699 | 388,700 | u589913372 | python |
p02661 | def main():
import sys
n = int(input())
A,B = [],[]
for i in range(n):
a,b= map(int, input().split())
A.append(a)
B.append(b)
A = sorted(A)
B = sorted(B)
if n%2 == 0:
ma = (A[n//2]+A[n//2-1])/2
mb = (B[n//2]+B[n//2-1])/2
ans = int(2*(mb-ma) - 1... | def main():
import sys
n = int(input())
A,B = [],[]
for i in range(n):
a,b= map(int, input().split())
A.append(a)
B.append(b)
A = sorted(A)
B = sorted(B)
if n%2 == 0:
ma = (A[n//2]+A[n//2-1])/2
mb = (B[n//2]+B[n//2-1])/2
ans = int(2*(mb-ma) + 1... | [
"misc.opposites",
"expression.operator.arithmetic.change",
"assignment.value.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 388,708 | 388,709 | u266014018 | python |
p02661 |
N=int(input())
A=[]
B=[]
for i in range(N):
a, b=map(int, input().split())
A.append(a)
B.append(b)
A.sort()
B.sort()
if N%2==0:
sca=scb=N//2-1
lca=lcb=N//2
x=A[lca]+A[sca]
y=B[lcb]+B[scb]
print(x-y+1)
else:
ca=cb=N//2
ans=B[cb]-A[ca]+1
print(ans)
| N=int(input())
A=[]
B=[]
for i in range(N):
a, b=map(int, input().split())
A.append(a)
B.append(b)
A.sort()
B.sort()
if N%2==0:
sca=scb=N//2-1
lca=lcb=N//2
x=A[lca]+A[sca]
y=B[lcb]+B[scb]
print(y-x+1)
else:
ca=cb=N//2
ans=B[cb]-A[ca]+1
print(ans)
| [
"expression.operation.binary.remove"
] | 388,714 | 388,715 | u193927973 | python |
p02661 |
N=int(input())
A=[]
B=[]
for i in range(N):
a, b=map(int, input().split())
A.append(a)
B.append(b)
A.sort()
B.sort()
if N%2==0:
sca=scb=N//2-1
lca=lcb=N//2
x=A[lca]+A[sca]
y=B[lcb]+B[lcb]
print(x-y+1)
else:
ca=cb=N//2
ans=B[cb]-A[ca]+1
print(ans)
| N=int(input())
A=[]
B=[]
for i in range(N):
a, b=map(int, input().split())
A.append(a)
B.append(b)
A.sort()
B.sort()
if N%2==0:
sca=scb=N//2-1
lca=lcb=N//2
x=A[lca]+A[sca]
y=B[lcb]+B[scb]
print(y-x+1)
else:
ca=cb=N//2
ans=B[cb]-A[ca]+1
print(ans)
| [
"assignment.value.change",
"identifier.change",
"variable_access.subscript.index.change",
"expression.operation.binary.change",
"expression.operation.binary.remove"
] | 388,716 | 388,715 | u193927973 | python |
p02661 | import numpy as np
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
n=INT()
A=[]
B=[]
for i in range(n):
a... | import numpy as np
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
n=INT()
A=[]
B=[]
for i in range(n):
a... | [
"assignment.add"
] | 388,724 | 388,725 | u779170803 | python |
p02661 | import numpy as np
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
n=INT()
A=[]
B=[]
for i in range(n):
a... | import numpy as np
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
n=INT()
A=[]
B=[]
for i in range(n):
a... | [
"assignment.add"
] | 388,726 | 388,725 | u779170803 | python |
p02661 | from copy import deepcopy
n = int(input())
X = []
As = []
Bs = []
for i in range(n):
A, B = list(map(int, input().split()))
As.append(A)
Bs.append(B)
As.sort()
Bs.sort()
if n % 2 == 1:
m = (n-1) // 2
print(Bs[m] - As[m] + 1)
else:
b_m = n // 2 - 1
a_m = b_m
min_mid = (As[b_m] + As[a_m... | from copy import deepcopy
n = int(input())
X = []
As = []
Bs = []
for i in range(n):
A, B = list(map(int, input().split()))
As.append(A)
Bs.append(B)
As.sort()
Bs.sort()
if n % 2 == 1:
m = (n-1) // 2
print(Bs[m] - As[m] + 1)
else:
b_m = n // 2 - 1
a_m = b_m + 1
min_mid = (As[b_m] + As[... | [
"assignment.change"
] | 388,727 | 388,728 | u047668580 | python |
p02661 | import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect... | import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect... | [
"expression.operation.binary.remove",
"assignment.value.change",
"identifier.change",
"expression.operation.binary.change"
] | 388,730 | 388,731 | u404290207 | python |
p02661 | import statistics
import math
from decimal import *
N = int(input())
n =[]
m =[]
for i in range(N):
a,b = list(map(int,input().split()))
n.append(a)
m.append(b)
nmean = Decimal(statistics.median(n))
mmean =Decimal(statistics.median(m))
if N%2 == 1:
print(mmean - nmean + 1)
else:
print(int(mmean ... | import statistics
import math
from decimal import *
N = int(input())
n =[]
m =[]
for i in range(N):
a,b = list(map(int,input().split()))
n.append(a)
m.append(b)
nmean = Decimal(statistics.median(n))
mmean =Decimal(statistics.median(m))
if N%2 == 1:
print(mmean - nmean + 1)
else:
print(int((mmean... | [
"call.arguments.change"
] | 388,732 | 388,733 | u032798323 | python |
p02661 | n = int(input())
s = []
zyogen = []
kagen = []
for i in range(n):
k, z = map(int, input().split())
kagen.append(k)
zyogen.append(z)
kk = sorted(kagen)
zz = sorted(zyogen)
if(n % 2 == 0):
aa = n // 2
x = kk[aa-1] + kk[a]
y = zz[aa-1] + zz[a]
print(y-x+1)
else:
aa = n // 2
x = kk[aa]
... | n = int(input())
s = []
zyogen = []
kagen = []
for i in range(n):
k, z = map(int, input().split())
kagen.append(k)
zyogen.append(z)
kk = sorted(kagen)
zz = sorted(zyogen)
if(n % 2 == 0):
aa = n // 2
x = kk[aa-1] + kk[aa]
y = zz[aa-1] + zz[aa]
print(y-x+1)
else:
aa = n // 2
x = kk[aa... | [
"assignment.value.change",
"identifier.change",
"variable_access.subscript.index.change",
"expression.operation.binary.change"
] | 388,737 | 388,738 | u583276018 | python |
p02665 | N = int(input())
n_l = [1]
n = 1
A = [int(a) for a in input().split()]
for i in range(1,N+1):
a = A[i-1]
n = (n - a) * 2
n_l.append(n)
if n <= 0:
Good = False
break
if n > A[N]:
counter = A[N]
m = A[N]
Good = True
else:
Good = False
if Good:
for i in range(N-1,-1,-1):... | N = int(input())
n_l = [1]
n = 1
A = [int(a) for a in input().split()]
for i in range(1,N+1):
a = A[i-1]
n = (n - a) * 2
n_l.append(n)
if n <= 0:
Good = False
break
if n >= A[N]:
counter = A[N]
m = A[N]
Good = True
else:
Good = False
if Good:
for i in range(N-1,-1,-1)... | [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 388,762 | 388,763 | u139216357 | python |
p02665 | n = int(input())+1
a = list(map(int, input().split()))
m_node = [1]*n
node = 0
total = 0
if n == 1:
if a[0] != 1:
print("-1", end="")
exit()
else:
print("1", end="")
exit()
for i in range(1, n):
m_node[i] = (m_node[i-1] - a[i-1])*2
if m_node[i] <= 0:
print("-1",... | n = int(input())+1
a = list(map(int, input().split()))
m_node = [1]*n
node = 0
total = 0
if n == 1:
if a[0] != 1:
print("-1", end="")
exit()
else:
print("1", end="")
exit()
for i in range(1, n):
m_node[i] = (m_node[i-1] - a[i-1])*2
if m_node[i] <= 0:
print("-1",... | [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 388,770 | 388,771 | u270343876 | python |
p02665 |
def read_int():
return int(input().strip())
def read_ints():
return list(map(int, input().strip().split(' ')))
def solve():
N = read_int();
A = read_ints();
B = [0]*(N+1)
B[N] = A[N]
for i in range(N-1, -1, -1):
B[i] = B[i+1]+A[i]
nodes, answer = 1, 0
for i in range(N+1... |
def read_int():
return int(input().strip())
def read_ints():
return list(map(int, input().strip().split(' ')))
def solve():
N = read_int();
A = read_ints();
B = [0]*(N+1)
B[N] = A[N]
for i in range(N-1, -1, -1):
B[i] = B[i+1]+A[i]
nodes, answer = 1, 0
for i in range(N+1... | [
"io.output.change",
"call.arguments.change",
"control_flow.return.remove"
] | 388,959 | 388,960 | u309716323 | python |
p02665 |
N = int(input())
X = list(map(int, input().split()))
cnt = [0] * (N + 1)
cnt[0] = 1
for i in range(N):
cnt[i + 1] = (cnt[i] - X[i]) * 2
ans = 0
cur = 0
for i in reversed(range(N + 1)):
cur += X[i]
ans += min(cnt[i], cur)
if all(cnt[i] >= X[i] for i in range(N)):
print(ans)
else:
print(-1)
|
N = int(input())
X = list(map(int, input().split()))
cnt = [0] * (N + 1)
cnt[0] = 1
for i in range(N):
cnt[i + 1] = (cnt[i] - X[i]) * 2
ans = 0
cur = 0
for i in reversed(range(N + 1)):
cur += X[i]
ans += min(cnt[i], cur)
if all(cnt[i] >= X[i] for i in range(N + 1)):
print(ans)
else:
print(-1)
| [
"control_flow.branch.if.condition.change"
] | 388,976 | 388,977 | u057109575 | python |
p02665 | N = int(input())
nums = list(map(int, input().split()))
nodes = []
currentLeaf = 1
fail = False
#check from top
for i in range(N + 1):
nodes.append(currentLeaf)
currentLeaf = (currentLeaf-nums[i])*2
if (currentLeaf < 0):
fail = True
break
if (fail):
print(-1)
#check from bottom
currentLeaf = 0
totalNode = 0
fo... | N = int(input())
nums = list(map(int, input().split()))
nodes = []
currentLeaf = 1
fail = False
#check from top
for i in range(N + 1):
nodes.append(currentLeaf)
currentLeaf = (currentLeaf-nums[i])*2
if (currentLeaf < 0):
fail = True
break
if (fail):
print(-1)
else:
#check from bottom
currentLeaf = 0
tota... | [] | 389,074 | 389,075 | u660899380 | python |
p02665 | n = int(input())
A = list(map(int, input().split()))
B = [1]
for i in range(n):
B.append((B[i]-A[i])*2)
C = [A[n]]
for i, s in enumerate(B):
if i == len(B)-1:
a = 1
elif B[i] <= 0:
print(-1)
exit()
if B[-1] < 0:
print(-1)
exit()
for i in range(n):
C.append(C[i]+A[n-1... | n = int(input())
A = list(map(int, input().split()))
B = [1]
for i in range(n):
B.append((B[i]-A[i])*2)
C = [A[n]]
for i, s in enumerate(B):
if i == len(B)-1:
a = 1
elif B[i] <= 0:
print(-1)
exit()
if B[-1]-A[n] < 0:
print(-1)
exit()
for i in range(n):
C.append(C[i]+A... | [
"control_flow.branch.if.condition.change"
] | 389,118 | 389,119 | u518085378 | python |
p02665 | n = int(input())
ns = list(map(int, input().split()))
li = 1
ans = 0
max_leafs = [1]
for i in ns:
li = (li - i) * 2
max_leafs.append(li)
points = ns.pop()
ans += points
for i in range(len(ns)-1, -1, -1):
a = ns[i]
points = min(points + a, max_leafs[i])
ans += points
if max_leafs[-1] <= 0:
print(... | n = int(input())
ns = list(map(int, input().split()))
li = 1
ans = 0
max_leafs = [1]
for i in ns:
li = (li - i) * 2
max_leafs.append(li)
points = ns.pop()
ans += points
for i in range(len(ns)-1, -1, -1):
a = ns[i]
points = min(points + a, max_leafs[i])
ans += points
if max_leafs[-1] < 0:
print(-... | [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 389,137 | 389,138 | u891217808 | python |
p02665 | n = int(input())
a = list(map(int, input().split()))
now = 1
allows = []
for i in range(n):
ha = a[i]
if ha > now:
print(-1)
exit()
allows.append(now - ha)
now = (now - ha) * 2
if now < a[n]:
print(-1)
exit
result = a[n]
now = a[n]
for i in range(n):
if now > allows[n-1-i]:
... | n = int(input())
a = list(map(int, input().split()))
now = 1
allows = []
for i in range(n):
ha = a[i]
if ha > now:
print(-1)
exit()
allows.append(now - ha)
now = (now - ha) * 2
if now < a[n]:
print(-1)
exit()
result = a[n]
now = a[n]
for i in range(n):
if now > allows[n-1-i]... | [
"call.add"
] | 389,221 | 389,222 | u594518120 | python |
p02665 | N = int(input())
A = [int(i) for i in input().split()]
total = sum(A)
node = 1
ans = 0
for i in range(N+1):
ans += node
total -= A[i]
#print(node, total)
node = min(total, (node - A[i]) * 2)
if node < 0:
print(-1)
print(ans) | N = int(input())
A = [int(i) for i in input().split()]
total = sum(A)
node = 1
ans = 0
for i in range(N+1):
ans += node
total -= A[i]
#print(node, total)
node = min(total, (node - A[i]) * 2)
if node < 0:
print(-1)
exit()
print(ans) | [
"call.add"
] | 389,357 | 389,358 | u909991537 | python |
p02665 | import math
#import numpy as np
import queue
from collections import deque,defaultdict
import heapq
from sys import stdin,setrecursionlimit
#from scipy.sparse.csgraph import dijkstra
#from scipy.sparse import csr_matrix
ipt = stdin.readline
setrecursionlimit(10**7)
def main():
n = int(ipt())
a = [int(i) for i ... | import math
#import numpy as np
import queue
from collections import deque,defaultdict
import heapq
from sys import stdin,setrecursionlimit
#from scipy.sparse.csgraph import dijkstra
#from scipy.sparse import csr_matrix
ipt = stdin.readline
setrecursionlimit(10**7)
def main():
n = int(ipt())
a = [int(i) for i ... | [] | 389,372 | 389,373 | u169350228 | python |
p02665 | N = int(input())
A = list(map(int, input().split()))
bottom = sum(A)
if A[0] >= 2:
print(-1)
else:
print(1)
exit()
ret = 1
children = 1 - A[0]
bottom -= A[0]
for i in range(N):
children = children * 2 - A[i+1]
if children <= -1:
ret = -1
break
bottom -= A[i+1]
if children >= bot... | N = int(input())
A = list(map(int, input().split()))
bottom = sum(A)
if A[0] >= 2:
print(-1)
exit()
ret = 1
children = 1 - A[0]
bottom -= A[0]
for i in range(N):
children = children * 2 - A[i+1]
if children <= -1:
ret = -1
break
bottom -= A[i+1]
if children >= bottom:
chil... | [
"call.remove"
] | 389,382 | 389,381 | u254088063 | python |
p02665 | N = int(input())
A = list(map(int, input().split()))
B = [0] *(N+1)
B[0] = 1
ans = 0
for i in range(1, N+1):
B[i] = (B[i-1] - A[i-1])*2
if B[i] <= 0:
ans = -1
break
if B[N] < A[N]:
ans = -1
if ans == 0:
check = 0
for j in range(N, 0, -1):
check += A[j]
if check < B[j]... | N = int(input())
A = list(map(int, input().split()))
B = [0] *(N+1)
B[0] = 1
ans = 0
for i in range(1, N+1):
B[i] = (B[i-1] - A[i-1])*2
if B[i] <= 0:
ans = -1
break
if B[N] < A[N]:
ans = -1
if ans == 0:
check = 0
for j in range(N, 0, -1):
check += A[j]
if check < B[j]... | [
"call.arguments.add"
] | 389,442 | 389,443 | u325149030 | python |
p02665 | N = int(input())
A = list(map(int,input().split()))
# その段で使用する枝の数
branches = dict()
for idx,a in enumerate(A):
if idx == 0:
branch = 1-a
else:
branch = branch * 2 - a
if branch <=0:
print(-1)
quit()
branches[idx] = branch
# 後ろから葉と枝の数(nodes)を計算していく
ans =0
for idx,leaf in enumerate(reversed(A))... | N = int(input())
A = list(map(int,input().split()))
# その段で使用する枝の数
branches = dict()
for idx,a in enumerate(A):
if idx == 0:
branch = 1-a
else:
branch = branch * 2 - a
if branch <0:
print(-1)
quit()
branches[idx] = branch
# 後ろから葉と枝の数(nodes)を計算していく
ans =0
for idx,leaf in enumerate(reversed(A)):... | [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 389,501 | 389,502 | u904804404 | python |
p02667 | import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")
t = input()
s = t.replace("0", "")
q = len(s) # 1の数
n = len(t)
ps = [None]*(q+1)
c = 0
j = 0
for tmp in t:
if tmp=="1":
ps[j] = c
j += 1
c = 0
els... | import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")
t = input()
s = t.replace("0", "")
q = len(s) # 1の数
n = len(t)
ps = [None]*(q+1)
c = 0
j = 0
for tmp in t:
if tmp=="1":
ps[j] = c
j += 1
c = 0
els... | [] | 389,558 | 389,559 | u535803878 | python |
p02667 | import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")
t = input()
s = t.replace("0", "")
q = len(s) # 1の数
n = len(t)
ps = [None]*(q+1)
c = 0
j = 0
for tmp in t:
if tmp=="1":
ps[j] = c
j += 1
c = 0
els... | import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")
t = input()
s = t.replace("0", "")
q = len(s) # 1の数
n = len(t)
ps = [None]*(q+1)
c = 0
j = 0
for tmp in t:
if tmp=="1":
ps[j] = c
j += 1
c = 0
els... | [
"literal.number.integer.change",
"assignment.value.change",
"call.arguments.add"
] | 389,560 | 389,559 | u535803878 | python |
p02667 | import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")
t = input()
s = t.replace("0", "")
q = len(s) # 1の数
n = len(t)
ps = [None]*(q+1)
c = 0
j = 0
for tmp in t:
if tmp=="1":
ps[j] = c
j += 1
c = 0
els... | import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")
t = input()
s = t.replace("0", "")
q = len(s) # 1の数
n = len(t)
ps = [None]*(q+1)
c = 0
j = 0
for tmp in t:
if tmp=="1":
ps[j] = c
j += 1
c = 0
els... | [
"literal.number.integer.change",
"assignment.value.change",
"call.arguments.add"
] | 389,561 | 389,559 | u535803878 | python |
p02667 | T=input()
n=len(T)
i=r=a=0
for c in T:
k=i-r
if c=='0':
r+=k&1
else:
a+=i//2-k//2+(k&1)*(n-i)
i+=1
print(a)
| T=input()
n=len(T)
i=r=a=0
for c in T:
k=i-r
if c=='0':
r+=~k&1
else:
a+=i//2-k//2+(~k&1)*(n-i)
i+=1
print(a)
| [
"expression.operation.unary.add"
] | 389,566 | 389,565 | u423585790 | python |
p02667 | T=input()
n=len(t)
i=r=a=0
for c in T:
k=i-r
if c=='0':
r+=k&1
else:
a+=i//2-k//2+(k&1)*(n-i)
i+=1
print(a) | T=input()
n=len(T)
i=r=a=0
for c in T:
k=i-r
if c=='0':
r+=~k&1
else:
a+=i//2-k//2+(~k&1)*(n-i)
i+=1
print(a)
| [
"assignment.value.change",
"identifier.change",
"call.arguments.change",
"expression.operation.unary.add"
] | 389,567 | 389,565 | u423585790 | python |
p02665 | n = int(input())
leaves = list(map(int, input().split()))
ans = 0
nodes_min = [0] * (n + 1)
nodes_max = [0] * (n + 1)
nodes_min[n] = leaves[n]
nodes_max[n] = leaves[n]
for depth in range(n, 0, -1):
root_min = nodes_min[depth] // 2 + nodes_min[depth] % 2
nodes_min[depth - 1] = leaves[depth - 1] + root_min
... | n = int(input())
leaves = list(map(int, input().split()))
ans = 0
nodes_min = [0] * (n + 1)
nodes_max = [0] * (n + 1)
nodes_min[n] = leaves[n]
nodes_max[n] = leaves[n]
for depth in range(n, 0, -1):
root_min = nodes_min[depth] // 2 + nodes_min[depth] % 2
nodes_min[depth - 1] = leaves[depth - 1] + root_min
... | [
"identifier.change",
"variable_access.subscript.index.change",
"control_flow.branch.if.condition.change"
] | 389,646 | 389,647 | u479719434 | python |
p02665 | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N, *A=map(int,read().split())
bound = [0]*(N+1)
bound[0] = 1
#Nが0のとき
if N == 0:
if A[0] == 1:
print(1)
else:
print(-1)
sys.exit()
#Nが0以外のとき
#上から
for i in range(1,N+1):
bound[i] = (b... | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N, *A=map(int,read().split())
bound = [0]*(N+1)
bound[0] = 1
#Nが0のとき
if N == 0:
if A[0] == 1:
print(1)
else:
print(-1)
sys.exit()
#Nが0以外のとき
#上から
for i in range(1,N+1):
bound[i] = (b... | [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 389,719 | 389,720 | u515740713 | python |
p02669 | t=int(input())
for loopi in range(t):
n,a,b,c,d=list(map(int,input().split()))
minest=10**40
dd={n:0}
while 1:
newd={}
for i in dd:
if i%2:
l=int((i-1)/2)
if l in newd:
newd[l]=min(dd[i]+min(a+d,(i-l)*d),newd[l])
else:
newd[l]=dd[i]+min(a+d,(i-l)*d)
... | t=int(input())
for loopi in range(t):
n,a,b,c,d=list(map(int,input().split()))
minest=10**40
dd={n:0}
while 1:
newd={}
for i in dd:
if i%2:
l=int((i-1)//2)
if l in newd:
newd[l]=min(dd[i]+min(a+d,(i-l)*d),newd[l])
else:
newd[l]=dd[i]+min(a+d,(i-l)*d)
... | [
"expression.operator.arithmetic.change",
"assignment.value.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 389,831 | 389,832 | u651663683 | python |
p02669 | T = int(input())
for i in range(T):
n, A, B, C, D = map(int, input().split())
memo = {}
def herasu(N):
if N == 0:
return 0
if N == 1:
return D
if N in memo:
return memo[N]
m = 100000000000000000000000
if N % 2 == 0:
... | T = int(input())
for i in range(T):
n, A, B, C, D = map(int, input().split())
memo = {}
def herasu(N):
if N == 0:
return 0
if N == 1:
return D
if N in memo:
return memo[N]
m = 100000000000000000000000
if N % 2 == 0:
m =... | [
"assignment.value.change",
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 389,894 | 389,895 | u137913818 | python |
p02669 | def f(k):
if k==1:return d
if k==0:return 0
if k in m:return m[k]
s=min(k*d,f(k//2)+a+k%2*d,f(--k//2)+a+-k%2*d,f(k//3)+b+k%3*d,f(--k//3)+b+-k%3*d,f(k//5)+c+k%5*d,f(--k//5)+c+-k%5*d)
m[k]=s
return s
for _ in range(int(input())):
m={}
n,a,b,c,d=map(int,input().split())
print(f(n)) | def f(k):
if k==1:return d
if k==0:return 0
if k in m:return m[k]
s=min(k*d,f(k//2)+a+k%2*d,f(-(-k//2))+a+-k%2*d,f(k//3)+b+k%3*d,f(-(-k//3))+b+-k%3*d,f(k//5)+c+k%5*d,f(-(-k//5))+c+-k%5*d)
m[k]=s
return s
for _ in range(int(input())):
m={}
n,a,b,c,d=map(int,input().split())
print(f(n)... | [
"call.arguments.change"
] | 389,908 | 389,909 | u225388820 | python |
p02669 | def f(k):
if k==1:return d
if k==0:return 0
if k in dic:return m[k]
s=k*d
s=min(s,f(k//2)+a+k%2*d,f((k+1)//2)+a+-k%2*d,f(k//3)+b+k%3*d,f((k+2)//3)+b+-k%3*d,f(k//5)+c+k%5*d,f((k+4)//5)+c+-k%5*d)
m[k]=s
return s
for _ in range(int(input())):
m={}
n,a,b,c,d=map(int,input().split())
... | def f(k):
if k==1:return d
if k==0:return 0
if k in m:return m[k]
s=k*d
s=min(s,f(k//2)+a+k%2*d,f((k+1)//2)+a+-k%2*d,f(k//3)+b+k%3*d,f((k+2)//3)+b+-k%3*d,f(k//5)+c+k%5*d,f((k+4)//5)+c+-k%5*d)
m[k]=s
return s
for _ in range(int(input())):
m={}
n,a,b,c,d=map(int,input().split())
pr... | [
"identifier.change",
"control_flow.branch.if.condition.change",
"call.function.change",
"call.arguments.change",
"io.output.change"
] | 389,910 | 389,911 | u225388820 | python |
p02669 | T = int(input())
for i in range(T):
N,A,B,C,D = map(int,input().split())
memo = {0:0,1:D}
def f(n):
if n in memo:
return memo[n]
else:
res = D*n
r2 = n%2
r3 = n%3
r5 = n%5
res = min(res,f(n//2)+A+r2*D,f(n//3)+B+r3*D,f(n/... | T = int(input())
for i in range(T):
N,A,B,C,D = map(int,input().split())
memo = {0:0,1:D}
def f(n):
if n in memo:
return memo[n]
else:
res = D*n
r2 = n%2
r3 = n%3
r5 = n%5
res = min(res,f(n//2)+A+r2*D,f(n//3)+B+r3*D,f(n/... | [
"call.arguments.change"
] | 389,963 | 389,964 | u170201762 | python |
p02669 | T=int(input())
for i in range(T):
N,a,b,c,d=map(int, input().split())
memo={}
memo[0]=0
memo[1]=d
def f(n):
if n in memo:
return memo[n]
e2,e3,e5=n%2,n%3,n%5
dd=min(d*n,d*2+a+f((n-e2)//2),d*2+a+f((n+e2)//2),d*e3+b+f((n-e3)//3),d*(3-e3)+b+f((n+3-e3)//3),d*e5+c+f((n-e5)//5),d*(5-e5)+c+f((n+... | T=int(input())
for i in range(T):
N,a,b,c,d=map(int, input().split())
memo={}
memo[0]=0
memo[1]=d
def f(n):
if n in memo:
return memo[n]
e2,e3,e5=n%2,n%3,n%5
dd=min(d*n,d*e2+a+f((n-e2)//2),d*e2+a+f((n+e2)//2),d*e3+b+f((n-e3)//3),d*(3-e3)+b+f((n+3-e3)//3),d*e5+c+f((n-e5)//5),d*(5-e5)+c+f((... | [
"assignment.value.change",
"identifier.replace.add",
"literal.replace.remove",
"call.arguments.change",
"expression.operation.binary.change",
"identifier.change",
"io.output.change"
] | 390,020 | 390,021 | u572142121 | python |
p02669 | from heapq import heappop,heappush
from collections import defaultdict
t = int(input())
for i in range(t):
n,a,b,c,d=map(int,input().split())
q=[(0,n)]
memo = defaultdict(int)
while q:
s,p = heappop(q)
if memo[p]:
continue
memo[p] = 1
if p == 0:
print(s)
return
heappush(q,(... | from heapq import heappop,heappush
from collections import defaultdict
t = int(input())
for i in range(t):
n,a,b,c,d=map(int,input().split())
q=[(0,n)]
memo = defaultdict(int)
while q:
s,p = heappop(q)
if memo[p]:
continue
memo[p] = 1
if p == 0:
print(s)
break
heappush(q,(s... | [
"control_flow.return.remove",
"control_flow.break.add"
] | 390,022 | 390,023 | u423585790 | python |
p02669 | t = int(input())
for _ in range(t):
n, a, b, c, d = map(int, input().split())
memo = {}
def f(n):
if n == 0:
return 0
if n == 1:
return d
if n in memo:
return memo[n]
m2 = n % 2
m3 = n % 3
m5 = n % 5
ret = min(
d * n,
d * m2 + a + f((n - m2) // 2),
... | t = int(input())
for _ in range(t):
n, a, b, c, d = map(int, input().split())
memo = {}
def f(n):
if n == 0:
return 0
if n == 1:
return d
if n in memo:
return memo[n]
m2 = n % 2
m3 = n % 3
m5 = n % 5
ret = min(
d * n,
d * m2 + a + f((n - m2) // 2),
... | [
"literal.number.integer.change",
"assignment.value.change",
"call.arguments.change",
"expression.operation.binary.change",
"identifier.change"
] | 390,027 | 390,028 | u802963389 | python |
p02669 | def solve(N, A, B, C, D):
d = {0:0, 1:D}
s = set()
return dfs(N, A, B, C, D, d, s)
def dfs(n, A, B, C, D, d, s):
if n in d:
return d[n]
if n in s:
return float('inf')
s.add(n)
ans = float('inf')
p = n % 2
if p == 0:
ans = min(ans, dfs(n // 2, A, B, ... | def solve(N, A, B, C, D):
d = {0:0, 1:D}
s = set()
return dfs(N, A, B, C, D, d, s)
def dfs(n, A, B, C, D, d, s):
if n in d:
return d[n]
if n in s:
return float('inf')
s.add(n)
ans = float('inf')
p = n % 2
if p == 0:
ans = min(ans, dfs(n // 2, A, B, ... | [
"call.arguments.change"
] | 390,037 | 390,038 | u189479417 | python |
p02669 |
#from collections import defaultdict
#from pprint import pprint
#from collections import deque
#from collections import Counter
#from copy import deepcopy
#from itertools
#import sys
#sys.setrecursionlimit(N) #N回まで再起を許可する。
#import numpy as np
#import math
# = map(int,input().split())
# = list(map(int,input().split()... | #https://wakabame.hatenablog.com/entry/2020/05/24/031143
#from collections import defaultdict
#from pprint import pprint
#from collections import deque
#from collections import Counter
#from copy import deepcopy
#from itertools
#import sys
#sys.setrecursionlimit(N) #N回まで再起を許可する。
#import numpy as np
#import math
# = m... | [
"expression.operator.arithmetic.change",
"assignment.value.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 390,053 | 390,054 | u240096083 | python |
p02669 |
#from collections import defaultdict
#from pprint import pprint
#from collections import deque
#from collections import Counter
#from copy import deepcopy
#from itertools
#import sys
#sys.setrecursionlimit(N) #N回まで再起を許可する。
#import numpy as np
#import math
# = map(int,input().split())
# = list(map(int,input().split()... |
#from collections import defaultdict
#from pprint import pprint
#from collections import deque
#from collections import Counter
#from copy import deepcopy
#from itertools
#import sys
#sys.setrecursionlimit(N) #N回まで再起を許可する。
#import numpy as np
#import math
# = map(int,input().split())
# = list(map(int,input().split()... | [
"expression.operator.arithmetic.change",
"assignment.value.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 390,053 | 390,056 | u240096083 | python |
p02669 | from functools import lru_cache
T = int(input())
caseList = []
for i in range(T):
caseList.append(list(map(int, input().split())))
@lru_cache(maxsize=None)
def solve(n, A, B, C, D):
if n == 0:
return 0
if n == 1:
return D
if n == 2:
return min(D + D, A + D)
ans = n * D
... | from functools import lru_cache
T = int(input())
caseList = []
for i in range(T):
caseList.append(list(map(int, input().split())))
@lru_cache(maxsize=None)
def solve(n, A, B, C, D):
if n == 0:
return 0
if n == 1:
return D
if n == 2:
return min(D + D, A + D)
ans = n * D
... | [
"assignment.value.change",
"identifier.change",
"call.function.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 390,057 | 390,058 | u153729035 | python |
p02670 | import sys
input = sys.stdin.readline
from collections import deque
n = int(input())
a = list(map(int,input().split()))
n += 2
ls = [0 for i in range(n*n)]
for i in range(n):
for j in range(n):
ls[i*n+j] = min(i,j,n-1-i,n-1-j)-1
ans = 0
st = [0]*(n*n)
for i in a:
x,y = divmod(i-1,n-2)
i = (x+1)*n+(y+1)
ans ... | import sys
input = sys.stdin.readline
from collections import deque
n = int(input())
a = list(map(int,input().split()))
n += 2
ls = [0 for i in range(n*n)]
for i in range(n):
for j in range(n):
ls[i*n+j] = min(i,j,n-1-i,n-1-j)-1
ans = 0
st = [0]*(n*n)
for i in a:
x,y = divmod(i-1,n-2)
i = (x+1)*n+(y+1)
ans ... | [
"identifier.change",
"control_flow.branch.if.condition.change"
] | 390,293 | 390,294 | u905582793 | python |
p02670 | N, *P = map(int, open(0).read().split())
dp = [0] + [min(i, j, N + 1 - i, N + 1 - j) for i in range(N) for j in range(N)]
memo = [1] * (N * N + 1)
def move(fr, to):
if dp[to] > dp[fr] + memo[fr]:
dp[to] = dp[fr] + memo[fr]
S.append(to)
ans = 0
for p in P:
ans += dp[p]
memo[p] = 0
S =... | N, *P = map(int, open(0).read().split())
dp = [0] + [min(i, j, N - 1 - i, N - 1 - j) for i in range(N) for j in range(N)]
memo = [1] * (N * N + 1)
def move(fr, to):
if dp[to] > dp[fr] + memo[fr]:
dp[to] = dp[fr] + memo[fr]
S.append(to)
ans = 0
for p in P:
ans += dp[p]
memo[p] = 0
S =... | [
"misc.opposites",
"expression.operator.arithmetic.change",
"assignment.value.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 390,306 | 390,307 | u606045429 | python |
p02666 | from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor, co... | from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor, co... | [] | 390,335 | 390,336 | u499381410 | python |
p02666 | from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor, co... | from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor, co... | [
"identifier.change",
"function.return_value.change",
"expression.operation.binary.change"
] | 390,337 | 390,336 | u499381410 | python |
p02675 | d = {n: 'hon' for n in "24579"}
d.update({n: 'pon' for n in "0168"})
d.update({3: 'bon'})
print(d[input()[-1]])
| d = {n: 'hon' for n in "24579"}
d.update({n: 'pon' for n in "0168"})
d.update({"3": 'bon'})
print(d[input()[-1]]) | [
"call.arguments.change"
] | 390,425 | 390,426 | u982594421 | python |
p02675 | N = int(input())
if N == 2 or N == 4 or N == 5 or\
N == 7 or N == 9:
print('hon')
elif N == 0 or N == 1 or N == 6 or\
N == 8:
print('pon')
else:
print('bon') | N = int(input())
N = N%10
if N == 2 or N == 4 or N == 5 or\
N == 7 or N == 9:
print('hon')
elif N == 0 or N == 1 or N == 6 or\
N == 8:
print('pon')
else:
print('bon') | [
"assignment.add"
] | 390,437 | 390,438 | u486209657 | python |
p02675 | x = input()
N = int(x)
if N % 10 == 2 or N % 10 == 4 or N % 10 == 5 or N % 10 == 7 or N % 10 == 9:
print('hon')
if N % 10 == 3:
print('bon')
else:
print('pon') | x = input()
N = int(x)
if N % 10 == 2 or N % 10 == 4 or N % 10 == 5 or N % 10 == 7 or N % 10 == 9:
print('hon')
elif N % 10 == 3:
print('bon')
else:
print('pon') | [
"control_flow.branch.if.replace.remove",
"control_flow.branch.else_if.replace.add"
] | 390,439 | 390,440 | u861274887 | python |
p02675 | N = int(input())
ans = N % 10
if ans == 2 or ans == 4 or ans == 5 or ans == 6 or ans == 7:
print("hon")
elif ans == 0 or ans == 1 or ans == 6 or ans == 8:
print("pon")
else:
print("bon") | N = int(input())
ans = N % 10
if ans == 2 or ans == 4 or ans == 5 or ans == 7or ans == 9:
print("hon")
elif ans == 0 or ans == 1 or ans == 6 or ans == 8:
print("pon")
else:
print("bon") | [
"literal.number.integer.change",
"control_flow.branch.if.condition.change"
] | 390,446 | 390,447 | u034777138 | python |
p02675 | import sys
input = sys.stdin.readline
ins = lambda: input().rstrip()
ini = lambda: int(input().rstrip())
inm = lambda: map(int, input().rstrip().split())
inl = lambda: list(map(int, input().split()))
out = lambda x, s='\n': print(s.join(map(str, x)))
n = ini()
if n%10 == 3:
print("bon")
elif n%10 in [0, 1, 6, 8]:
... | import sys
input = sys.stdin.readline
ins = lambda: input().rstrip()
ini = lambda: int(input().rstrip())
inm = lambda: map(int, input().rstrip().split())
inl = lambda: list(map(int, input().split()))
out = lambda x, s='\n': print(s.join(map(str, x)))
n = ini()
if n%10 == 3:
print("bon")
elif n%10 in [0, 1, 6, 8]:
... | [
"literal.string.change",
"literal.string.case.change",
"call.arguments.change",
"io.output.change"
] | 390,453 | 390,454 | u712429027 | python |
p02675 | N = int(input())
if N in [2,4,5,7,9]:
print('hon')
elif N in [0,1,6,8]:
print('pon')
else:
print('bon')
| N = int(input()[-1])
if N in [2,4,5,7,9]:
print('hon')
elif N in [0,1,6,8]:
print('pon')
else:
print('bon')
| [] | 390,459 | 390,460 | u707614029 | python |
p02675 | n = input()
word = n[-1]
if word == "3":
print(n + "bon")
elif word == "0" or word == "1" or word == "6" or word == "8":
print(n + "pon")
else:
print(n + "hon") | n = input()
word = n[-1]
if word == "3":
print("bon")
elif word == "0" or word == "1" or word == "6" or word == "8":
print("pon")
else:
print("hon") | [
"expression.operation.binary.remove"
] | 390,472 | 390,473 | u656803083 | python |
p02675 | N=(input())
x = N[-1]
A =[2,4,5,7,9]
if x in A:
print('hon')
elif x == '3':
print('bon')
else:
print('pon') | N=(input())
x = int(N[-1])
A =[2,4,5,7,9]
if x in A:
print('hon')
elif x == 3:
print('bon')
else:
print('pon') | [
"call.add",
"call.arguments.change",
"control_flow.branch.if.condition.change"
] | 390,480 | 390,481 | u244434589 | python |
p02675 | N= int(input())
n = N % 10
print(n)
if n == 2 or n==4 or n ==5 or n == 7 or n == 9:
print('hon')
elif n == 0 or n ==1 or n == 6 or n == 8:
print('pon')
elif n == 3:
print('bon')
| N= int(input())
n = N % 10
if n == 2 or n==4 or n ==5 or n == 7 or n == 9:
print('hon')
elif n == 0 or n ==1 or n == 6 or n == 8:
print('pon')
elif n == 3:
print('bon') | [
"call.remove"
] | 390,487 | 390,488 | u021086907 | python |
p02675 | n = input()
c = n[-1]
if c in ["24579"]:
print("hon")
elif c in ["0168"]:
print("pon")
else:
print("bon") | n = input()
c = n[-1]
if c in "24579":
print("hon")
elif c in "0168":
print("pon")
else:
print("bon") | [
"control_flow.branch.if.condition.change"
] | 390,493 | 390,494 | u987846648 | python |
p02675 | N = input ()
P = '1689'
H = '2457'
if N[-1] in P:
print ('pon')
elif N[-1] in H:
print ('hon')
else:
print ('bon') | N = input ()
P = '0168'
H = '24579'
if N[-1] in P:
print ('pon')
elif N[-1] in H:
print ('hon')
else:
print ('bon') | [
"literal.string.change",
"assignment.value.change"
] | 390,503 | 390,504 | u316603606 | python |
p02675 | n = int(input())
a = n % 10
if a == 3:
print('bon')
elif a == 0 | a == 1 | a == 6 | a == 8:
print('pon')
else:
print('hon') | n = int(input())
a = n % 10
if a == 3:
print('bon')
elif a == 0 or a == 1 or a == 6 or a == 8:
print('pon')
else:
print('hon') | [
"control_flow.branch.if.condition.change"
] | 390,511 | 390,512 | u518929058 | python |
p02675 | mylist1 = [2,4,5,7,9]
mylist2 = [0,1,6,8]
N = int(input())
X = N % 10
if X in mylsit1:
print('hon')
elif X in mylist2:
print('pon')
else:
print('bon') | mylist1 = [2,4,5,7,9]
mylist2 = [0,1,6,8]
N = int(input())
X = N % 10
if X in mylist1:
print('hon')
elif X in mylist2:
print('pon')
else:
print('bon') | [
"identifier.change",
"control_flow.branch.if.condition.change"
] | 390,519 | 390,520 | u266262808 | python |
p02675 | n = int(input())
n = n[-1]
if n in [2, 4, 5, 7, 9]:
ans = 'hon'
elif n in [0, 1, 6, 8]:
ans = 'pon'
else:
ans = 'bon'
print(ans) | n = input()
n = int(n[-1])
if n in [2, 4, 5, 7, 9]:
ans = 'hon'
elif n in [0, 1, 6, 8]:
ans = 'pon'
else:
ans = 'bon'
print(ans)
| [
"call.arguments.change"
] | 390,534 | 390,535 | u236996569 | python |
p02675 | N = int(input())
e = int(N[-1])
if e in (2,4,5,7,9):
print('hon')
elif e in (0,1,6,8):
print('pon')
else:
print('bon') | N = input()
e = int(N[-1])
if e in (2,4,5,7,9):
print('hon')
elif e in (0,1,6,8):
print('pon')
else:
print('bon') | [
"call.remove",
"call.arguments.change"
] | 390,536 | 390,537 | u511824539 | python |
p02675 | N = int(input())
r = N % 10
char = ["pon", "pon", "hon", "bon", "hon", "hon", "pon", "hon", "Pon", "hon"]
print(char[r]) | N = int(input())
r = N % 10
char = ["pon", "pon", "hon", "bon", "hon", "hon", "pon", "hon", "pon", "hon"]
print(char[r]) | [
"literal.string.change",
"literal.string.case.change",
"assignment.value.change"
] | 390,540 | 390,541 | u939132000 | python |
p02675 | print(('pphbhhphph'[int(input())])+'on') | print(('pphbhhphph'[int(input()[-1])])+'on')
| [] | 390,553 | 390,554 | u873915460 | python |
p02675 | N = int(input())
hon=[2,4,5,7,9]
bon=[3]
if N in hon:
print("hon")
elif N in bon:
print("bon")
else:
print("pon")
| N = int(input()) %10
hon=[2,4,5,7,9]
bon=[3]
if N in hon:
print("hon")
elif N in bon:
print("bon")
else:
print("pon")
| [
"assignment.change"
] | 390,582 | 390,583 | u556594202 | python |
p02675 | n = int(input())
a = n-(n//100)*100
b = a-(a//10)*10
print(b)
if b == 2 or b == 4 or b == 5 or b == 7 or b == 9:
print("hon")
if b == 0 or b == 1 or b == 6 or b == 8:
print("pon")
if b == 3:
print("bon")
| n = int(input())
a = n-(n//100)*100
b = a-(a//10)*10
if b == 2 or b == 4 or b == 5 or b == 7 or b == 9:
print("hon")
if b == 0 or b == 1 or b == 6 or b == 8:
print("pon")
if b == 3:
print("bon")
| [
"call.remove"
] | 390,594 | 390,595 | u719790500 | python |
p02675 | number = input()
if number[0] == '3':
print('bon')
elif number[0] in ['0', '6', '1', '8']:
print('pon')
else:
print('hon')
| number = input()
if number[-1] == '3':
print('bon')
elif number[-1] in ['0', '6', '1', '8']:
print('pon')
else:
print('hon') | [
"variable_access.subscript.index.change",
"control_flow.branch.if.condition.change",
"expression.operation.unary.add"
] | 390,596 | 390,597 | u543085532 | python |
p02675 | N = input()
if N[0] in "24579":
print("hon")
elif N[0] == "3":
print("bon")
else:
print("pon") | N = input()
if N[-1] in "24579":
print("hon")
elif N[-1] == "3":
print("bon")
else:
print("pon") | [
"variable_access.subscript.index.change",
"control_flow.branch.if.condition.change",
"expression.operation.unary.add"
] | 390,598 | 390,599 | u599547273 | python |
p02675 | print('pphbhhphph'.index(int(input())%10)+'on') | print('pphbhhphph'[int(input())%10]+'on') | [
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change",
"call.remove"
] | 390,602 | 390,603 | u761320129 | python |
p02675 | """AtCoder."""
n = int(input())
s = None
if n in (2, 4, 5, 7, 9):
s = 'hon'
elif n in (0, 1, 6, 8):
s = 'pon'
elif n in (3,):
s = 'bon'
print(s)
| """AtCoder."""
n = int(input()[-1])
s = None
if n in (2, 4, 5, 7, 9):
s = 'hon'
elif n in (0, 1, 6, 8):
s = 'pon'
elif n in (3,):
s = 'bon'
print(s)
| [] | 390,606 | 390,607 | u820685137 | python |
p02675 | a=int(input())
b=a[-1]
if b==3:
print("bon")
elif b==2 or b==4 or b==5 or b==7 or b==9:
print("hon")
else:
print("pon") | a=int(input())
b = a % 10
if b==3:
print("bon")
elif b==2 or b==4 or b==5 or b==7 or b==9:
print("hon")
else:
print("pon")
| [] | 390,608 | 390,609 | u913294360 | python |
p02675 | # 1
# 2
# 3
n=input()
a=n[0]
if a in list('24579'):
ans='hon'
elif a in list('0168'):
ans='pon'
else:
ans='bon'
print(ans) | # 1
# 2
# 3
n=input()
a=n[-1]
if a in list('24579'):
ans='hon'
elif a in list('0168'):
ans='pon'
else:
ans='bon'
print(ans) | [
"assignment.value.change",
"variable_access.subscript.index.change",
"expression.operation.unary.add"
] | 390,614 | 390,615 | u202570162 | python |
p02675 | n=int(input())
a=n[0]
if a in list('24579'):
ans='hon'
elif a in list('0168'):
ans='pon'
else:
ans='bon'
print(ans) | # 1
# 2
# 3
n=input()
a=n[-1]
if a in list('24579'):
ans='hon'
elif a in list('0168'):
ans='pon'
else:
ans='bon'
print(ans) | [
"call.remove",
"call.arguments.change",
"assignment.value.change",
"variable_access.subscript.index.change",
"expression.operation.unary.add"
] | 390,616 | 390,615 | u202570162 | python |
p02675 | N=input()
if N[-1]=="3":
print("bon")
elif N[-1] in ["1","6","8"]:
print("pon")
else:
print("hon") | N=input()
if N[-1]=="3":
print("bon")
elif N[-1] in ["0","1","6","8"]:
print("pon")
else:
print("hon") | [
"control_flow.branch.if.condition.change"
] | 390,621 | 390,620 | u869154953 | python |
p02675 | N=input()
if N[-1]=="3":
print("bon")
elif N[-1] in ["1","6","8"]:
print("pon")
else:
print("hon") | N=input()
if N[-1]=="3":
print("bon")
elif N[-1] in ["0","1","6","8"]:
print("pon")
else:
print("hon") | [
"control_flow.branch.if.condition.change"
] | 390,622 | 390,620 | u869154953 | python |
p02675 | N=int(input())
x=N%10
if X==3:
print('bon')
elif x==0 or x==1 or x==6 or x==8:
print('pon')
else:
print('hon') | N=int(input())
x=N%10
if x==3:
print('bon')
elif x==0 or x==1 or x==6 or x==8:
print('pon')
else:
print('hon')
| [
"identifier.change",
"control_flow.branch.if.condition.change"
] | 390,627 | 390,628 | u350093546 | python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.