Datasets:

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
p02853
X=list(map(int, input())) t=0 for i in range(len(X)): if X[i]==1: t+=300000 elif X[i]==2: t+=200000 elif X[i]==3: t+=100000 if X[0]==X[1] and X[0]==1: t+=400000 print(t)
X=list(map(int, input().split())) t=0 for i in range(len(X)): if X[i]==1: t+=300000 elif X[i]==2: t+=200000 elif X[i]==3: t+=100000 if X[0]==X[1] and X[0]==1: t+=400000 print(t)
[ "call.add" ]
657,686
657,687
u363836311
python
p02853
x,y=map(int,input().split()) ans=0 if x<=3: ans+=(4-x)*100000 if y<=3: ans+=(4-x)*100000 if ans==600000: ans=1000000 print(ans)
x,y=map(int,input().split()) ans=0 if x<=3: ans+=(4-x)*100000 if y<=3: ans+=(4-y)*100000 if ans==600000: ans=1000000 print(ans)
[ "identifier.change", "expression.operation.binary.change" ]
657,698
657,699
u217627525
python
p02853
X, Y = map(int, input().split()) ans = 0 if X <= 3: ans += (4 - X) * 10 ** 5 if Y <= 3: ans += (4 - X) * 10 ** 5 if X == Y == 1: ans += 4 * 10 ** 5 print(ans)
X, Y = map(int, input().split()) ans = 0 if X <= 3: ans += (4 - X) * 10 ** 5 if Y <= 3: ans += (4 - Y) * 10 ** 5 if X == Y == 1: ans += 4 * 10 ** 5 print(ans)
[ "identifier.change", "expression.operation.binary.change" ]
657,700
657,701
u278057806
python
p02853
x,y = map(int,input().split()) s=[0,] d={ 1:30000, 2:20000, 3:10000, } if x in d: s.append(d[x]) if y in d: s.append(d[y]) if x==1 and y==1: s.append(40000) print(sum(s))
x,y = map(int,input().split()) s=[0,] d={ 1:300000, 2:200000, 3:100000, } if x in d: s.append(d[x]) if y in d: s.append(d[y]) if x==1 and y==1: s.append(400000) print(sum(s))
[ "literal.number.integer.change", "assignment.value.change", "call.arguments.change" ]
657,708
657,709
u075155299
python
p02853
X, Y = map(int, input().split()) P = [300000, 200000, 100000, 0] if X == 1 and Y == 1: print(100000) else: print(P[min(3, X - 1)] + P[min(3, Y - 1)])
X, Y = map(int, input().split()) P = [300000, 200000, 100000, 0] if X == 1 and Y == 1: print(1000000) else: print(P[min(3, X - 1)] + P[min(3, Y - 1)])
[ "literal.number.integer.change", "call.arguments.change", "io.output.change" ]
657,713
657,714
u663710122
python
p02853
x,y = map(int,input().split()) def point(a): if a == 1: return 300000 elif a == 2: return 200000 elif a == 3: return 100000 else: return 0 a = point(x) b = point(y) if a == 1 and b == 1: print(1000000) else: print(a+b)
x,y = map(int,input().split()) def point(a): if a == 1: return 300000 elif a == 2: return 200000 elif a == 3: return 100000 else: return 0 c = point(x) b = point(y) if x == 1 and y == 1: print(1000000) else: print(c+b)
[ "assignment.variable.change", "identifier.change", "control_flow.branch.if.condition.change", "call.arguments.change", "expression.operation.binary.change", "io.output.change" ]
657,725
657,726
u368796742
python
p02853
x, y = map(int(input().split())) ans = 0 if x == 1: ans += 300000 elif x == 2: ans += 200000 elif x == 3: ans += 100000 if y == 1: ans += 300000 elif y == 2: ans += 200000 elif y == 3: ans += 100000 if x == 1 and y == 1: ans += 400000 print(ans)
x, y = map(int,input().split()) ans = 0 if x == 1: ans += 300000 elif x == 2: ans += 200000 elif x == 3: ans += 100000 if y == 1: ans += 300000 elif y == 2: ans += 200000 elif y == 3: ans += 100000 if x == 1 and y == 1: ans += 400000 print(ans)
[ "assignment.value.change", "call.arguments.change" ]
657,727
657,728
u426108351
python
p02853
codePlace, implePlace = map(int, input().split(" ")) priceDict = { "1":300000, "2":200000, "3":100000 } totalPrice = priceDict[codePlace] if codePlace in priceDict.keys() else 0 totalPrice += priceDict[implePlace] if implePlace in priceDict.keys() else 0 totalPrice += 400000 if codePlace == 1 and implePlace == 1 else 0 print(totalPrice)
codePlace, implePlace = map(int, input().split(" ")) priceDict = { 1:300000, 2:200000, 3:100000 } totalPrice = priceDict[codePlace] if codePlace in priceDict.keys() else 0 totalPrice += priceDict[implePlace] if implePlace in priceDict.keys() else 0 totalPrice += 400000 if codePlace == 1 and implePlace == 1 else 0 print(totalPrice)
[]
657,747
657,748
u851279551
python
p02853
n,m = map(int,input().split()) lis = [0]*205 lis[0] == 300000 lis[1] == 200000 lis[2] == 100000 if n == m and n == 1: print(1000000) else: print(lis[n-1]+lis[m-1])
n,m = map(int,input().split()) lis = [0]*205 lis[0] = 300000 lis[1] = 200000 lis[2] = 100000 if n == m and n == 1: print(1000000) else: print(lis[n-1]+lis[m-1])
[ "expression.operation.compare.replace.remove", "assignment.replace.add", "misc.typo" ]
657,751
657,752
u728615412
python
p02853
n,m = map(int,input().split()) lis = [0]*205 lis[0] == 30000 lis[1] == 20000 lis[2] == 10000 if n == m and n == 1: print(1000000) else: print(lis[n-1]+lis[m-1])
n,m = map(int,input().split()) lis = [0]*205 lis[0] = 300000 lis[1] = 200000 lis[2] = 100000 if n == m and n == 1: print(1000000) else: print(lis[n-1]+lis[m-1])
[]
657,753
657,752
u728615412
python
p02853
def main(x: int, y: int): award = 0 if (x and y) == 1: award += 400000 for i in [x, y]: if i == 1: award += 300000 elif i == 2: award += 200000 elif i == 3: award += 100000 print(award) if __name__ == "__main__": x, y = map(int, input().split()) main(x, y)
def main(x: int, y: int): award = 0 if x == y == 1: award += 400000 for i in [x, y]: if i == 1: award += 300000 elif i == 2: award += 200000 elif i == 3: award += 100000 print(award) if __name__ == "__main__": x, y = map(int, input().split()) main(x, y)
[ "control_flow.branch.if.condition.change" ]
657,756
657,757
u977642052
python
p02853
def main(x: int, y: int): award: int = 0 if (x and y) == 1: award += 400000 for i in [x, y]: if i == 1: award += 300000 elif i == 2: award += 200000 elif i == 3: award += 100000 print(award) if __name__ == "__main__": x, y = map(int, input().split()) main(x, y)
def main(x: int, y: int): award = 0 if x == y == 1: award += 400000 for i in [x, y]: if i == 1: award += 300000 elif i == 2: award += 200000 elif i == 3: award += 100000 print(award) if __name__ == "__main__": x, y = map(int, input().split()) main(x, y)
[ "control_flow.branch.if.condition.change" ]
657,758
657,757
u977642052
python
p02853
n = [int(i) for i in input().split()] T=0 for i in range(2): if n[i] == 1: T+=3 elif n[i] == 1: T+=2 elif n[i] == 3: T+=1 if sum(n)==2: T+=4 print(T*100000)
n = [int(i) for i in input().split()] T=0 for i in range(2): if n[i] == 1: T+=3 elif n[i] == 2: T+=2 elif n[i] == 3: T+=1 if sum(n)==2: T+=4 print(T*100000)
[ "literal.number.integer.change", "control_flow.branch.if.condition.change" ]
657,761
657,762
u295294832
python
p02853
x,y=map(int,input()) if(x==y==1): print(1000000) else: ans=max(4-x,0)*100000+max(4-y,0)*100000 print(ans)
x,y=map(int,input().split()) if(x==y==1): print(1000000) else: ans=max(4-x,0)*100000+max(4-y,0)*100000 print(ans)
[ "call.add" ]
657,764
657,765
u256868077
python
p02853
X,Y = map(int,input().split()) ans = 0 if X <= 3 : ans += (4-X)*100000 if Y <= 3 : ans += (4-X)*100000 if X == 1 and Y == 1: ans += 400000 print(ans)
X,Y = map(int,input().split()) ans = 0 if X <= 3 : ans += (4-X)*100000 if Y <= 3 : ans += (4-Y)*100000 if X == 1 and Y == 1: ans += 400000 print(ans)
[ "identifier.change", "expression.operation.binary.change" ]
657,776
657,777
u009348313
python
p02853
import sys input = sys.stdin.readline def main(): X, Y = list(map(int, input().split())) # X = list(map(int, input().split())) ans = 0 if X == 3: ans += 100000 elif X == 2: ans += 100000 elif X == 1: ans += 300000 if Y == 3: ans += 100000 elif Y == 2: ans += 100000 elif Y == 1: ans += 300000 if X == 1 and Y == 1: ans += 400000 print(ans) if __name__ == '__main__': main()
import sys input = sys.stdin.readline def main(): X, Y = list(map(int, input().split())) # X = list(map(int, input().split())) ans = 0 if X == 3: ans += 100000 elif X == 2: ans += 200000 elif X == 1: ans += 300000 if Y == 3: ans += 100000 elif Y == 2: ans += 200000 elif Y == 1: ans += 300000 if X == 1 and Y == 1: ans += 400000 print(ans) if __name__ == '__main__': main()
[ "literal.number.integer.change" ]
657,800
657,801
u642874916
python
p02853
x,y = map(int, input().split()) ans = 0 d = [300000,200000,100000] if 1<=x and x<=3: ans += d[x-1] if 1<=y and y<=3: ans += d[x-1] if x==y and x==1: ans += 400000 print(ans)
x,y = map(int, input().split()) ans = 0 d = [300000,200000,100000] if 1<=x and x<=3: ans += d[x-1] if 1<=y and y<=3: ans += d[y-1] if x==y and x==1: ans += 400000 print(ans)
[ "identifier.change", "variable_access.subscript.index.change", "expression.operation.binary.change" ]
657,804
657,805
u117348081
python
p02853
x, y = map(int, input().split()) ans = max(0,4-x) + max(0,3-y) if x==1==y: ans += 4 print(ans*100000)
x, y = map(int, input().split()) ans = max(0,4-x) + max(0,4-y) if x==1==y: ans += 4 print(ans*100000)
[ "literal.number.integer.change", "assignment.value.change", "call.arguments.change", "expression.operation.binary.change" ]
657,806
657,807
u242031676
python
p02853
a,b=map(int,input().split()) ans=0 if a<=3: ans+=(4-a)*10**5 if b<=3: ans+=(4-a)*10**5 if a==b==1: ans+=4*10**5 print(ans)
a,b=map(int,input().split()) ans=0 if a<=3: ans+=(4-a)*10**5 if b<=3: ans+=(4-b)*10**5 if a==b==1: ans+=4*10**5 print(ans)
[ "identifier.change", "expression.operation.binary.change" ]
657,834
657,835
u995109095
python
p02853
X, Y = map(int, input().split()) points = [-1, 100000, 200000, 300000, 0] print(400000*(X==Y==1) + points[min(4, X)] + points[min(4, Y)])
X, Y = map(int, input().split()) points = [-1, 300000, 200000, 100000, 0] print(400000*(X==Y==1) + points[min(4, X)] + points[min(4, Y)])
[ "literal.number.integer.change", "assignment.value.change" ]
657,846
657,847
u599547273
python
p02853
X, Y = map(int, input().split()) points = [-1, 100000, 200000, 300000, 0] print(400000*(X==Y==1) + points[max(4, X)] + points[max(4, Y)])
X, Y = map(int, input().split()) points = [-1, 300000, 200000, 100000, 0] print(400000*(X==Y==1) + points[min(4, X)] + points[min(4, Y)])
[ "literal.number.integer.change", "assignment.value.change", "misc.opposites", "identifier.change", "call.function.change", "variable_access.subscript.index.change", "call.arguments.change", "expression.operation.binary.change", "io.output.change" ]
657,848
657,847
u599547273
python
p02853
a, b = [int(x) for x in input().split()] won = 0 if a in range(1, 4): won += [0,300000,200000,200000][a] if b in range(1, 4): won += [0,300000,200000,100000][b] if a == 1 and b == 1:won += 400000 print(won)
a, b = [int(x) for x in input().split()] won = 0 if a in range(1, 4): won += [0,300000,200000,100000][a] if b in range(1, 4): won += [0,300000,200000,100000][b] if a == 1 and b == 1:won += 400000 print(won)
[ "literal.number.integer.change" ]
657,851
657,852
u674190122
python
p02853
X, Y = map(int, input().split()) r = 0 if(X == 1): r += 300000 elif(X == 2): r += 200000 elif(X == 3): r += 300000 else: pass if(Y == 1): r += 300000 elif(Y == 2): r += 200000 elif(Y == 3): r += 300000 if(X == Y == 1): r += 400000 print(r)
X, Y = map(int, input().split()) r = 0 if(X == 1): r += 300000 elif(X == 2): r += 200000 elif(X == 3): r += 100000 else: pass if(Y == 1): r += 300000 elif(Y == 2): r += 200000 elif(Y == 3): r += 100000 else: pass if(X == Y == 1): r += 400000 print(r)
[ "literal.number.integer.change", "control_flow.pass.add" ]
657,853
657,854
u716529032
python
p02853
X, Y = map(int, input().split()) ans = 0 if X == 3: ans += 100000 elif X == 2: ans += 200000 elif X == 1: ans + 300000 if Y == 3: ans += 100000 elif Y == 2: ans += 200000 elif Y == 1: ans + 300000 if ans == 600000: ans += 400000 print(ans)
X, Y = map(int, input().split()) ans = 0 if X == 3: ans += 100000 elif X == 2: ans += 200000 elif X == 1: ans += 300000 if Y == 3: ans += 100000 elif Y == 2: ans += 200000 elif Y == 1: ans += 300000 if ans == 600000: ans += 400000 print(ans)
[ "assignment.compound.arithmetic.replace.add", "expression.operator.arithmetic.replace.remove", "expression.operation.binary.change" ]
657,855
657,856
u500297289
python
p02853
X,Y = map(int,input().split()) if X*Y == 1: print(10^6) else: print(10^5*(max(0,4-X)+max(0,4-Y)))
X,Y = map(int,input().split()) if X*Y == 1: print(10**6) else: print(10**5*(max(0,4-X)+max(0,4-Y)))
[ "call.arguments.change", "expression.operation.binary.change", "io.output.change" ]
657,867
657,868
u747602774
python
p02853
X,Y = map(int,input().split()) if X*Y == 1: print(10^6) else: print(10^5*(max(0,4-X)+max(0,4-X)))
X,Y = map(int,input().split()) if X*Y == 1: print(10**6) else: print(10**5*(max(0,4-X)+max(0,4-Y)))
[ "call.arguments.change", "expression.operation.binary.change", "io.output.change", "identifier.change" ]
657,869
657,868
u747602774
python
p02853
x,y=map(int,input().split()) if (x==y==1): output=1000000 elif (x*y==2): output=500000 elif (x*y==3): output=400000 elif (x*y==4): output=400000 elif (x*y==6): output=300000 elif (x*y==9): output=200000 #x or y elif (x==1 or y==1): output=300000 elif (x==2 or y==2): output=200000 elif (x==3 or y==3): output=100000 else: output=0 print(output)
x,y=map(int,input().split()) if (x==y==1): output=1000000 elif (x*y==2): output=500000 elif (x*y==3): output=400000 #elif (x*y==4):4*1が存在 elif (x==y==2): output=400000 elif (x*y==6): output=300000 elif (x*y==9): output=200000 #x or y elif (x==1 or y==1): output=300000 elif (x==2 or y==2): output=200000 elif (x==3 or y==3): output=100000 else: output=0 print(output)
[ "control_flow.branch.if.condition.change", "literal.number.integer.change" ]
657,872
657,873
u117078923
python
p02853
n = input().split(' ') third = 100000 second = 200000 first = 300000 sum = 0 for i in n: if int(i) == 3: sum = sum + third elif int(i) == 2: sum = sum + second elif int(i) == 1: sum = sum + first if int(n[0]) == 1 and int(n[1]): sum = sum + 400000 print(sum)
n = input().split(' ') third = 100000 second = 200000 first = 300000 sum = 0 for i in n: if int(i) == 3: sum = sum + third elif int(i) == 2: sum = sum + second elif int(i) == 1: sum = sum + first if int(n[0]) == 1 and int(n[1]) == 1: sum = sum + 400000 print(sum)
[ "control_flow.branch.if.condition.change" ]
657,883
657,884
u719181921
python
p02853
X, Y = map(int, input().split()) if X == 1 and Y == 1: print(1000000) elif (X == 1 and Y == 2) or (X == 2 and Y == 1): print(500000) elif (X == 1 and Y == 3) or (X == 3 and Y == 1) or (X == 2 and Y == 2): print(400000) elif (X == 1 and Y >= 4) or (X >= 4 and Y == 1) or (X == 2 and Y == 3) or (X == 3 and Y == 2): print(300000) elif (X == 2 and Y >= 4) or (X >= 4 and Y == 2) or (X == 3 and Y == 3): print(200000) elif (X == 3 and Y >= 4) or (X >= 3 and Y == 2): print(100000) else: print(0)
X, Y = map(int, input().split()) if X == 1 and Y == 1: print(1000000) elif (X == 1 and Y == 2) or (X == 2 and Y == 1): print(500000) elif (X == 1 and Y == 3) or (X == 3 and Y == 1) or (X == 2 and Y == 2): print(400000) elif (X == 1 and Y >= 4) or (X >= 4 and Y == 1) or (X == 2 and Y == 3) or (X == 3 and Y == 2): print(300000) elif (X == 2 and Y >= 4) or (X >= 4 and Y == 2) or (X == 3 and Y == 3): print(200000) elif (X == 3 and Y >= 4) or (X >= 4 and Y == 3): print(100000) else: print(0)
[ "literal.number.integer.change", "control_flow.branch.if.condition.change" ]
657,885
657,886
u948050032
python
p02853
X, Y = map(int, input().split()) if X <= 3 and Y <= 3: ans = (4-X) * 100000 + (4-Y) * 100000 if X == 1 and Y == 1: ans += 400000 elif X <= 3: ans = (4-X) * 100000 elif Y <= 3: ans = (4-Y) * 100000 print(ans)
X, Y = map(int, input().split()) if X <= 3 and Y <= 3: ans = (4-X) * 100000 + (4-Y) * 100000 if X == 1 and Y == 1: ans += 400000 elif X <= 3: ans = (4-X) * 100000 elif Y <= 3: ans = (4-Y) * 100000 else: ans = 0 print(ans)
[ "assignment.add" ]
657,896
657,897
u194297606
python
p02853
x, y = input().split() price = 0 try: if 1 <= int(x) <= 205 and 1 <= int(y) <= 205: if int(x) == 1 or int(y) == 1: price += 400000 if int(x) == 1: price += 300000 elif int(x) == 2: price += 200000 elif int(x) == 3: price += 100000 if int(y) == 1: price += 300000 elif int(y) == 2: price += 200000 elif int(y) == 3: price += 100000 print(price) except: pass
x, y = input().split() price = 0 try: if 1 <= int(x) <= 205 and 1 <= int(y) <= 205: if int(x) == 1 and int(y) == 1: price += 400000 if int(x) == 1: price += 300000 elif int(x) == 2: price += 200000 elif int(x) == 3: price += 100000 if int(y) == 1: price += 300000 elif int(y) == 2: price += 200000 elif int(y) == 3: price += 100000 print(price) except: print(price)
[ "control_flow.branch.if.condition.change", "call.arguments.add" ]
657,902
657,903
u631525844
python
p02853
x, y = input(), input() price = 0 try: if 1 <= int(x) <= 205 and 1 <= int(y) <= 205: if int(x) == 1 or int(y) == 1: price += 400000 if int(x) == 1: price += 300000 elif int(x) == 2: price += 200000 elif int(x) == 3: price += 100000 if int(y) == 1: price += 300000 elif int(y) == 2: price += 200000 elif int(y) == 3: price += 100000 print(price) except: print(price)
x, y = input().split() price = 0 try: if 1 <= int(x) <= 205 and 1 <= int(y) <= 205: if int(x) == 1 and int(y) == 1: price += 400000 if int(x) == 1: price += 300000 elif int(x) == 2: price += 200000 elif int(x) == 3: price += 100000 if int(y) == 1: price += 300000 elif int(y) == 2: price += 200000 elif int(y) == 3: price += 100000 print(price) except: print(price)
[ "control_flow.branch.if.condition.change" ]
657,904
657,903
u631525844
python
p02853
x, y = input().split() price = 0 try: if 1 <= int(x) <= 205 and 1 <= int(y) <= 205: if int(x) == 1 or int(y) == 1: price += 400000 if int(x) == 1: price += 300000 elif int(x) == 2: price += 200000 elif int(x) == 3: price += 100000 if int(y) == 1: price += 300000 elif int(y) == 2: price += 200000 elif int(y) == 3: price += 100000 print(price) except: print(price)
x, y = input().split() price = 0 try: if 1 <= int(x) <= 205 and 1 <= int(y) <= 205: if int(x) == 1 and int(y) == 1: price += 400000 if int(x) == 1: price += 300000 elif int(x) == 2: price += 200000 elif int(x) == 3: price += 100000 if int(y) == 1: price += 300000 elif int(y) == 2: price += 200000 elif int(y) == 3: price += 100000 print(price) except: print(price)
[ "control_flow.branch.if.condition.change" ]
657,905
657,903
u631525844
python
p02853
input_number = input() input_list = input_number.split() coding_contest_rank = int(input_list[0]) robot_maneuver_rank = int(input_list[1]) if coding_contest_rank == 1: coding_contest_money = 300000 if robot_maneuver_rank == 1: robot_maneuver_money = 300000 if coding_contest_rank == 2: coding_contest_money = 200000 if robot_maneuver_rank == 2: robot_maneuver_money = 200000 if coding_contest_rank == 3: coding_contest_money = 100000 if robot_maneuver_rank == 3: robot_maneuver_money = 100000 if coding_contest_rank > 3: coding_contest_money = 0 if robot_maneuver_rank > 3: robot_maneuver_money = 0 elif coding_contest_rank == 1 and robot_maneuver_rank == 1: total_money = coding_contest_money + robot_maneuver_money + 400000 print(total_money) print(coding_contest_money + robot_maneuver_money)
input_number = input() input_list = input_number.split() coding_contest_rank = int(input_list[0]) robot_maneuver_rank = int(input_list[1]) if coding_contest_rank == 1: coding_contest_money = 300000 if robot_maneuver_rank == 1: robot_maneuver_money = 300000 if coding_contest_rank == 2: coding_contest_money = 200000 if robot_maneuver_rank == 2: robot_maneuver_money = 200000 if coding_contest_rank == 3: coding_contest_money = 100000 if robot_maneuver_rank == 3: robot_maneuver_money = 100000 if coding_contest_rank > 3: coding_contest_money = 0 if robot_maneuver_rank > 3: robot_maneuver_money = 0 if coding_contest_rank == 1 and robot_maneuver_rank == 1: total_money = coding_contest_money + robot_maneuver_money + 400000 print(total_money) else: print(coding_contest_money + robot_maneuver_money)
[ "control_flow.branch.if.replace.add", "control_flow.branch.else_if.replace.remove" ]
657,908
657,909
u209631375
python
p02853
A, B = map(int, input().split()) list = [500000,300000,200000,100000,0] if(A>3): A = 4 elif(B>3): B = 4 elif(A==1 and B==1): A=B=0 money = list[A]+list[B] print(money)
A, B = map(int, input().split()) list = [500000,300000,200000,100000,0] if(A>3): A = 4 if(B>3): B = 4 elif(A==1 and B==1): A=B=0 money = list[A]+list[B] print(money)
[ "control_flow.branch.if.replace.add", "control_flow.branch.else_if.replace.remove" ]
657,910
657,911
u589047182
python
p02853
x,y=map(int,input().split()) if x==1 and y==1: print(1000000) elif x<=3 and y>=4: print((x-4)*(-100000)) elif x>=4 and y<=3: print((y-4)*(-100000)) elif x<=3 and y<=3: peint(((x-4)*(-100000))+((y-4)*(-100000))) else: print(0)
x,y=map(int,input().split()) if x==1 and y==1: print(1000000) elif x<=3 and y>=4: print((x-4)*(-100000)) elif x>=4 and y<=3: print((y-4)*(-100000)) elif x<=3 and y<=3: print((x-4)*(-100000)+(y-4)*(-100000)) else: print(0)
[ "identifier.change", "call.function.change", "call.arguments.change" ]
657,916
657,917
u740047492
python
p02853
x,y=map(int,input().split()) if x==1 and y==1: print(1000000) elif x<=3 and y>=4: print((x-4)*(-100000)) elif x>=4 and y<=3: print((y-4)*(-100000)) elif x<=3 and y<=3: peint((x-4)*(-100000)+(y-4)*(-100000)) else: print(0)
x,y=map(int,input().split()) if x==1 and y==1: print(1000000) elif x<=3 and y>=4: print((x-4)*(-100000)) elif x>=4 and y<=3: print((y-4)*(-100000)) elif x<=3 and y<=3: print((x-4)*(-100000)+(y-4)*(-100000)) else: print(0)
[ "identifier.change", "call.function.change" ]
657,918
657,917
u740047492
python
p02853
X, Y = map(int, input().split()) if X == 1: x = 30000 elif X == 2: x = 20000 elif X == 3: x = 10000 else: x = 0 if Y == 1: y = 30000 elif Y == 2: y = 20000 elif Y == 3: y = 10000 else: y = 0 if X == 1 and Y == 1: print(1000000) else: print(x+y)
X, Y = map(int, input().split()) if X == 1: x = 300000 elif X == 2: x = 200000 elif X == 3: x = 100000 else: x = 0 if Y == 1: y = 300000 elif Y == 2: y = 200000 elif Y == 3: y = 100000 else: y = 0 if X == 1 and Y == 1: print(1000000) else: print(x+y)
[ "literal.number.integer.change", "assignment.value.change" ]
657,939
657,940
u212786022
python
p02853
X, Y = map(int, input().split()) ranks = [X, Y] ans = 0 for i in ranks: if i == 1: ans += 300000 elif i == 2: ans += 200000 elif i == 3: ans += 100000 if (X, Y) == (1, 1): ans = 700000 print(ans)
X, Y = map(int, input().split()) ranks = [X, Y] ans = 0 for i in ranks: if i == 1: ans += 300000 elif i == 2: ans += 200000 elif i == 3: ans += 100000 if (X, Y) == (1, 1): ans = 1000000 print(ans)
[ "literal.number.integer.change", "assignment.value.change" ]
657,945
657,946
u982591663
python
p02853
A, B = map(int, input().split()) money = 0 if A==1 and B ==1: print("1000000") elif A<4 and B > 3: money = 100000 * (4-A) print(money) elif A>3 and B < 4: money = 100000 * (4-B) print(money) elif A <3 and B <3: money = 100000 * (4-A) + 100000 * (4-B) print(money) else: print("0")
A, B = map(int, input().split()) money = 0 if A==1 and B ==1: print("1000000") elif A<4 and B > 3: money = 100000 * (4-A) print(money) elif A>3 and B < 4: money = 100000 * (4-B) print(money) elif A <4 and B <4: money = 100000 * (4-A) + 100000 * (4-B) print(money) else: print("0")
[ "literal.number.integer.change", "control_flow.branch.if.condition.change" ]
657,947
657,948
u439319240
python
p02853
X,Y = map(int, input().split()) ls = [300000, 200000, 100000] + [0 for i in range(300)] result = ls[X - 1] + ls[Y - 1] if X == 1 & Y == 1: result += 400000 print(result)
X,Y = map(int, input().split()) ls = [300000, 200000, 100000] + [0 for i in range(300)] result = ls[X - 1] + ls[Y - 1] if X == 1 and Y == 1: result += 400000 print(result)
[ "control_flow.branch.if.condition.change" ]
657,971
657,972
u798894056
python
p02853
x,y = map(int,input().split()) ans = 0 if x == 1 : ans = 300000 elif x == 2: ans = 200000 elif x == 3: ans = 100000 if y == 1: ans += 300000 elif y == 2: ans += 200000 elif y == 3: ans += 100000 if x == 1: ans += 400000 if y == 1: ans += 400000 print(ans)
x,y = map(int,input().split()) ans = 0 if x == 1 : ans = 300000 elif x == 2: ans = 200000 elif x == 3: ans = 100000 if y == 1: ans += 300000 elif y == 2: ans += 200000 elif y == 3: ans += 100000 if x == 1 and y == 1: ans += 400000 print(ans)
[]
657,973
657,974
u671239754
python
p02853
X,Y = map(int,input().split()) total = 0 if X <= 3: total += (4 - X) * 100000 if Y <= 3: total += (4 - X) * 100000 if X==1 and Y==1: total += 400000 print(total)
X,Y = map(int,input().split()) total = 0 if X <= 3: total += (4 - X) * 100000 if Y <= 3: total += (4 - Y) * 100000 if X==1 and Y==1: total += 400000 print(total)
[ "identifier.change", "expression.operation.binary.change" ]
657,975
657,976
u159217536
python
p02853
X, Y = map(int, input().split()) ans = 0 if X == Y == 1: ans = 400000 + 300000 + 300000 else: if X == 1 or Y == 1: ans += 300000 elif X == 2: ans += 200000 elif Y == 2: ans += 200000 elif X == 3: ans += 100000 elif Y == 3: ans += 100000 print(ans)
X, Y = map(int, input().split()) ans = 0 if X == Y == 1: ans = 400000 + 300000 + 300000 else: if X == 1 or Y == 1: ans += 300000 if X == 2: ans += 200000 if Y == 2: ans += 200000 if X == 3: ans += 100000 if Y == 3: ans += 100000 print(ans)
[ "control_flow.branch.if.replace.add", "control_flow.branch.else_if.replace.remove" ]
657,989
657,990
u045909335
python
p02853
x,y=map(int,input().split()) x=0 if x>=4 else x y=0 if y>=4 else y print(1000000 if x==1 and y==1 else (x+y)*100000)
x,y=map(int,input().split()) x=0 if x>=4 else 4-x y=0 if y>=4 else 4-y print(1000000 if x==3 and y==3 else (x+y)*100000)
[ "literal.number.integer.change", "call.arguments.change", "io.output.change" ]
658,001
658,002
u809457879
python
p02853
a,b = map(int,input().split()) c = 0 if a == 3: c += 1 elif a == 2: c += 2 elif a == 1: c += 3 if b == 3: c += 1 elif b == 2: c += 2 elif b == 1: c += 3 if a == b == 1: c += 4
a,b = map(int,input().split()) c = 0 if a == 3: c += 1 elif a == 2: c += 2 elif a == 1: c += 3 if b == 3: c += 1 elif b == 2: c += 2 elif b == 1: c += 3 if a == b == 1: c += 4 print(c*100000)
[ "call.add" ]
658,003
658,004
u853900545
python
p02853
a,b = map(int,input().split()) c = 0 if a == 3: c += 1 elif a == 2: c += 2 elif a == 1: c += 3 if b == 3: c += 1 elif b == 2: b += 2 elif a == 1: b += 3 if a == b == 1: c += 4 print(c*100000)
a,b = map(int,input().split()) c = 0 if a == 3: c += 1 elif a == 2: c += 2 elif a == 1: c += 3 if b == 3: c += 1 elif b == 2: c += 2 elif b == 1: c += 3 if a == b == 1: c += 4 print(c*100000)
[ "identifier.change", "control_flow.branch.if.condition.change" ]
658,005
658,004
u853900545
python
p02853
X, Y = map(int, input().split()) KANE = [ 300000, 200000, 100000 ] ans=0 if X <= 3: ans = KANE[X-1] if Y <= 3: ans = KANE[Y-1] if X == 1 and Y == 1: ans += 400000 print(ans)
X, Y = map(int, input().split()) KANE = [ 300000, 200000, 100000 ] ans=0 if X <= 3: ans += KANE[X-1] if Y <= 3: ans += KANE[Y-1] if X == 1 and Y == 1: ans += 400000 print(ans)
[ "assignment.value.change" ]
658,006
658,007
u067729694
python
p02853
x, y = list(map(int, input().split())) ans = 0 if x == 1 and y == 1: ans += 400000 elif x == 1: ans += 300000 elif x == 2: ans += 200000 elif x == 3: ans += 100000 elif y == 1: ans += 300000 elif y == 2: ans += 200000 elif y == 3: ans += 100000 print(ans)
x, y = list(map(int, input().split())) ans = 0 if x == 1 and y == 1: ans += 400000 if x == 1: ans += 300000 elif x == 2: ans += 200000 elif x == 3: ans += 100000 if y == 1: ans += 300000 elif y == 2: ans += 200000 elif y == 3: ans += 100000 print(ans)
[ "control_flow.branch.if.replace.add", "control_flow.branch.else_if.replace.remove" ]
658,008
658,009
u597455618
python
p02853
x,y = map(int,input().split()) l = [0,300000,200000,100000] alpha = 400000 ans = 0 if x == 1 and y == 1: ans = l[1]*2 + alpha print(ans) else: if 1 <= x <= 3: ans = l[x] if 1 <= y <= 3: ans = l[y] print(ans)
x,y = map(int,input().split()) l = [0,300000,200000,100000] alpha = 400000 ans = 0 if x == 1 and y == 1: ans = l[1]*2 + alpha print(ans) else: if 1 <= x <= 3: ans += l[x] if 1 <= y <= 3: ans += l[y] print(ans)
[ "assignment.value.change" ]
658,014
658,015
u135847648
python
p02853
x,y=map(int,input().split()) a=0 if x==3: a+=1 if y==3: a+=1 if x==2: a+=2 if y==2: a+=2 if x==1: a+=3 if x==1: a+=3 if x==y==1: a+=4 print(a*100000)
x,y=map(int,input().split()) a=0 if x==3: a+=1 if y==3: a+=1 if x==2: a+=2 if y==2: a+=2 if x==1: a+=3 if y==1: a+=3 if x==1 and y==1: a+=4 print(a*100000)
[ "identifier.change", "control_flow.branch.if.condition.change" ]
658,020
658,021
u187516587
python
p02853
x, y = map(int, input().split()) d = {1:300000, 2:200000, 3:100000} if x == 1 and y == 1: print(10**6) exit() su = 0 if x in d: su += d[x] if y in d: su += d[x] print(su)
x, y = map(int, input().split()) d = {1:300000, 2:200000, 3:100000} if x == 1 and y == 1: print(10**6) exit() su = 0 if x in d: su += d[x] if y in d: su += d[y] print(su)
[ "identifier.change", "variable_access.subscript.index.change" ]
658,028
658,029
u116763463
python
p02853
X, Y = map(int,input().split()) AnswerX = 0 AnswerY = 0 AnswerW = 0 if X*Y == 1: AnswerW = 400000 if X == 1: AnswerX= 300000 elif X==2: AnswerX = 20000 elif X==3: AnswerX = 10000 if Y == 1: AnswerY= 300000 elif Y==2: AnswerY = 20000 elif Y==3: AnswerY = 10000 Answer = AnswerX + AnswerY + AnswerW print(Answer)
X, Y = map(int,input().split()) AnswerX = 0 AnswerY = 0 AnswerW = 0 if X*Y == 1: AnswerW = 400000 if X == 1: AnswerX= 300000 elif X==2: AnswerX = 200000 elif X==3: AnswerX = 100000 if Y == 1: AnswerY= 300000 elif Y==2: AnswerY = 200000 elif Y==3: AnswerY = 100000 Answer = AnswerX + AnswerY + AnswerW print(Answer)
[ "literal.number.integer.change", "assignment.value.change" ]
658,036
658,037
u760794812
python
p02853
X,Y=map(int,input().split()) prize=0 if X==1: prize+=300000 if Y==1: prize+=700000 elif Y==2: prize+=200000 elif Y==3: prize+=100000 else: pass elif X==2: prize+=200000 if Y==1: prize+=300000 elif Y==2: prize+=200000 elif Y==3: prize+=100000 else: pass elif X==3: prize+=100000 if Y==1: prize+=300000 elif Y==2: prize+=200000 elif Y==3: prize+=100000 else: pass else: prize+=100000 if Y==1: prize+=300000 elif Y==2: prize+=200000 elif Y==3: prize+=100000 else: pass print(prize)
X,Y=map(int,input().split()) prize=0 if X==1: prize+=300000 if Y==1: prize+=700000 elif Y==2: prize+=200000 elif Y==3: prize+=100000 else: pass elif X==2: prize+=200000 if Y==1: prize+=300000 elif Y==2: prize+=200000 elif Y==3: prize+=100000 else: pass elif X==3: prize+=100000 if Y==1: prize+=300000 elif Y==2: prize+=200000 elif Y==3: prize+=100000 else: pass else: if Y==1: prize+=300000 elif Y==2: prize+=200000 elif Y==3: prize+=100000 else: pass print(prize)
[]
658,038
658,039
u547608423
python
p02853
X,Y=map(int,input().split()) prize=0 if X==1: prize+=300000 if Y==1: pprize+=700000 elif Y==2: prize+=200000 elif Y==3: prize+=100000 else: pass elif X==2: prize+=200000 if Y==1: prize+=300000 elif Y==2: prize+=200000 elif Y==3: prize+=100000 else: pass elif X==3: prize+=100000 if Y==1: prize+=300000 elif Y==2: prize+=200000 elif Y==3: prize+=100000 else: pass else: prize+=100000 if Y==1: prize+=300000 elif Y==2: prize+=200000 elif Y==3: prize+=100000 else: pass print(prize)
X,Y=map(int,input().split()) prize=0 if X==1: prize+=300000 if Y==1: prize+=700000 elif Y==2: prize+=200000 elif Y==3: prize+=100000 else: pass elif X==2: prize+=200000 if Y==1: prize+=300000 elif Y==2: prize+=200000 elif Y==3: prize+=100000 else: pass elif X==3: prize+=100000 if Y==1: prize+=300000 elif Y==2: prize+=200000 elif Y==3: prize+=100000 else: pass else: if Y==1: prize+=300000 elif Y==2: prize+=200000 elif Y==3: prize+=100000 else: pass print(prize)
[ "identifier.change" ]
658,040
658,039
u547608423
python
p02853
s=0 for i in map(int, input().split()): if i==1: s+=300000 elif i==2: s+200000 elif i==3: s+=100000 if s==600000: s+=400000 print(s)
s = 0 for i in map(int, input().split()): if i==1: s+=300000 elif i==2: s+=200000 elif i==3: s+=100000 if s==600000: s=1000000 print(s)
[ "assignment.compound.arithmetic.replace.add", "expression.operator.arithmetic.replace.remove", "expression.operation.binary.change" ]
658,041
658,042
u741268465
python
p02853
# -*- coding: utf-8 -*- X, Y = map(int, input().split()) def get_money(rank): money = 0 if rank == 1: money = 300000 elif rank == 2: money = 200000 elif rank == 3: money = 100000 return money ans = 0 ans += get_money(X) ans += get_money(Y) if X == 1 & Y == 1: ans += 400000 print(ans)
# -*- coding: utf-8 -*- X, Y = map(int, input().split()) def get_money(rank): money = 0 if rank == 1: money = 300000 elif rank == 2: money = 200000 elif rank == 3: money = 100000 return money ans = 0 ans += get_money(X) ans += get_money(Y) if X == 1 and Y == 1: ans += 400000 print(ans)
[ "control_flow.branch.if.condition.change" ]
658,058
658,059
u811817592
python
p02853
aw = 0 for i in map(int, input().split()): if i == 1: s+=300000 elif i ==2 : s+= 200000 elif i ==3 : s+= 100000 if aw== 600000: aw= 1000000 print(aw)
aw = 0 for i in map(int, input().split()): if i == 1: aw+=300000 elif i ==2 : aw+= 200000 elif i ==3 : aw+= 100000 if aw== 600000: aw= 1000000 print(aw)
[ "identifier.change" ]
658,064
658,065
u843845221
python
p02853
import math#数学的計算はこれでいける。普通に0.5乗しても計算可能 N = 1 x, y = [0]*N, [0]*N#N個の空のリストを作成 l = list(range(N))#範囲がNのリストを作成する sum=0 #print(x[0]) for i in range(N): x[i], y[i] = map(int, input().split()) if x[0] <= 3: sum=sum+10000*(4-x[0]) else: pass if y[0]<= 3: sum=sum+10000*(4-y[0]) else: pass if x[0]==1 and y[0]==1: sum=sum+40000 else: pass print(sum)
# -*- Coding: utf-8 -*- import itertools#これは色々使える組み込み関数みたいなやつ import math#数学的計算はこれでいける。普通に0.5乗しても計算可能 N = 1 x, y = [0]*N, [0]*N#N個の空のリストを作成 l = list(range(N))#範囲がNのリストを作成する sum=0 #print(x[0]) for i in range(N): x[i], y[i] = map(int, input().split()) if x[0] <= 3: sum=sum+100000*(4-x[0]) else: pass if y[0]<= 3: sum=sum+100000*(4-y[0]) else: pass if x[0]==1 and y[0]==1: sum=sum+400000 else: pass print(sum)
[ "literal.number.integer.change", "assignment.value.change", "expression.operation.binary.change" ]
658,075
658,076
u007886915
python
p02853
x,y = (int(x) for x in input().split()) if x>3 & y>3: print(0) elif x<=3 & y<=3: if x+y == 2: print(1000000) elif x+y == 3: print(500000) elif x+y == 4: print(400000) elif x+y == 5: print(300000) else: print(200000) else: z = min(x,y) if z == 1: print(300000) elif z == 2: print(200000) else: print(100000)
x,y = (int(x) for x in input().split()) if x>3 and y>3: print(0) elif x<=3 and y<=3: if x+y == 2: print(1000000) elif x+y == 3: print(500000) elif x+y == 4: print(400000) elif x+y == 5: print(300000) else: print(200000) else: z = min(x,y) if z == 1: print(300000) elif z == 2: print(200000) else: print(100000)
[ "control_flow.branch.if.condition.change" ]
658,077
658,078
u985408358
python
p02853
X, Y = map(int, input().split()) prices = {1: 300000, 2: 200000, 3: 100000} ans = 0 if X < 4: ans += prices[X] if Y < 4: ans += prices[Y] if Y == 1 & X == 1: ans += 400000 print(ans)
X, Y = map(int, input().split()) prices = {1: 300000, 2: 200000, 3: 100000} ans = 0 if X < 4: ans += prices[X] if Y < 4: ans += prices[Y] if Y == 1 and X == 1: ans += 400000 print(ans)
[ "control_flow.branch.if.condition.change" ]
658,090
658,091
u254634413
python
p02853
X, Y = map(int, input().split()) prices = {1: 300000, 2: 200000, 3: 1000000} ans = 0 if X < 4: ans += prices[X] if Y < 4: ans += prices[Y] if Y == 1 and X == 1: ans += 400000 print(ans)
X, Y = map(int, input().split()) prices = {1: 300000, 2: 200000, 3: 100000} ans = 0 if X < 4: ans += prices[X] if Y < 4: ans += prices[Y] if Y == 1 and X == 1: ans += 400000 print(ans)
[ "literal.number.integer.change", "assignment.value.change" ]
658,092
658,091
u254634413
python
p02853
x, y = map(int, input().split()) ans += max(0, (4-x)*100000) ans += max(0, (4-y)*100000) if x == 1 and y == 1: ans += 400000 print(ans)
x, y = map(int, input().split()) ans = 0 ans += max(0, (4-x)*100000) ans += max(0, (4-y)*100000) if x == 1 and y == 1: ans += 400000 print(ans)
[ "assignment.add" ]
658,108
658,109
u299869545
python
p02853
x, y = map(int, input().split()) ans = 0 if x == 1: ans += 300000 elif x == 2: ans += 200000 elif x == 3: ans += 100000 if y == 1: ans += 300000 elif y == 2: ans += 200000 elif y == 3: ans += 10000 if x == 1 and y == 1: ans += 400000 print(ans)
x, y = map(int, input().split()) ans = 0 if x == 1: ans += 300000 elif x == 2: ans += 200000 elif x == 3: ans += 100000 if y == 1: ans += 300000 elif y == 2: ans += 200000 elif y == 3: ans += 100000 if x == 1 and y == 1: ans += 400000 print(ans)
[ "literal.number.integer.change" ]
658,114
658,115
u552746936
python
p02853
x,y = map(int ,input().split()) l=[300000,200000,100000,0] if x>=4: x=4 elif y>=4: y=4 if x==1 and y==1: print(1000000) else: print(l[x-1]+l[y-1])
x,y = map(int ,input().split()) l=[300000,200000,100000,0] if x>=4: x=4 if y>=4: y=4 if x==1 and y==1: print(1000000) else: print(l[x-1]+l[y-1])
[ "control_flow.branch.if.replace.add", "control_flow.branch.else_if.replace.remove" ]
658,116
658,117
u117193815
python
p02853
# -*- coding: utf-8 -*- X, Y = map(int, input().split()) sum = 0 if(X == 1): sum = 300000 elif(X == 2): sum = 200000 elif(X == 3): sum = 10000 if(Y == 1): sum += 300000 elif(Y == 2): sum += 200000 elif(Y == 3): sum += 100000 if(X == 1 and Y == 1): sum += 400000 print(int(sum))
# -*- coding: utf-8 -*- X, Y = map(int, input().split()) sum = 0 if(X == 1): sum = 300000 elif(X == 2): sum = 200000 elif(X == 3): sum = 100000 if(Y == 1): sum += 300000 elif(Y == 2): sum += 200000 elif(Y == 3): sum += 100000 if(X == 1 and Y == 1): sum += 400000 print(sum)
[ "literal.number.integer.change", "assignment.value.change", "call.remove", "call.arguments.change" ]
658,121
658,122
u171115409
python
p02853
# -*- coding: utf-8 -*- X, Y = map(int, input().split()) sum = 0 if(X == 1): sum = 300000 elif(X == 2): sum = 200000 elif(X == 3): sum = 10000 if(Y == 1): sum += 300000 elif(Y == 2): sum += 200000 elif(Y == 3): sum += 100000 if(X == 1 and Y == 1): sum += 400000 print(sum)
# -*- coding: utf-8 -*- X, Y = map(int, input().split()) sum = 0 if(X == 1): sum = 300000 elif(X == 2): sum = 200000 elif(X == 3): sum = 100000 if(Y == 1): sum += 300000 elif(Y == 2): sum += 200000 elif(Y == 3): sum += 100000 if(X == 1 and Y == 1): sum += 400000 print(sum)
[ "literal.number.integer.change", "assignment.value.change" ]
658,123
658,122
u171115409
python
p02853
a,b = map(int,input().split()) if a+b==2: print(1000000) else: ans =0 if a<=3: ans+= (4-a)*100000 if b<=3: ans+= (4-a)*100000 print(ans)
a,b = map(int,input().split()) if a+b==2: print(1000000) else: ans =0 if a<=3: ans+= (4-a)*100000 if b<=3: ans+= (4-b)*100000 print(ans)
[ "identifier.change", "expression.operation.binary.change" ]
658,127
658,128
u115110170
python
p02853
X, Y = map(int, input().split()) ans = 0 k = [3, 2, 1] if X <= 3: ans += k[X-1] if Y <= 3: ans += k[X-1] if X == 1 and Y == 1: ans += 4 print(ans * 100000)
X, Y = map(int, input().split()) ans = 0 k = [3, 2, 1] if X <= 3: ans += k[X-1] if Y <= 3: ans += k[Y-1] if X == 1 and Y == 1: ans += 4 print(ans * 100000)
[ "identifier.change", "variable_access.subscript.index.change", "expression.operation.binary.change" ]
658,131
658,132
u552357043
python
p02853
x,y = map(int,input().split()) if x == 1 and y == 1:print(int(7e5)) elif 1<=x<=3 and 1<=y<=3: print(int((8-x-y)*1e5)) elif 1<=x<=3:print(int((4-x)*1e5)) elif 1<=y<=3:print(int((4-y)*1e5)) else:print(0)
x,y = map(int,input().split()) if x == 1 and y == 1:print(int(10e5)) elif 1<=x<=3 and 1<=y<=3: print(int((8-x-y)*1e5)) elif 1<=x<=3:print(int((4-x)*1e5)) elif 1<=y<=3:print(int((4-y)*1e5)) else:print(0)
[ "literal.number.float.change", "call.arguments.change", "io.output.change" ]
658,135
658,136
u580093517
python
p02853
s = 0 for i in map(int, input().split()): if i == 1: s+=300000 elif i ==2 : s+= 200000 elif i ==3 : s+= 100000 if s== 600000: s == 1000000 print(s)
s = 0 for i in map(int, input().split()): if i == 1: s+=300000 elif i ==2 : s+= 200000 elif i ==3 : s+= 100000 if s== 600000: s = 1000000 print(s)
[ "expression.operation.compare.replace.remove", "assignment.replace.add", "misc.typo" ]
658,139
658,140
u064027771
python
p02853
X,Y = map(int,input().split()) if X < 4: X = (4-X)*100000 else: X = 0 if Y < 4: Y = (4-Y)*100000 else: Y = 0 if X == 1 and Y == 1: print(X+Y+400000) else: print(X+Y)
X,Y = map(int,input().split()) if X < 4: X = (4-X)*100000 else: X = 0 if Y < 4: Y = (4-Y)*100000 else: Y = 0 if X == 300000 and Y == 300000: print(X+Y+400000) else: print(X+Y)
[ "literal.number.integer.change", "control_flow.branch.if.condition.change" ]
658,143
658,144
u503111914
python
p02853
h = list(map(int, input().split())) a = 0 for i in range(2): if h[i] << 4: a = a + 100000 * (4-h[i]) if h[0] == 1 and h[1] == 1: a = a + 400000 print(a)
h = list(map(int, input().split())) a = 0 for i in range(2): if h[i] <= 3: a = a + 100000 * (4-h[i]) if h[0] == 1 and h[1] == 1: a = a + 400000 print(a)
[ "control_flow.loop.for.condition.change" ]
658,149
658,150
u660245210
python
p02853
X,Y = map(int,input().split()) X_aaa=0 Y_aaa=0 if X ==1 and Y ==1: print(1000000) exit() elif X==1 : X_aaa+=300000 elif X==2 : X_aaa+=200000 elif X==3 : X_aaa+=100000 elif Y==1 : Y_aaa+=300000 elif Y==2 : Y_aaa+=200000 elif Y==3 : Y_aaa+=100000 print(X_aaa+Y_aaa)
X,Y = map(int,input().split()) X_aaa=0 Y_aaa=0 if X ==1 and Y ==1: print(1000000) exit() if X==1 : X_aaa+=300000 elif X==2 : X_aaa+=200000 elif X==3 : X_aaa+=100000 if Y==1 : Y_aaa+=300000 elif Y==2 : Y_aaa+=200000 elif Y==3 : Y_aaa+=100000 print(X_aaa+Y_aaa)
[ "control_flow.branch.if.replace.add", "control_flow.branch.else_if.replace.remove" ]
658,157
658,158
u024245528
python
p02853
X, Y = map(int, input().split()) a = 0 if X == 1: a += 300000 elif X == 2: a += 200000 elif X == 3: a += 10000 if Y == 1: a += 300000 elif Y == 2: a += 200000 elif Y == 3: a += 100000 if X == 1 and Y == 1: a += 400000 print(a)
X, Y = map(int, input().split()) a = 0 if X == 1: a += 300000 elif X == 2: a += 200000 elif X == 3: a += 100000 if Y == 1: a += 300000 elif Y == 2: a += 200000 elif Y == 3: a += 100000 if X == 1 and Y == 1: a += 400000 print(a)
[ "literal.number.integer.change" ]
658,166
658,167
u640123177
python
p02853
X, Y = map(int, input().split()) ans = 0 if X < 4: ans += (4 - X) * 10**5 if Y < 4: ans += (4 - X) * 10**5 if X == 1 and Y == 1: ans += 4 * 10**5 print(ans)
X, Y = map(int, input().split()) ans = 0 if X < 4: ans += (4 - X) * 10**5 if Y < 4: ans += (4 - Y) * 10**5 if X == 1 and Y == 1: ans += 4 * 10**5 print(ans)
[ "identifier.change", "expression.operation.binary.change" ]
658,170
658,171
u463858127
python
p02854
import sys input = sys.stdin.readline N=int(input()) A=list(map(int,input().split())) total = sum(A) total *= 2 mindif = 1e12 sub = 0 for i in range(N): sub += 2 * A[i] dif = abs(total//2-sub) if dif < mindif: mindif = dif else: break print(mindif)
import sys input = sys.stdin.readline N=int(input()) A=list(map(int,input().split())) total = sum(A) total *= 2 mindif = 1e12 sub = 0 for i in range(N): sub += 2 * A[i] dif = abs(total//2-sub) if dif < mindif: mindif = dif print(mindif)
[ "control_flow.break.remove" ]
658,178
658,179
u840037795
python
p02854
n = int(input()) l = list(map(int,input().split())) from itertools import accumulate tot=sum(l) ans=10**9+7 for i in list(accumulate(l)): if i <= tot//2: ans=min(ans, abs(tot-(i*2))) for i in list(accumulate(l[::-1])): if i <= tot//2: ans=min(ans, abs(tot--(i*2))) print(ans)
n = int(input()) l = list(map(int,input().split())) from itertools import accumulate tot=sum(l) ans=2020202020*100000 for i in list(accumulate(l)): if i <= tot//2: ans=min(ans, abs(tot-(i*2))) for i in list(accumulate(l[::-1])): if i <= tot//2: ans=min(ans, abs(tot-(i*2))) print(ans)
[ "expression.operation.binary.remove", "expression.operation.unary.arithmetic.remove", "call.arguments.change" ]
658,190
658,189
u680851063
python
p02854
from itertools import accumulate n = int(input()) a = list(map(int, input().split())) cumsum = list(accumulate(a)) total = cumsum[-1] ans = 10*20 for left in cumsum: right = total - left ans = min(ans, abs(left - right)) print(ans)
from itertools import accumulate n = int(input()) a = list(map(int, input().split())) cumsum = list(accumulate(a)) total = cumsum[-1] ans = 10**20 for left in cumsum: right = total - left ans = min(ans, abs(left - right)) print(ans)
[ "assignment.value.change", "expression.operation.binary.change" ]
658,191
658,192
u687574784
python
p02854
n=int(input()) a=list(map(int,input().split())) harf=sum(a)//2 l,r,i=0,a[0],0 while r<harf: i+=1 l=r r+=a[i] print(min(harf-l,r-harf))
n=int(input()) a=list(map(int,input().split())) harf=sum(a)/2 l,r,i=0,a[0],0 while r<harf: i+=1 l=r r+=a[i] print(int(min(harf-l,r-harf)*2))
[ "expression.operator.arithmetic.change", "assignment.value.change", "expression.operation.binary.change", "call.add", "call.arguments.change" ]
658,206
658,207
u131881594
python
p02854
import sys import collections import bisect def main(): n = int(input()) AList = list(map(int, input().split())) ASum = sum(a) c = 0 for i in range(n): c += AList[i] if c >= ASum / 2: k = i break ans = min(2 * c - ASum, ASum - 2 * c + 2 * AList[k]) print(ans) if __name__ == '__main__': main()
import sys import collections import bisect def main(): n = int(input()) AList = list(map(int, input().split())) ASum = sum(AList) c = 0 for i in range(n): c += AList[i] if c >= ASum / 2: k = i break ans = min(2 * c - ASum, ASum - 2 * c + 2 * AList[k]) print(ans) if __name__ == '__main__': main()
[ "assignment.value.change", "identifier.change", "call.arguments.change" ]
658,223
658,224
u395202850
python
p02854
n=int(input()) A=list(map(int,input().split())) m=float('INF') sa=[] for i,a in enumerate(A): sa.append(sa[i]+ai) for i in range(n+1): ans=min(ans,abs(sa[i]-(sa[-1]-sa[i]))) print(ans)
n=int(input()) A=list(map(int,input().split())) ans=float('INF') sa=[0] for i,a in enumerate(A): sa.append(sa[i]+a) for i in range(n+1): ans=min(ans,abs(sa[i]-(sa[-1]-sa[i]))) print(ans)
[ "assignment.variable.change", "identifier.change", "call.arguments.change", "expression.operation.binary.change" ]
658,225
658,226
u694665829
python
p02854
n = int(input()) a = list(map(int, input().split())) x = n//2 if sum(a)/2 == sum(a[:(n//2)]): print(0) elif sum(a)/2 >= sum(a[:(n//2)]): while sum(a)/2 >= sum(a[:x]): x += 1 print(min(abs(2*sum(a[:x])-sum(a)), abs(2*sum(a[:x-1])-sum(a)))) else: while sum(a)/2 <= sum(a[:x]): x -= 1 print(min(abs(2*sum(a[:x])-sum(a)), abs(2*sum(a[:x-1])-sum(a))))
n = int(input()) a = list(map(int, input().split())) x = n//2 if sum(a)/2 == sum(a[:(n//2)]): print(0) elif sum(a)/2 >= sum(a[:(n//2)]): while sum(a)/2 >= sum(a[:x]): x += 1 print(min(abs(2*sum(a[:x])-sum(a)), abs(2*sum(a[:x-1])-sum(a)))) else: while sum(a)/2 <= sum(a[:x]): x -= 1 print(min(abs(2*sum(a[:x])-sum(a)), abs(2*sum(a[:x+1])-sum(a))))
[ "misc.opposites", "expression.operator.arithmetic.change", "call.arguments.change", "expression.operation.binary.change" ]
658,259
658,260
u791110052
python
p02854
import sys import math import itertools import bisect from copy import copy from collections import deque,Counter from decimal import Decimal def s(): return input() def i(): return int(input()) def S(): return input().split() def I(): return map(int,input().split()) def L(): return list(input().split()) def l(): return list(map(int,input().split())) def lcm(a,b): return a*b//math.gcd(a,b) sys.setrecursionlimit(10 ** 9) mod = 10**9+7 N = i() A = l() ruiseki = [0]+list(itertools.accumulate(A)) i = bisect.bisect_left(ruiseki,sum(A)/2) print(i) print(min(abs(sum(A[:i])-sum(A[i:])),abs(sum(A[:i-1])-sum(A[i-1:]))))
import sys import math import itertools import bisect from copy import copy from collections import deque,Counter from decimal import Decimal def s(): return input() def i(): return int(input()) def S(): return input().split() def I(): return map(int,input().split()) def L(): return list(input().split()) def l(): return list(map(int,input().split())) def lcm(a,b): return a*b//math.gcd(a,b) sys.setrecursionlimit(10 ** 9) mod = 10**9+7 N = i() A = l() ruiseki = [0]+list(itertools.accumulate(A)) i = bisect.bisect_left(ruiseki,sum(A)/2) print(min(abs(sum(A[:i])-sum(A[i:])),abs(sum(A[:i-1])-sum(A[i-1:]))))
[ "call.remove" ]
658,269
658,270
u514118270
python
p02854
n=int(input()) a=list(map(int,input().split())) temp=sum(a) ans=0 t=999999999 tsum=0 ta=0 for i in range(n): tsum=tsum+a[i] if abs(tsum-temp/2)<t: t=abs(tsum-temp/2) ta=tsum print(int(ta)*2-temp)
n=int(input()) a=list(map(int,input().split())) temp=sum(a) ans=0 t=9999999999999999 tsum=0 ta=0 for i in range(n): tsum=tsum+a[i] if abs(tsum-temp/2)<t: t=abs(tsum-temp/2) ta=tsum print(abs(int(ta)*2-temp))
[ "literal.number.integer.change", "assignment.value.change", "call.add", "call.arguments.change" ]
658,275
658,274
u629350026
python
p02854
n=int(input()) a=list(map(int,input().split())) sm=sum(a) x=[a[0]] y=[sm-a[n-1]] for i in range(1,n): x.append(x[i-1]+a[i]) y.append(sm-x[i]) min=9999999999 for (p,q) in zip(x,y): sa=abs(p-q) if sa<min: min=sa print(min)
n=int(input()) a=list(map(int,input().split())) sm=sum(a) x=[a[0]] y=[sm-a[0]] for i in range(1,n): x.append(x[i-1]+a[i]) y.append(sm-x[i]) min=9999999999 for (p,q) in zip(x,y): sa=abs(p-q) if sa<min: min=sa print(min)
[ "assignment.value.change", "identifier.replace.remove", "literal.replace.add", "variable_access.subscript.index.change", "expression.operation.binary.change", "expression.operation.binary.remove" ]
658,278
658,279
u168416324
python
p02854
N = int(input()) A = list(map(int,input().split())) almost_half = sum(A)/2 former = 0 for n in range(N): former += A[n] if former == almost_half: print(0) break if former > almost_half: if n == 0: print(abs(A[0]-sum(A[1:]))) break elif n == N-1: print(abs(A[n]-sum(A[:n]))) break else: print(min(abs(sum(A[n:])-sum(A[:n])),abs(sum(A[n-1:])-sum(A[:n-1])))) break
N = int(input()) A = list(map(int,input().split())) almost_half = sum(A)/2 former = 0 for n in range(N): former += A[n] if former == almost_half: print(0) break if former > almost_half: if n == 0: #print("case01",n,former) print(abs(A[0]-sum(A[1:]))) break elif n == N-1: #print("case02",n,former) print(abs(A[n]-sum(A[:n]))) break else: #print("case03",n,former) #print(abs(sum(A[n:])-sum(A[:n])),abs(sum(A[n+1:])-sum(A[:n+1]))) print(min(abs(sum(A[n:])-sum(A[:n])),abs(sum(A[n+1:])-sum(A[:n+1])))) break
[ "misc.opposites", "expression.operator.arithmetic.change", "variable_access.subscript.index.change", "call.arguments.change", "expression.operation.binary.change" ]
658,287
658,288
u760961723
python
p02854
n = int(input()) a = [int(i) for i in input().split()] b = [] sum_a = sum(a) cum = 0 for i in a: cum += i b.append(sum_a - cum) print(min(b))
n = int(input()) a = [int(i) for i in input().split()] b = [] sum_a = sum(a) cum = 0 for i in a: cum += i b.append(abs(sum_a - cum * 2)) print(min(b))
[ "call.add", "call.arguments.add" ]
658,306
658,307
u091051505
python
p02854
import numpy as np N = int(input()) A = np.array(list(map(int, input().split()))) A_cs = A.cumsum() A_cs = A_cs - A_cs[-1]/2 div = np.abs(A_cs).argmin() print(abs(A[:div+1].sum - A[div+1:].sum()))
import numpy as np N = int(input()) A = np.array(list(map(int, input().split()))) A_cs = A.cumsum() A_cs = A_cs - A_cs[-1]/2 div = np.abs(A_cs).argmin() print(abs(A[:div+1].sum() - A[div+1:].sum()))
[ "call.add" ]
658,333
658,334
u860002137
python
p02854
import sys input = sys.stdin.readline def main(): n = int(input()) stick = list(map(int, input().split())) total = sum(stick) mid = total // 2 cum = 0 midi = 0 for i, block in enumerate(stick): cum += block if cum >= mid: midi = i break l1 = cum r1 = total - l1 diff1 = abs(l1 - r1) l2 = l1 + stick[midi] r2 = r1 - stick[midi] diff2 = abs(l2 - r2) print(min(diff1, diff2)) main()
import sys input = sys.stdin.readline def main(): n = int(input()) stick = list(map(int, input().split())) total = sum(stick) mid = total // 2 cum = 0 midi = 0 for i, block in enumerate(stick): cum += block if cum >= mid: midi = i break l1 = cum r1 = total - l1 diff1 = abs(l1 - r1) l2 = l1 - stick[midi] r2 = r1 + stick[midi] diff2 = abs(l2 - r2) print(min(diff1, diff2)) main()
[ "misc.opposites", "expression.operator.arithmetic.change", "assignment.value.change", "expression.operation.binary.change" ]
658,336
658,337
u560867850
python
p02854
# -*- coding: utf-8 -*- import sys import fractions import copy import bisect import math import numpy as np import itertools from itertools import combinations_with_replacement #import math#数学的計算はこれでいける。普通に0.5乗しても計算可能 #w=input() from operator import itemgetter from sys import stdin #input = sys.stdin.readline#こっちの方が入力が早いが使える時に使っていこう from operator import mul from functools import reduce from collections import Counter #from collections import deque #input = stdin.readline j=0 k=0 n=3 r=1 a=[0] #n=int(input()) #r=int(input()) #print(M) #A=int(input()) #B=int(input()) #print(N) "1行1つの整数を入力を取得し、整数と取得する" #number_list=list(map(int, input().split(" ")))#数字の時 #print(number_list) "12 21 332 とか入力する時に使う" "1行に複数の整数の入力を取得し、整数として扱う" ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' #メモ for i in number_list:#こっちの方がrage使うより早いらしい print(number_list[i-1])# ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ''' x=[] y=[] for i in range(N): x1, y1=[int(i) for i in input().split()] x.append(x1) y.append(y1) print(x) print(y) "複数行に2数値を入力する形式 x座標とy座標を入力するイメージ" ''' ''' mixlist=[] for i in range(N): a,b=input().split() mixlist.append((int(a),b)) print(mixlist) "複数行にintとstrを複合して入力するやつ,今回はリスト一つで処理している" ''' ''' #array=[input().split()for i in range(N)] #print(type(array[0][0])) #print(array) "正方行列にstr型の値を入力" ''' #brray=[list(map(int, input().split(" ")))for i in range(N)] #print(type(brray[0][0])) #print(brray) ''' 入力 1 2 4 5 7 8 出力結果 [[1, 2], [4, 5], [7, 8]] ''' "列数に関して自由度の高いint型の値を入力するタイプの行列" #以下に別解を記載 #N, M = [int(i) for i in input().split()] ''' table = [[int(i) for i in input().split()] for m in range(m)] print(type(N)) print(N) print(type(M)) print(M) print(type(table)) print(table) ''' #s=input() #a=[int(i) for i in s] #print(a[0]) #print([a]) #単数値.桁ごとに分割したい.入力と出力は以下の通り #イメージとして1桁ごとにリストに値を入れているかんじ #intを取ると文字列分解に使える ''' 入力 1234 出力 1 [[1, 2, 3, 4]] ''' ''' word_list= input().split(" ") print(word_list[0]) "連続文字列の入力" "qw er ty とかの入力に使う" "入力すると空白で区切ったところでlistの番号が与えられる" ''' ''' A, B, C=stdin.readline().rstrip().split()#str style 何個でもいけることが多い print(A) "リストではなく独立したstr型を入れるなら以下のやり方でOK" ''' #a= stdin.readline().rstrip() #print(a.upper()) "aという変数に入っているものを大文字にして出力" #a,b=map(int, input().split()) #int style 複数数値入力 「A B」みたいなスペース空いた入力のとき #なんかうまく入力されるけど #a=[[int(i) for i in 1.strip()]for 1 in sys.stdin] #a = [[int(c) for c in l.strip()] for l in sys.stdin]] #print(a) #複数行の数値を入力して正方行列を作成 ############################################################################################## ############################################################################################## #under this line explains example calculation ''' コンビネーションの組み合わせの中身を出力する形式 for i in itertools.combinations(brray, 2) combinationsをpermutationsにすれば順列になる 今回なら(abc133B) 入力 1 2 5 5 -2 8 出力 [[1, 2], [5, 5], [-2, 8]] もちろん一次元リストでも使えるし 何よりiもリストのように使えるので便利 ''' #nCr combination ''' def cmb(n,r): #When n < r , this function isn't valid r= min(n-r,r) #print(n,r) if r == 0: return 1 over = reduce(mul, range(n, n-r, -1)) #flochart mul(n,n-1)=x #next mul(x,n-2)........(n-r+1,n-r) #mul read a,b and returns a*b under = reduce(mul, range(1, r+1)) #print(over, under) #reduce is applied mul(1,2)=2 #next mul(2,3)=6 #next mul(6,4)=4.........last(r!,r+1)=r+1! return over // under #// is integer divide #calc example 5C2 #over=5*4*3 #under=3*2*1 a = cmb(n, r) #print(a) ''' ''' import itertools from itertools import combinations_with_replacement combinationについて 以下の違いを意識しよう combinations() p, r 長さrのタプル列、ソートされた順で重複なし combinations_with_replacement() p, r 長さrのタプル列、ソートされた順で重複あり 使用例             出力   combinations('ABCD', 2)            AB AC AD BC BD CD combinations_with_replacement('ABCD', 2)   AA AB AC AD BB BC BD CC CD DD ''' ''' #集計 #example #a=[2,2,2,3,4,3,1,2,1,3,1,2,1,2,2,1,2,1] #a=Counter(a) for i in a.most_common(n):print(i) #most_common()メソッドは、出現回数が多い要素順にCounterオブジェクトを並び替えます。 #引数にint型の数字nを設定した場合は、出現回数が高い上位n個の要素を返します。 #何も設定しなければ、コンテナ型にあるすべての要素を出現回数の順番に並び替えたタプル型オブジェクトを返します。 #out put #(2, 8) #(1, 6) #(3, 3) #(4, 1) ''' #二部探索(binary search) #A = [1, 2, 3, 3, 3, 4, 4, 6, 6, 6, 6] #print(A) #index = bisect.bisect_left(A, 5) # 7 最も左(前)の挿入箇所が返ってきている #A.insert(index, 5) #print(index) #print(A) ''' bisect.bisect_left(a, x, lo=0, h=len(a)) 引数 a: ソート済みリスト x: 挿入したい値 lo: 探索範囲の下限 hi: 探索範囲の上限 (lo, hiはスライスと同様の指定方法) bisect_leftはソートされたリストaに対して順序を保ったままxを挿入できる箇所を探索します。leftが示す通り、aにすでにxが存在している場合は、挿入箇所は既存のxよりも左側になります。また、lo, hiを指定することで探索範囲を絞り込むことも可能です。デフォルトはaの全体が探索対象です。 ''' ''' 素数の判定 ''' def is_prime(n): if n == 1: return False for k in range(2, int(np.sqrt(n)) + 1): #sqrt(n)+1以上は考えて約数はないので却下 if n % k == 0: return False #割り切れたらFalse return True ''' npのmaxとmaximumの違い xs = np.array([1, -2, 3]) np.max(xs, 0) この出力は3となります.[1, -2, 3]と0の4つの数字のうち,最も大きい値を出力します. 一方で,[max(1, 0), max(-2, 0), max(3, 0)]を出力したい時があります. その時は,numpyのmaximum関数を用います. xs = np.array([1, -2, 3]) np.maximum(xs, 0) # [1, 0, 3] ''' ######################################################################## ######################################################################## #b2=a[:] #1次元のときはコピーはこれで良い #print(b2) #a= [[0]*3 for i in range(5)] #2次元配列はこう準備、[[0]*3]*5だとだめ #b3=copy.deepcopy(a) #2次元配列はこうコピーする #print(b3) def main(): w=1 j=0 k=0 dlen=0 dsum=0 ota=0 n=int(input()) al=list(map(int, input().split(" "))) dlen=sum(al) for i in range(n): dsum=dsum+al[i] if dsum*2 > dlen: ota=dsum-al[i] break #if dlen//2==0:#2で割り切れる時 # print(abs(dsum-dlen/2)) # sys.exit() #print(2*dsum,2*ota,dlen) print(min((2*dsum-dlen),(2*ota-dlen))) #r=int(input()) #dp= [[0]*3 for i in range(5)]#列 行 #dp用の0の入ったやつ #dp= [[0]*(w+1) for i in range(n+1)]#0からwまでのw+1回計算するから #print(dp)#初期条件が入る分計算回数+1列分必要(この場合は判断すべきものの数) DP = np.zeros(w+1, dtype=int)#これでも一次元リストが作れる exdp=np.zeros((3,4)) # 3×4の2次元配列を生成。2次元ならこう #dtypeは指定しないとfloatになる #for i in range(n):#ちょっとした入力に便利 # a, b = map(int, input().split()) #dp[i][0] += [a] #これだとintとlistをつなぐことになって不適 # dp[i] += [a] # dp[i] += [b] #これはうまくいく #やり方はいろいろあるということ #print(dp) "1行1つの整数を入力を取得し、整数と取得する" #number_list=list(map(int, input().split(" ")))#数字の時 #print(number_list) "12 21 332 とか入力する時に使う" "1行に複数の整数の入力を取得し、整数として扱う" #brray=[list(map(int, input().split(" ")))for i in range(N) #print(brray) #s=input() #a=[int(i) for i in s]#int取るとstrでも行ける #print(a) ''' 入力 1234 出力 [1, 2, 3, 4] ''' pin_l=["x" for i in range(10)]#内包表記に慣れろ #print(pin_l) ls = ["a", "b", "c", "d", "e"] #print(ls[2:5]) #スライスでの取得 #print(ls[:-3]) #一番左端から右から3番目より左まで取得 #print(ls[:4:2]) #スライスで1個飛ばしで取得 #ないときは左端スタート #始点のインデックス番号 : 終点のインデックス番号 : スキップする数+1 #print(ls[::2]) ''' lsというリストの場合に、1つ飛びの値を取得したい場合には ls[::2] のようにします。こうすると、 ["a", "c", "d"]と出力される ''' if __name__ == "__main__": main()
# -*- coding: utf-8 -*- import sys import fractions import copy import bisect import math import numpy as np import itertools from itertools import combinations_with_replacement #import math#数学的計算はこれでいける。普通に0.5乗しても計算可能 #w=input() from operator import itemgetter from sys import stdin #input = sys.stdin.readline#こっちの方が入力が早いが使える時に使っていこう from operator import mul from functools import reduce from collections import Counter #from collections import deque #input = stdin.readline j=0 k=0 n=3 r=1 a=[0] #n=int(input()) #r=int(input()) #print(M) #A=int(input()) #B=int(input()) #print(N) "1行1つの整数を入力を取得し、整数と取得する" #number_list=list(map(int, input().split(" ")))#数字の時 #print(number_list) "12 21 332 とか入力する時に使う" "1行に複数の整数の入力を取得し、整数として扱う" ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' #メモ for i in number_list:#こっちの方がrage使うより早いらしい print(number_list[i-1])# ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ''' x=[] y=[] for i in range(N): x1, y1=[int(i) for i in input().split()] x.append(x1) y.append(y1) print(x) print(y) "複数行に2数値を入力する形式 x座標とy座標を入力するイメージ" ''' ''' mixlist=[] for i in range(N): a,b=input().split() mixlist.append((int(a),b)) print(mixlist) "複数行にintとstrを複合して入力するやつ,今回はリスト一つで処理している" ''' ''' #array=[input().split()for i in range(N)] #print(type(array[0][0])) #print(array) "正方行列にstr型の値を入力" ''' #brray=[list(map(int, input().split(" ")))for i in range(N)] #print(type(brray[0][0])) #print(brray) ''' 入力 1 2 4 5 7 8 出力結果 [[1, 2], [4, 5], [7, 8]] ''' "列数に関して自由度の高いint型の値を入力するタイプの行列" #以下に別解を記載 #N, M = [int(i) for i in input().split()] ''' table = [[int(i) for i in input().split()] for m in range(m)] print(type(N)) print(N) print(type(M)) print(M) print(type(table)) print(table) ''' #s=input() #a=[int(i) for i in s] #print(a[0]) #print([a]) #単数値.桁ごとに分割したい.入力と出力は以下の通り #イメージとして1桁ごとにリストに値を入れているかんじ #intを取ると文字列分解に使える ''' 入力 1234 出力 1 [[1, 2, 3, 4]] ''' ''' word_list= input().split(" ") print(word_list[0]) "連続文字列の入力" "qw er ty とかの入力に使う" "入力すると空白で区切ったところでlistの番号が与えられる" ''' ''' A, B, C=stdin.readline().rstrip().split()#str style 何個でもいけることが多い print(A) "リストではなく独立したstr型を入れるなら以下のやり方でOK" ''' #a= stdin.readline().rstrip() #print(a.upper()) "aという変数に入っているものを大文字にして出力" #a,b=map(int, input().split()) #int style 複数数値入力 「A B」みたいなスペース空いた入力のとき #なんかうまく入力されるけど #a=[[int(i) for i in 1.strip()]for 1 in sys.stdin] #a = [[int(c) for c in l.strip()] for l in sys.stdin]] #print(a) #複数行の数値を入力して正方行列を作成 ############################################################################################## ############################################################################################## #under this line explains example calculation ''' コンビネーションの組み合わせの中身を出力する形式 for i in itertools.combinations(brray, 2) combinationsをpermutationsにすれば順列になる 今回なら(abc133B) 入力 1 2 5 5 -2 8 出力 [[1, 2], [5, 5], [-2, 8]] もちろん一次元リストでも使えるし 何よりiもリストのように使えるので便利 ''' #nCr combination ''' def cmb(n,r): #When n < r , this function isn't valid r= min(n-r,r) #print(n,r) if r == 0: return 1 over = reduce(mul, range(n, n-r, -1)) #flochart mul(n,n-1)=x #next mul(x,n-2)........(n-r+1,n-r) #mul read a,b and returns a*b under = reduce(mul, range(1, r+1)) #print(over, under) #reduce is applied mul(1,2)=2 #next mul(2,3)=6 #next mul(6,4)=4.........last(r!,r+1)=r+1! return over // under #// is integer divide #calc example 5C2 #over=5*4*3 #under=3*2*1 a = cmb(n, r) #print(a) ''' ''' import itertools from itertools import combinations_with_replacement combinationについて 以下の違いを意識しよう combinations() p, r 長さrのタプル列、ソートされた順で重複なし combinations_with_replacement() p, r 長さrのタプル列、ソートされた順で重複あり 使用例             出力   combinations('ABCD', 2)            AB AC AD BC BD CD combinations_with_replacement('ABCD', 2)   AA AB AC AD BB BC BD CC CD DD ''' ''' #集計 #example #a=[2,2,2,3,4,3,1,2,1,3,1,2,1,2,2,1,2,1] #a=Counter(a) for i in a.most_common(n):print(i) #most_common()メソッドは、出現回数が多い要素順にCounterオブジェクトを並び替えます。 #引数にint型の数字nを設定した場合は、出現回数が高い上位n個の要素を返します。 #何も設定しなければ、コンテナ型にあるすべての要素を出現回数の順番に並び替えたタプル型オブジェクトを返します。 #out put #(2, 8) #(1, 6) #(3, 3) #(4, 1) ''' #二部探索(binary search) #A = [1, 2, 3, 3, 3, 4, 4, 6, 6, 6, 6] #print(A) #index = bisect.bisect_left(A, 5) # 7 最も左(前)の挿入箇所が返ってきている #A.insert(index, 5) #print(index) #print(A) ''' bisect.bisect_left(a, x, lo=0, h=len(a)) 引数 a: ソート済みリスト x: 挿入したい値 lo: 探索範囲の下限 hi: 探索範囲の上限 (lo, hiはスライスと同様の指定方法) bisect_leftはソートされたリストaに対して順序を保ったままxを挿入できる箇所を探索します。leftが示す通り、aにすでにxが存在している場合は、挿入箇所は既存のxよりも左側になります。また、lo, hiを指定することで探索範囲を絞り込むことも可能です。デフォルトはaの全体が探索対象です。 ''' ''' 素数の判定 ''' def is_prime(n): if n == 1: return False for k in range(2, int(np.sqrt(n)) + 1): #sqrt(n)+1以上は考えて約数はないので却下 if n % k == 0: return False #割り切れたらFalse return True ''' npのmaxとmaximumの違い xs = np.array([1, -2, 3]) np.max(xs, 0) この出力は3となります.[1, -2, 3]と0の4つの数字のうち,最も大きい値を出力します. 一方で,[max(1, 0), max(-2, 0), max(3, 0)]を出力したい時があります. その時は,numpyのmaximum関数を用います. xs = np.array([1, -2, 3]) np.maximum(xs, 0) # [1, 0, 3] ''' ######################################################################## ######################################################################## #b2=a[:] #1次元のときはコピーはこれで良い #print(b2) #a= [[0]*3 for i in range(5)] #2次元配列はこう準備、[[0]*3]*5だとだめ #b3=copy.deepcopy(a) #2次元配列はこうコピーする #print(b3) def main(): w=1 j=0 k=0 dlen=0 dsum=0 ota=0 n=int(input()) al=list(map(int, input().split(" "))) dlen=sum(al) for i in range(n): dsum=dsum+al[i] if dsum*2 > dlen: ota=dsum-al[i] break #if dlen//2==0:#2で割り切れる時 # print(abs(dsum-dlen/2)) # sys.exit() #print(2*dsum,2*ota,dlen) print(min(abs(2*dsum-dlen),abs(2*ota-dlen))) #r=int(input()) #dp= [[0]*3 for i in range(5)]#列 行 #dp用の0の入ったやつ #dp= [[0]*(w+1) for i in range(n+1)]#0からwまでのw+1回計算するから #print(dp)#初期条件が入る分計算回数+1列分必要(この場合は判断すべきものの数) DP = np.zeros(w+1, dtype=int)#これでも一次元リストが作れる exdp=np.zeros((3,4)) # 3×4の2次元配列を生成。2次元ならこう #dtypeは指定しないとfloatになる #for i in range(n):#ちょっとした入力に便利 # a, b = map(int, input().split()) #dp[i][0] += [a] #これだとintとlistをつなぐことになって不適 # dp[i] += [a] # dp[i] += [b] #これはうまくいく #やり方はいろいろあるということ #print(dp) "1行1つの整数を入力を取得し、整数と取得する" #number_list=list(map(int, input().split(" ")))#数字の時 #print(number_list) "12 21 332 とか入力する時に使う" "1行に複数の整数の入力を取得し、整数として扱う" #brray=[list(map(int, input().split(" ")))for i in range(N) #print(brray) #s=input() #a=[int(i) for i in s]#int取るとstrでも行ける #print(a) ''' 入力 1234 出力 [1, 2, 3, 4] ''' pin_l=["x" for i in range(10)]#内包表記に慣れろ #print(pin_l) ls = ["a", "b", "c", "d", "e"] #print(ls[2:5]) #スライスでの取得 #print(ls[:-3]) #一番左端から右から3番目より左まで取得 #print(ls[:4:2]) #スライスで1個飛ばしで取得 #ないときは左端スタート #始点のインデックス番号 : 終点のインデックス番号 : スキップする数+1 #print(ls[::2]) ''' lsというリストの場合に、1つ飛びの値を取得したい場合には ls[::2] のようにします。こうすると、 ["a", "c", "d"]と出力される ''' if __name__ == "__main__": main()
[]
658,360
658,361
u007886915
python
p02854
N = int(input()) A = list(map(int, input().split())) tmp = [0 for i in range(N+1)] length = 0 for i in range(N): tmp[i+1] = tmp[i] + A[i] length += A[i] ans = 0 for i in range(1, N+1): ans = min(ans, abs((length - tmp[i]) - tmp[i])) print(ans)
N = int(input()) A = list(map(int, input().split())) tmp = [0 for i in range(N+1)] length = 0 for i in range(N): tmp[i+1] = tmp[i] + A[i] length += A[i] ans = 10 ** 10 for i in range(1, N+1): ans = min(ans, abs((length - tmp[i]) - tmp[i])) print(ans)
[ "literal.number.integer.change", "assignment.value.change" ]
658,381
658,382
u411858517
python
p02854
n=int(input()) l=list(map(int,input().split())) count=0 suml=sum(l) i=0 while count<suml/2: count+=l[i] i+=1 k=suml/2 a=l[i] if count==k: print(0) else: print(int(2*(min(count-k,a-count+k))))
n=int(input()) l=list(map(int,input().split())) count=0 suml=sum(l) i=0 while count<suml/2: count+=l[i] i+=1 k=suml/2 a=l[i-1] if count==k: print(0) else: print(int(2*(min(count-k,a-count+k))))
[ "assignment.change" ]
658,387
658,388
u272525952
python
p02854
n = int(input()) a = list(map(int, input().split())) for i in range(1, n): a[i] += a[i - 1] ans = n for x in a[:n-1]: ans = min(ans, abs(a[n-1] - 2 * x)) print(ans)
n = int(input()) a = list(map(int, input().split())) for i in range(1, n): a[i] += a[i - 1] ans = a[n-1] for x in a[:n-1]: ans = min(ans, abs(a[n-1] - 2 * x)) print(ans)
[]
658,389
658,390
u706786134
python
p02854
N=int(input()) A=list(map(int,input().split())) s=ans=sum(A) k=0 for i in range(N-1): k+=A[i] ans=min(ans,abs(s-2*k)) print(k,ans) print(ans)
N=int(input()) A=list(map(int,input().split())) s=ans=sum(A) k=0 for i in range(N-1): k+=A[i] ans=min(ans,abs(s-2*k)) print(ans)
[ "call.remove" ]
658,438
658,439
u539281377
python
p02854
import numpy as np import bisect n = int(input()) A = list(map(int,input().split())) cs = np.cumsum(A).tolist() mid = sum(A)//2 idx = bisect.bisect_left(cs, mid) ans = float('inf') for i in range(max(1, idx-1), min(idx+2, n)): x = A[:i] y = A[i:] print(x,y) sum_x = sum(x) sum_y = sum(y) ans = min(ans, abs(sum_x - sum_y)) print(ans)
import numpy as np import bisect n = int(input()) A = list(map(int,input().split())) cs = np.cumsum(A).tolist() mid = sum(A)//2 idx = bisect.bisect_left(cs, mid) ans = float('inf') for i in range(max(1, idx-1), min(idx+2, n)): x = A[:i] y = A[i:] sum_x = sum(x) sum_y = sum(y) ans = min(ans, abs(sum_x - sum_y)) print(ans)
[ "call.remove" ]
658,440
658,441
u672475305
python
p02854
n = int(input()) A = list(map(int, input().split())) ca = [0] for i in range(n): ca.append(A[i]+ca[i]) print(ca) ans = 2020202020 for i in range(n): ans = min(ans, abs(ca[i]-(ca[-1]-ca[i]))) print(ans)
n = int(input()) A = list(map(int, input().split())) ca = [0] for i in range(n): ca.append(A[i]+ca[i]) ans = 2020202020 for i in range(n): ans = min(ans, abs(ca[i]-(ca[-1]-ca[i]))) print(ans)
[ "call.remove" ]
658,442
658,443
u189487046
python
p02854
def main(): import sys import bisect n = int(input()) a = list(map(int, sys.stdin.readline().split())) b = list(accumulate(a)) l = b[-1] i = bisect.bisect(b, l // 2) ans = min(abs(l - 2 * b[i - 1]), abs(l - 2 * b[i])) print(ans) if __name__ == '__main__': main()
def main(): import sys import bisect from itertools import accumulate n = int(input()) a = list(map(int, sys.stdin.readline().split())) b = list(accumulate(a)) l = b[-1] i = bisect.bisect(b, l // 2) ans = min(abs(l - 2 * b[i - 1]), abs(l - 2 * b[i])) print(ans) if __name__ == '__main__': main()
[]
658,450
658,451
u127499732
python
p02854
def main(): import sys import bisect from itertools import accumulate n = int(input()) a = list(map(int, sys.stdin.readline().split())) b = list(accumulate(a)) l = b[-1] i = bisect.bisect_left(b, l // 2) ans = min(abs(l - 2 * b[i]), abs(l - 2 * b[i + 1])) print(ans) if __name__ == '__main__': main()
def main(): import sys import bisect from itertools import accumulate n = int(input()) a = list(map(int, sys.stdin.readline().split())) b = list(accumulate(a)) l = b[-1] i = bisect.bisect(b, l // 2) ans = min(abs(l - 2 * b[i - 1]), abs(l - 2 * b[i])) print(ans) if __name__ == '__main__': main()
[ "assignment.value.change", "identifier.change", "expression.operation.binary.remove" ]
658,452
658,451
u127499732
python
p02854
# Problem B - Iron Bar cutting # input process N = int(input()) a_list = list(map(int, input().split())) # initialization min_cost = 10*18 left_sum = 0 right_sum = sum(a_list) # count process cumulative sum for i in range(N-1): left_sum += a_list[i] right_sum -= a_list[i] distance = abs(left_sum - right_sum) min_cost = min(min_cost, distance) # output process print(min_cost)
# Problem B - Iron Bar cutting # input process N = int(input()) a_list = list(map(int, input().split())) # initialization min_cost = 10**18 left_sum = 0 right_sum = sum(a_list) # count process cumulative sum for i in range(N-1): left_sum += a_list[i] right_sum -= a_list[i] distance = abs(left_sum - right_sum) min_cost = min(min_cost, distance) # output process print(min_cost)
[ "assignment.value.change", "expression.operation.binary.change" ]
658,459
658,460
u368249389
python