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
9 values
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*s...
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*s...
[ "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(): retur...
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(): retur...
[ "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])))...
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: ...
[ "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 = c...
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 = c...
[ "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#こっちの方が入...
# -*- 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#こっちの方が入...
[]
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 = mi...
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_...
[ "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__ ==...
[]
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...
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__ ==...
[ "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_...
# 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...
[ "assignment.value.change", "expression.operation.binary.change" ]
658,459
658,460
u368249389
python
p02854
# サンプル1はべつに3*2=6じゃなくても4*2=8([1 3 4][2 2 4])や5*1=10([1 4 5])も同じコストで実現できることがわかる # つまり総和に近い偶数を目指す n = int(input()) arr = list(map(int, input().split())) s = sum(arr) tmp = arr[0] ans = 10**10 e = -1 for i in range(1, n): # 超えないギリギリ if tmp + arr[i] <= s // 2: tmp += arr[i] e = i else: br...
# サンプル1はべつに3*2=6じゃなくても4*2=8([1 3 4][2 2 4])や5*1=10([1 4 5])も同じコストで実現できることがわかる # つまり総和に近い偶数を目指す n = int(input()) arr = list(map(int, input().split())) s = sum(arr) tmp = arr[0] ans = 10**10 e = -1 for i in range(1, n): # 超えないギリギリ if tmp + arr[i] <= s // 2: tmp += arr[i] e = i else: br...
[ "assignment.add" ]
658,464
658,465
u445624660
python
p02854
import math from collections import deque def main(): n = int(input()) a = [int(t)for t in input().split()] a_rev = a[::-1] cusum = [a[0]] rcusum = [a_rev[0]] for i in range(1,n): cusum.append(cusum[i-1]+a[i]) rcusum.append(rcusum[i-1]+a[i]) rcusum = rcusum[::-1] ...
import math from collections import deque def main(): n = int(input()) a = [int(t)for t in input().split()] a_rev = a[::-1] cusum = [a[0]] rcusum = [a_rev[0]] for i in range(1,n): cusum.append(cusum[i-1]+a[i]) rcusum.append(rcusum[i-1]+a_rev[i]) rcusum = rcusum[::-1] ...
[ "identifier.change", "call.arguments.change", "expression.operation.binary.change", "call.arguments.add" ]
658,475
658,476
u711238850
python
p02854
n = int(input()) a = [int(i) for i in input().split()] len_f = sum(a) sum_a = 0 min = 2020202021 for i in range(1,len(a)): sum_a += a[i] len_f -= a[i] if min > abs(sum_a - len_f): min = abs(sum_a - len_f) print(min)
n = int(input()) a = [int(i) for i in input().split()] len_f = sum(a) sum_a = 0 min = 2020202021 for i in range(n): sum_a += a[i] len_f -= a[i] if min > abs(sum_a - len_f): min = abs(sum_a - len_f) print(min)
[ "identifier.replace.add", "literal.replace.remove", "call.arguments.change", "control_flow.loop.range.bounds.lower.change" ]
658,485
658,486
u749770850
python
p02854
import sys n = int(input()) a = list(map(int, input().split())) tmp=sys.maxsize s = sum(a) for i in range(n): t += a[i] tmp = min(tmp,abs(s-t*2)) print(tmp)
import sys n = int(input()) a = list(map(int, input().split())) tmp=sys.maxsize s = sum(a) t = 0 for i in range(n): t += a[i] tmp = min(tmp,abs(s-t*2)) print(tmp)
[ "assignment.add" ]
658,494
658,495
u879478232
python
p02854
N=int(input()) A=list(map(int,input().split())) l=0 r=0 li=0 ri=0 for i in range(N): if l<=r: l+=A[li] li+=1 else: r+=A[-1-ri] ri+=1 print(l-r)
N=int(input()) A=list(map(int,input().split())) l=0 r=0 li=0 ri=0 for i in range(N): if l<=r: l+=A[li] li+=1 else: r+=A[-1-ri] ri+=1 print(abs(l-r))
[ "call.arguments.add", "call.arguments.change" ]
658,505
658,506
u498487134
python
p02854
n = int(input()) a = list(map(int, input().split())) for i in range(n-1): a[i+1] += a[i] ans = 100000000000000 for i in range(n-1): ans = min(ans, abs(a[-1] - 2*a[i]))
n = int(input()) a = list(map(int, input().split())) for i in range(n-1): a[i+1] += a[i] ans = 100000000000000 for i in range(n-1): ans = min(ans, abs(a[-1] - 2*a[i])) print(ans)
[ "call.add" ]
658,549
658,550
u426108351
python
p02854
n=int(input()) arr=list(map(int,input().split())) total=sum(arr) acum=[arr[0]] for i in range(1,n): acum.append(arr[i]+acum[-1]) ans=10**18 for i in range(n): tmp=abs(acum[i]-(total-acu[i])) ans=min(ans,tmp) print(ans)
n=int(input()) arr=list(map(int,input().split())) total=sum(arr) acum=[arr[0]] for i in range(1,n): acum.append(arr[i]+acum[-1]) ans=10**18 for i in range(n): tmp=abs(acum[i]-(total-acum[i])) ans=min(ans,tmp) print(ans)
[ "assignment.value.change", "identifier.change", "call.arguments.change", "expression.operation.binary.change" ]
658,570
658,571
u163320134
python
p02854
from itertools import accumulate n = int(input()) a = list(map(int, input().split())) sum_l = [0]+list(accumulate(a)) sum_r = [0]+list(accumulate(a[:-1])) cost = sum_r[-1] for i in range(n+1): cost = min(cost, abs(sum_l[i]-sum_r[n-i])) print(cost)
from itertools import accumulate n = int(input()) a = list(map(int, input().split())) sum_l = [0]+list(accumulate(a)) sum_r = [0]+list(accumulate(a[-1::-1])) cost = sum_r[-1] for i in range(n+1): cost = min(cost, abs(sum_l[i]-sum_r[n-i])) print(cost)
[]
658,572
658,573
u530844517
python
p02854
from itertools import accumulate as ac n=int(input()) a=list(ac(list(map(int,input().split())))) d=float("INF") for i in range(n): d=min(d,abs(d-2*a[i])) print(d)
from itertools import accumulate as ac n=int(input()) a=list(ac(list(map(int,input().split())))) d=float("INF") for i in range(n): d=min(d,abs(a[-1]-2*a[i])) print(d)
[ "assignment.value.change", "call.arguments.change", "expression.operation.binary.change" ]
658,580
658,581
u619819312
python
p02854
n=int(input()) a=[int(i) for i in input().split()] asum2=sum(a)/2 j,k=0,0 for i in range(n): j+=a[i] if j>=asum2: break for i in range(n): k+=a[n-i-1] if k>=asum2: break if j-asum2>k-asum2: print(int(2*j-2*asum2)) else: print(int(2*k-2*asum2))
n=int(input()) a=[int(i) for i in input().split()] asum2=sum(a)/2 j,k=0,0 for i in range(n): j+=a[i] if j>=asum2: break for i in range(n): k+=a[n-i-1] if k>=asum2: break if j-asum2<k-asum2: print(int(2*j-2*asum2)) else: print(int(2*k-2*asum2))
[ "misc.opposites", "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
658,629
658,630
u821712904
python
p02854
N = int(input()) A = list(map(int, input().split())) sumA = sum(A) ans, sumA2 = abs(sumA - 0), 0 for i in range(N): sumA2 += A[i] ans = min(ans, abs(sumA - sumA2)) print(ans)
N = int(input()) A = list(map(int, input().split())) sumA = sum(A) ans, sumA2 = abs(sumA - 0), 0 for i in range(N): sumA2 += A[i] ans = min(ans, abs(sumA - sumA2 * 2)) print(ans)
[ "assignment.change" ]
658,631
658,632
u332906195
python
p02854
# coding: utf-8 n = map(int,input().split()) a = list(map(int,input().split())) a_sum = sum(a) kyoukaisen = a_sum /2 left = 0 for i in range(len(a)): left += a[i] if left >= kyoukaisen: print(min(abs(a_sum - 2*left),abs( (a_sum - left-a[i]) - (a_sum-(a_sum - left-a[i]))) )) break
# coding: utf-8 n = map(int,input().split()) a = list(map(int,input().split())) a_sum = sum(a) kyoukaisen = a_sum /2 left = 0 for i in range(len(a)): left += a[i] if left >= kyoukaisen: print(min(abs(a_sum - 2*left),abs( (a_sum - (left-a[i])) - (a_sum-(a_sum - (left-a[i])))) )) break
[ "call.arguments.change" ]
658,636
658,637
u963128036
python
p02854
N = int(input()) a = list(map(int, input.split())) r = sum(a) ra = 0 result = 1e30 for i in range(0,N): ra += a[i] r -= a[i] result = min(result, abs(ra-r)) print(int(result))
N = int(input()) a = list(map(int, input().split())) r = sum(a) ra = 0 result = 1e30 for i in range(0,N): ra += a[i] r -= a[i] result = min(result, abs(ra-r)) print(int(result))
[ "call.add" ]
658,645
658,646
u660571124
python
p02854
N = int(input()) a = list(map(int, input().split())) r = sum(a) ra = 0 result = 1e30 for i in tqdm(range(0,N)): ra += a[i] r -= a[i] result = min(result, abs(ra-r)) print(result)
N = int(input()) a = list(map(int, input().split())) r = sum(a) ra = 0 result = 1e30 for i in range(0,N): ra += a[i] r -= a[i] result = min(result, abs(ra-r)) print(int(result))
[ "call.remove", "call.arguments.change", "call.add" ]
658,647
658,646
u660571124
python
p02854
import sys def main(): n, *a = map(int, sys.stdin.readline().split()) l = 0 r = sum(a) m = sum(a) for i in range(n): l += a[i] r -= a[i] m = min(m, abs(l - r)) print(m) if __name__ == '__main__': main()
import sys def main(): n, *a = map(int, sys.stdin.read().split()) l = 0 r = sum(a) m = sum(a) for i in range(n): l += a[i] r -= a[i] m = min(m, abs(l - r)) print(m) if __name__ == '__main__': main()
[ "assignment.value.change", "identifier.change", "call.arguments.change" ]
658,650
658,651
u254871849
python
p02854
n=int(input()) a=list(map(int,input().split())) sumFrontHalf=0 halfIndex=0 sumA=aum(a) for i in range(n): sumFrontHalf+=a[i] if sumFrontHalf>=sumA/2: halfIndex=i break sumBackHalf=sumA-sumFrontHalf+a[halfIndex] if sumFrontHalf<sumBackHalf: print(sumFrontHalf-sumBackHalf+a[halfIndex]) else: print(sumBack...
n=int(input()) a=list(map(int,input().split())) sumFrontHalf=0 halfIndex=0 sumA=sum(a) for i in range(n): sumFrontHalf+=a[i] if sumFrontHalf>=sumA/2: halfIndex=i break sumBackHalf=sumA-sumFrontHalf+a[halfIndex] if sumFrontHalf<sumBackHalf: print(sumFrontHalf-sumBackHalf+a[halfIndex]) else: print(sumBack...
[ "assignment.value.change", "identifier.change", "call.function.change" ]
658,699
658,700
u234582237
python
p02854
n=int(input()) a=list(map(int,input().split())) x=sum(a) i=ans1=0 while True: if ans1<x/2 and i<n: ans1+=a[i] i+=1 else: break if i==n-1: print(2*a[i-1]-x) else: i-=1 ans2=x-ans1 ans1-=a[i] print(a[i]-abs(ans1-ans2))
n=int(input()) a=list(map(int,input().split())) x=sum(a) i=ans1=0 while True: if ans1<x/2 and i<n: ans1+=a[i] i+=1 else: break if i==n: print(2*a[i-1]-x) else: i-=1 ans2=x-ans1 ans1-=a[i] print(a[i]-abs(ans1-ans2))
[ "expression.operation.binary.remove" ]
658,701
658,702
u225388820
python
p02854
n = int(input()) a= [int(x) for x in input().split(" ",n-1)] print(a) s = 0 for x in range(n): s += a[x-1] r = 0 l = 0 x = 0 while r < s/2: r += a[x] x += 1 y = 1 while l < s/2: l += a[n-y] y += 1 if r == s//2: print(0) else: k = min(r,l) v = k - s/2 m = v // 0.5 print(int(m))
n = int(input()) a= [int(x) for x in input().split(" ",n-1)] s = 0 for x in range(n): s += a[x-1] r = 0 l = 0 x = 0 while r < s/2: r += a[x] x += 1 y = 1 while l < s/2: l += a[n-y] y += 1 if r == s//2: print(0) else: k = min(r,l) v = k - s/2 m = v // 0.5 print(int(m))
[ "call.remove" ]
658,721
658,722
u985408358
python
p02854
n = int(input()) A = list(map(int,input().split())) for i in A: i = int(i) def h(n,A): res = float('inf') f = [] b = [] t = 0 for i in range(len(A)): t+=A[i] f.append(t) t = 0 for i in range(len(A)-1,-1,-1): t += A[i] b.append(t) for i in range(len(A)...
n = int(input()) A = list(map(int,input().split())) for i in A: i = int(i) def h(n,A): res = float('inf') f = [] b = [] t = 0 for i in range(len(A)): t+=A[i] f.append(t) t = 0 for i in range(len(A)-1,-1,-1): t += A[i] b.append(t) b.reverse() for i...
[ "call.add" ]
658,734
658,735
u284901982
python
p02854
def solve(): N = int(input()) A = list(map(int,input().split())) sm = sum(A) agg = 0 idx = 0 mid = sm / 2 shrink_cnt = sm - N while agg < mid and idx < N-1: agg += A[idx] idx += 1 oneleft = agg oneright = sm - oneleft twoleft = agg-A[idx] t...
def solve(): N = int(input()) A = list(map(int,input().split())) sm = sum(A) agg = 0 idx = 0 mid = sm / 2 shrink_cnt = sm - N while agg < mid and idx < N-1: agg += A[idx] idx += 1 oneleft = agg oneright = sm - oneleft twoleft = agg-A[idx-1] ...
[ "assignment.change" ]
658,753
658,754
u647999897
python
p02854
from sys import stdin from itertools import accumulate, dropwhile, takewhile, groupby import bisect import copy import math N = int(stdin.readline().rstrip()) d = [int(s) for s in stdin.readline().rstrip().split()] count = 0 sumF = d[0] sumB = d[len(d) - 1] count = 0 countF = 0 countB = len(d) - 1 while count != len(d...
from sys import stdin from itertools import accumulate, dropwhile, takewhile, groupby import bisect import copy import math N = int(stdin.readline().rstrip()) d = [int(s) for s in stdin.readline().rstrip().split()] count = 0 sumF = d[0] sumB = d[len(d) - 1] count = 0 countF = 0 countB = len(d) - 1 while count < len(d)...
[ "expression.operator.compare.change", "control_flow.loop.condition.change" ]
658,759
658,760
u606372527
python
p02854
N = int(input()) List = list(map(int,input().split())) length = sum(List) sum = 0 center = length / 2 centerIdx = 0 for idx in range(len(List)): sum += List[idx] if center <= sum: centerIdx = idx break if center == sum: print(0) else: if (centerIdx == 0): print(sum * 2 - length)...
N = int(input()) List = list(map(int,input().split())) length = sum(List) sum = 0 center = length / 2 centerIdx = 0 for idx in range(len(List)): sum += List[idx] if center <= sum: centerIdx = idx break if center == sum: print(0) else: if (centerIdx == 0): print(sum * 2 - length)...
[ "expression.operation.binary.remove" ]
658,767
658,768
u820284192
python
p02854
N = int(input()) A = list(map(int, input().split())) forward = [0]*N forward[0] = A[0] total = sum(A) m = 10*9 for i in range(1, N): forward[i] = forward[i-1] + A[i] for i in range(N-1): tmp = total - forward[i] diff = abs(tmp - forward[i]) m = min(diff, m) print(m)
N = int(input()) A = list(map(int, input().split())) forward = [0]*N forward[0] = A[0] total = sum(A) m = 10**12 for i in range(1, N): forward[i] = forward[i-1] + A[i] for i in range(N-1): tmp = total - forward[i] diff = abs(tmp - forward[i]) m = min(diff, m) print(m)
[]
658,771
658,770
u529180657
python
p02854
N = int(input()) A = list(map(int, input().split())) ans = 1000000000000 sum_A = sum(A) left = 0 for i in range(N - 1): print(left) left += A[i] ans = min(ans, abs(sum_A - left - left)) print(ans)
N = int(input()) A = list(map(int, input().split())) ans = 1000000000000 sum_A = sum(A) left = 0 for i in range(N - 1): left += A[i] ans = min(ans, abs(sum_A - left - left)) print(ans)
[ "call.remove" ]
658,796
658,797
u623349537
python
p02854
import numpy as np n=int(input()) a=list(int(x) for x in input().split()) bou_length=0 l=[] for i in range(len(a)): bou_length += a[i] l.append(bou_length) #print(bou_length) #print(l) def getNearestValue(list, num): """ 概要: リストからある値に最も近い値を返却する関数 list: データ配列 num: 対象値 return 対象値に最も近い値 """ ...
import numpy as np n=int(input()) a=list(int(x) for x in input().split()) bou_length=0 l=[] for i in range(len(a)): bou_length += a[i] l.append(bou_length) #print(bou_length) #print(l) def getNearestValue(list, num): """ 概要: リストからある値に最も近い値を返却する関数 list: データ配列 num: 対象値 return 対象値に最も近い値 """ ...
[ "call.arguments.add", "call.arguments.change" ]
658,814
658,815
u117078923
python
p02854
n= int(input()) a = list(int(i) for i in input().split()) import math import sys sta=sum(a)/2 sum=0 ans=0 for i in range(0,n-1): if sum==sta: print(0) sys.exit() elif sum<sta and sum+a[i]>sta: ans=min(sta-sum,sum+a[i]-sta)/0.5 print(int(ans)) sys.exit() else: ...
n= int(input()) a = list(int(i) for i in input().split()) import math import sys sta=sum(a)/2 sum=0 ans=0 for i in range(0,n-1): if sum==sta: print(0) sys.exit() elif sum<sta and sum+a[i]>sta: ans=min(sta-sum,sum+a[i]-sta)/0.5 print(int(ans)) sys.exit() else: ...
[ "assignment.change" ]
658,816
658,817
u504507648
python
p02854
n= int(input()) a = list(int(i) for i in input().split()) import math import sys sta=sum(a)/2 sum=0 ans=0 for i in range(0,n-1): if sum==sta: print(0) sys.exit() elif sum<sta and sum+a[i]>sta: ans=min(sta-sum,sum+a[i+1]-sta)/0.5 print(int(ans)) sys.exit() else: ...
n= int(input()) a = list(int(i) for i in input().split()) import math import sys sta=sum(a)/2 sum=0 ans=0 for i in range(0,n-1): if sum==sta: print(0) sys.exit() elif sum<sta and sum+a[i]>sta: ans=min(sta-sum,sum+a[i]-sta)/0.5 print(int(ans)) sys.exit() else: ...
[ "expression.operation.binary.remove" ]
658,818
658,817
u504507648
python
p02854
import sys n=int(input()) a=list(map(int,input().split())) s=sum(a) totl=0 idx=0 dif1=0 for i in range(n): totl+=a[i] idx=i if (s/2)==totl: print(0) sys.exit() elif (s/2)<totl: dif1=totl-(s/2) break dif2=a[idx]-dif1 if dif1-(dif1//1)==0: print(int(min(dif1,dif2))) else: print(int(2*min(dif1,...
import sys n=int(input()) a=list(map(int,input().split())) s=sum(a) totl=0 idx=0 dif1=0 for i in range(n): totl+=a[i] idx=i if (s/2)==totl: print(0) sys.exit() elif (s/2)<totl: dif1=totl-(s/2) break dif2=a[idx]-dif1 if dif1-(dif1//1)==0: print(int(2*min(dif1,dif2))) else: print(int(2*min(dif...
[ "expression.operation.binary.add" ]
658,823
658,824
u527261492
python
p02854
n = int(input()) a = list(map(int, input().split())) s = 0 t = sum(a) for i in range(n-1): s += a[i] if s - t / 2 > 0: break s1 = s - a[i] print(min((t - s1 -s1), (s- (t - s) )))
n = int(input()) a = list(map(int, input().split())) s = 0 t = sum(a) for i in range(n): s += a[i] if s - t / 2 > 0: break s1 = s - a[i] print(min((t - s1 -s1), (s- (t - s) )))
[ "expression.operation.binary.remove" ]
658,889
658,890
u597017430
python
p02854
import math n=int(input()) a=list(map(int,input().split())) ans=9999999999 hidari=sum(a) migi=0 for i in range(n): hidari-=a[i] migi+=a[i] sa=math.abs(hidari-migi) if sa<ans: ans=sa print(ans)
import math n=int(input()) a=list(map(int,input().split())) ans=9999999999 hidari=sum(a) migi=0 for i in range(n): hidari-=a[i] migi+=a[i] sa=math.fabs(hidari-migi) if sa<ans: ans=sa print(int(ans))
[ "assignment.value.change", "identifier.change", "call.add", "call.arguments.change" ]
658,891
658,892
u189188797
python
p02854
import bisect N = int(input()) A = list(map(int, input().split())) s = [0]*N s[0] = A[0] for i in range(1, N): s[i] = s[i-1] + A[i] id = bisect.bisect_left(s, s[-1] // 2) if s[id] == s[-1] // 2: if s[-1] % 2 == 0: print(0) else: print(1) else: k = 0 if s[-1] % 2 != 0: k = 1...
import bisect N = int(input()) A = list(map(int, input().split())) s = [0]*N s[0] = A[0] for i in range(1, N): s[i] = s[i-1] + A[i] id = bisect.bisect_left(s, s[-1] // 2) if s[id] == s[-1] // 2: if s[-1] % 2 == 0: print(0) else: print(1) else: k = 0 if s[-1] % 2 != 0: k = 1...
[ "assignment.change" ]
658,893
658,894
u814986259
python
p02854
n=int(input()) A=list(map(int,input().split())) L=sum(A) l=0 for i in range(n): l+=A[i] if l >= L/2: r=l-A[i] break print(l,r) print(min(abs((L-r)-r),abs((L-l)-l)))
n=int(input()) A=list(map(int,input().split())) L=sum(A) l=0 for i in range(n): l+=A[i] if l >= L/2: r=l-A[i] break print(min(abs((L-r)-r),abs((L-l)-l)))
[ "call.remove" ]
658,960
658,961
u469953228
python
p02856
n=int(input()) dnum =0 dsum =0 for i in range(n): d,c=map(int,input().split()) dnum += c dsum += d*c ans = dnum-1 + dsum//9 print(ans)
n=int(input()) dnum =0 dsum =0 for i in range(n): d,c=map(int,input().split()) dnum += c dsum += d*c ans = dnum-1 + (dsum-1)//9 print(ans)
[]
659,663
659,664
u276588887
python
p02856
n=int(input()) dnum =0 dsum =0 for i in range(n): d,c=map(int,input().split()) dnum += c dsum += d*c ans = c-1 + dsum//9 print(ans)
n=int(input()) dnum =0 dsum =0 for i in range(n): d,c=map(int,input().split()) dnum += c dsum += d*c ans = dnum-1 + (dsum-1)//9 print(ans)
[ "assignment.value.change", "identifier.change", "expression.operation.binary.change" ]
659,665
659,664
u276588887
python
p02856
M=int(input()) n_digit=0 n_sum=0 for _ in range(M): d,c=map(int,input().split()) n_digit+=c n_sum+=d*c #print(n_digit,n_sum) print(n_digit-1+n_sum//9)
M=int(input()) n_digit=0 n_sum=0 for _ in range(M): d,c=map(int,input().split()) n_digit+=c n_sum+=d*c #print(n_digit,n_sum) print(n_digit-1+(n_sum-1)//9)
[ "call.arguments.change" ]
659,720
659,721
u203843959
python
p02856
M = int(input()) DC = [tuple(map(int,input().split())) for i in range(M)] sumd = sumc = 0 for d,c in DC: sumd += d sumc += c ans = sumc-1 + (sumd-1)//9 print(ans)
M = int(input()) DC = [tuple(map(int,input().split())) for i in range(M)] sumd = sumc = 0 for d,c in DC: sumd += d*c sumc += c ans = sumc-1 + (sumd-1)//9 print(ans)
[ "expression.operation.binary.add" ]
659,733
659,734
u761320129
python
p02856
m=int(input()) n=0 ans=0 for i in range(m): x,y=map(int,input().split()) n+=y ans+=x*y n-=1 n+=ans//9 print(n)
m=int(input()) n=0 ans=0 for i in range(m): x,y=map(int,input().split()) n+=y ans+=x*y n-=1 ans-=1 n+=ans//9 print(n)
[]
659,748
659,749
u730769327
python
p02856
M = int(input()) cur = 0 keta = 0 csum = 0 for _ in range(M): d,c = map(int,input().split()) s = 0 for i in str(d): s += int(i) csum += s * c keta += c print(keta-1 + csum//9)
M = int(input()) cur = 0 keta = 0 csum = 0 for _ in range(M): d,c = map(int,input().split()) s = 0 for i in str(d): s += int(i) csum += s * c keta += c # 9をカウントしたくないため print(keta-1 + (csum-1)//9)
[ "call.arguments.change" ]
659,754
659,755
u723711163
python
p02856
M = int(input()) Keta=0 Sum=0 for _ in range(M): d,c = map(int,input().split()) Keta+=c Sum=d*c print(Keta-1 + (Sum-1)//9)
M = int(input()) Keta=0 Sum=0 for _ in range(M): d,c = map(int,input().split()) Keta+=c Sum+=d*c print(Keta-1 + (Sum-1)//9)
[ "assignment.value.change" ]
659,758
659,759
u375616706
python
p02856
n = int(input()) d, d_sum = 0, 0 for _ in range(n): a, b = map(int, input().split()) d += b d_sum += a * b print(d - 1 + d_sum // 9)
n = int(input()) d, d_sum = 0, 0 for _ in range(n): a, b = map(int, input().split()) d += b d_sum += a * b print(d - 1 + (d_sum - 1) // 9)
[ "call.arguments.change" ]
659,760
659,761
u285022453
python
p02854
# coding: utf-8 def solve(*args: str) -> str: n = int(args[0]) A = tuple(map(int, args[1].split())) left = 0 right = sum(A) ret = 0 for i in range(0, n-1): r_g = right - left left += A[i] right -= A[i] if left == right: break elif left > ri...
# coding: utf-8 def solve(*args: str) -> str: n = int(args[0]) A = tuple(map(int, args[1].split())) left = 0 right = sum(A) ret = 0 for i in range(0, n): r_g = right - left left += A[i] right -= A[i] if left == right: break elif left > righ...
[ "expression.operation.binary.remove" ]
659,785
659,786
u164727245
python
p02854
N = int(input()) A = list(map(int, input().split())) M = sum(A)/2 M a = 0 i = 0 while a < M: a += A[i] i += 1 print(int(min(a-M,M-a+A[i])*2))
N = int(input()) A = list(map(int, input().split())) M = sum(A)/2 M a = 0 i = 0 while a < M: a += A[i] i += 1 print(int(min(a-M,M-a+A[i-1])*2))
[ "expression.operation.binary.add" ]
659,811
659,812
u212786022
python
p02854
N = int(input()) A = list(map(int, input().split())) M = sum(A)/2 M a = 0 i = 0 while a < M: a += A[i] i += 1 print(int(min(a-M,a-M+A[i])*2))
N = int(input()) A = list(map(int, input().split())) M = sum(A)/2 M a = 0 i = 0 while a < M: a += A[i] i += 1 print(int(min(a-M,M-a+A[i-1])*2))
[ "expression.operation.binary.remove" ]
659,813
659,812
u212786022
python
p02854
#!/usr/bin/env python3 import sys def solve(N: int, A: "List[int]"): M=sum(A)/2 l=0 for i in range(N): o=l l+=A[i] if l>=M: break if (l-M) > (M-o): l=o print(int((l-M)*2)) return # Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools ...
#!/usr/bin/env python3 import sys def solve(N: int, A: "List[int]"): M=sum(A)/2 l=0 for i in range(N): o=l l+=A[i] if l>=M: break if (l-M) > (M-o): l=o print(int(abs(l-M)*2)) return # Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-too...
[ "call.add", "call.arguments.change" ]
659,827
659,828
u090649502
python
p02854
n=int(input()) a = [int(i) for i in input().split()] length = sum(a) if length %2 ==0: check = 0 half = length//2 idx = 0 for i in range(len(a)): check+=a[i] if check > half: idx = i break if check - half > half - (check-a[idx]): check -=a[idx] ...
n=int(input()) a = [int(i) for i in input().split()] length = sum(a) if length %2 ==0: check = 0 half = length//2 idx = 0 for i in range(len(a)): check+=a[i] if check > half: idx = i break if check - half > half - (check-a[idx]): check -=a[idx] ...
[ "call.add", "call.arguments.change" ]
659,861
659,862
u598229387
python
p02854
n = int(input()) a = list(map(int,input().split())) l = sum(a) b = list() t = 0 ans = 10**10 for i in a: t += i n.append(t) for j in b: x = abs(l-(2*j)) if x < ans: ans = x print(ans)
n = int(input()) a = list(map(int,input().split())) l = sum(a) b = list() t = 0 ans = 10**10 for i in a: t += i b.append(t) for j in b: x = abs(l-(2*j)) if x < ans: ans = x print(ans)
[ "identifier.change" ]
659,870
659,871
u025463382
python
p02854
n = int(input()) a = list(map(int,input().split())) l = sum(a) b = list() t = 0 ans = 10**10 for i in a: t += i b.append(t) for j in b: x = abs(l-(2*j)) if x < ans: ans = x else: break print(ans)
n = int(input()) a = list(map(int,input().split())) l = sum(a) b = list() t = 0 ans = 10**10 for i in a: t += i b.append(t) for j in b: x = abs(l-(2*j)) if x < ans: ans = x print(ans)
[ "control_flow.break.remove" ]
659,872
659,871
u025463382
python
p02854
N = int(input()) A = list(map(int, input().split())) total_length = sum(A) left_length = 0 for i in range(len(A) - 1): left_length += A[i] if left_length * 2 >= total_length: break cost_from_left = left_length * 2 - total_length right_length = 0 for j in reversed(range(len(A) - 1)): right_length +...
N = int(input()) A = list(map(int, input().split())) total_length = sum(A) left_length = 0 for i in range(len(A)): left_length += A[i] if left_length * 2 >= total_length: break cost_from_left = left_length * 2 - total_length right_length = 0 for j in reversed(range(len(A))): right_length += A[j] ...
[ "expression.operation.binary.remove" ]
659,873
659,874
u733377702
python
p02854
# -*- coding: utf-8 -*- import sys import math from bisect import bisect_left from bisect import bisect_right import collections import copy import heapq from collections import defaultdict from heapq import heappop, heappush import itertools input = sys.stdin.readline ##### リストの 二分木検索 ##### # bisect_left(lists, 3) # ...
# -*- coding: utf-8 -*- import sys import math from bisect import bisect_left from bisect import bisect_right import collections import copy import heapq from collections import defaultdict from heapq import heappop, heappush import itertools input = sys.stdin.readline ##### リストの 二分木検索 ##### # bisect_left(lists, 3) # ...
[ "control_flow.break.add" ]
659,894
659,895
u448994613
python
p02854
# -*- coding: utf-8 -*- import sys import math from bisect import bisect_left from bisect import bisect_right import collections import copy import heapq from collections import defaultdict from heapq import heappop, heappush import itertools input = sys.stdin.readline ##### リストの 二分木検索 ##### # bisect_left(lists, 3) # ...
# -*- coding: utf-8 -*- import sys import math from bisect import bisect_left from bisect import bisect_right import collections import copy import heapq from collections import defaultdict from heapq import heappop, heappush import itertools input = sys.stdin.readline ##### リストの 二分木検索 ##### # bisect_left(lists, 3) # ...
[ "identifier.change", "control_flow.break.add" ]
659,896
659,895
u448994613
python
p02856
M = int(input()) ans = 0 prev = 0 arr = [] for _ in range(M): d, c = map(int, input().split()) ans += c-1 total = 0 a = (c-1) // 9 b = (c-1) % 9 + 1 if d == 1: ans += a total = b elif d == 2: ans += a * 2 if b >= 5: ans += 1 total = [2,4,6,8,1,3,5,7,9]...
M = int(input()) ans = 0 prev = 0 arr = [] for _ in range(M): d, c = map(int, input().split()) ans += c-1 total = 0 a = (c-1) // 9 b = (c-1) % 9 + 1 if d == 1: ans += a total = b elif d == 2: ans += a * 2 if b >= 5: ans += 1 total = [2,4,6,8,1,3,5,7,9]...
[ "expression.operation.binary.remove" ]
659,918
659,919
u792078574
python
p02856
# coding: utf-8 # Your code here! m= int(input()) dc=[] s=0 for i in range(m): dc.append(list(map(int,input().split()))) s+=dc[i][0]*dc[i][1] print(s) ans=s//9 for i in range(m): ans+=dc[i][1] if s%9==0: ans-=1 print(ans-1)
# coding: utf-8 # Your code here! m= int(input()) dc=[] s=0 for i in range(m): dc.append(list(map(int,input().split()))) s+=dc[i][0]*dc[i][1] ans=s//9 for i in range(m): ans+=dc[i][1] if s%9==0: ans-=1 print(ans-1)
[ "call.remove" ]
659,923
659,924
u095426154
python
p02856
import sys sys.setrecursionlimit(10**6) readline = sys.stdin.readline m = int(input()) #a = [int(i) for i in readline().split()] keta = 0 wa = 0 for i in range(m): d,c = [int(i) for i in readline().split()] keta += c wa += d*c #print(keta,wa) print(keta-1 + wa//9)
import sys sys.setrecursionlimit(10**6) readline = sys.stdin.readline m = int(input()) #a = [int(i) for i in readline().split()] keta = 0 wa = 0 for i in range(m): d,c = [int(i) for i in readline().split()] keta += c wa += d*c #print(keta,wa) print(keta-1 + (wa-1)//9)
[ "call.arguments.change" ]
659,950
659,951
u875291233
python
p02856
import sys sys.setrecursionlimit(2147483647) INF=float("inf") MOD=10**9+7 input=lambda :sys.stdin.readline().rstrip() def resolve(): m=int(input()) D=[0]*m;C=[0]*m for i in range(m): D[i],C[i]=map(int,input().split()) digit=sum(D[i]*C[i] for i in range(m)) print(sum(C)+digit//9-1) resolve()
import sys sys.setrecursionlimit(2147483647) INF=float("inf") MOD=10**9+7 input=lambda :sys.stdin.readline().rstrip() def resolve(): m=int(input()) D=[0]*m;C=[0]*m for i in range(m): D[i],C[i]=map(int,input().split()) digit=sum(D[i]*C[i] for i in range(m)) print(sum(C)+(digit-1)//9-1) resol...
[ "call.arguments.change" ]
659,983
659,984
u440566786
python
p02856
def main(): M = int(input()) DC = [list(map(int, input().split())) for _ in range(M)] S = 0 cS = 0 for d, c in DC: cS += c S += d*c ans = cS - 1 + S//10 print(ans) if __name__ == "__main__": main()
def main(): M = int(input()) DC = [list(map(int, input().split())) for _ in range(M)] S = 0 cS = 0 for d, c in DC: cS += c S += d*c ans = cS - 1 + (S-1)//9 print(ans) if __name__ == "__main__": main()
[ "literal.number.integer.change", "assignment.value.change", "expression.operation.binary.change" ]
659,988
659,989
u237362582
python
p02856
M = int(input()) DC = [list(map(int, input().split())) for _ in range(M)] digits_sum = 0 digits_length = 0 for d, c in DC: digits_sum += d*c digits_length += c # print(digits_sum, digits_length) print((digits_length - 1) + (digits_sum // 9))
M = int(input()) DC = [list(map(int, input().split())) for _ in range(M)] digits_sum = 0 digits_length = 0 for d, c in DC: digits_sum += d*c digits_length += c # print(digits_sum, digits_length) print((digits_length - 1) + ((digits_sum-1) // 9))
[ "call.arguments.change" ]
660,076
660,077
u599547273
python
p02856
import sys sys.setrecursionlimit(10**9) INF=10**18 def input(): return sys.stdin.readline().rstrip() def main(): M=int(input()) d=[0]*M c=[0]*M ans=0 l=[] for i in range(M): d[i],c[i]=map(int,input().split()) ans+=sum(c)-1 x=0 for i in range(M): x+=c[i]*d[i] ...
import sys sys.setrecursionlimit(10**9) INF=10**18 def input(): return sys.stdin.readline().rstrip() def main(): M=int(input()) d=[0]*M c=[0]*M ans=0 l=[] for i in range(M): d[i],c[i]=map(int,input().split()) ans+=sum(c)-1 x=0 for i in range(M): x+=c[i]*d[i] ...
[]
660,078
660,079
u714642969
python
p02856
M = int(input()) cnt = 0 cnt_c = 0 L = [] for _ in range(M): d, c = map(int, input().split()) cnt += c*d cnt_c += c ans = cnt//10 + cnt_c - 1 print(ans)
M = int(input()) cnt = 0 cnt_c = 0 L = [] for _ in range(M): d, c = map(int, input().split()) cnt += c*d cnt_c += c ans = (cnt-1) // 9 + cnt_c - 1 print(ans)
[ "literal.number.integer.change", "assignment.value.change", "expression.operation.binary.change" ]
660,101
660,102
u504836877
python
p02856
m=int(input()) counter=0 s=0 for i in range(m): d,c=map(int,input().split()) counter+=d*c s+=c print(s-1+counter//9)
m=int(input()) counter=0 s=0 for i in range(m): d,c=map(int,input().split()) counter+=d*c s+=c print(s-1+(counter-1)//9)
[ "call.arguments.change" ]
660,113
660,114
u780962115
python
p02856
m=int(input()) a=[list(map(int, input().split())) for i in range(m)] x=0 y=0 for i in range(m): x+=a[i][1] y+=a[i][0]*a[i][1] print(x-1+y//10)
m=int(input()) a=[list(map(int, input().split())) for i in range(m)] x=0 y=0 for i in range(m): x+=a[i][1] y+=a[i][0]*a[i][1] print(x-1+(y-1)//9) ...
[ "call.arguments.change", "literal.number.integer.change", "expression.operation.binary.change", "io.output.change" ]
660,119
660,118
u970899068
python
p02856
from collections import Counter mod = 1000000007 def inverse(a): return pow(a, mod - 2, mod) def usearch(x, a): lft = 0 rgt = len(a) + 1 while rgt - lft > 1: mid = (rgt + lft) // 2 if a[mid] <= x: lft = mid else: rgt = mid return lft def main(): ...
from collections import Counter mod = 1000000007 def inverse(a): return pow(a, mod - 2, mod) def usearch(x, a): lft = 0 rgt = len(a) + 1 while rgt - lft > 1: mid = (rgt + lft) // 2 if a[mid] <= x: lft = mid else: rgt = mid return lft def main(): ...
[ "call.arguments.change" ]
660,123
660,124
u702582248
python
p02856
# -*- coding: utf-8 -*- M = int(input()) d = 0 c = 0 for _ in range(M): c1, d1 = map(int, input().split()) d += d1 c += c1 if c % 9 != 0: s = c // 9 else: s = c // 9 - 1 print((d - 1) + s)
# -*- coding: utf-8 -*- M = int(input()) d = 0 c = 0 for _ in range(M): c1, d1 = map(int, input().split()) d += d1 c += c1 * d1 if c % 9 != 0: s = c // 9 else: s = c // 9 - 1 print((d - 1) + s)
[ "expression.operation.binary.add" ]
660,127
660,128
u513434790
python
p02856
n = int(input()) d, c = 0, 0 for i in range(n): p, q = map(int, input().split()) d = d + p c = c + p*q print((d-1)+(c-1)//9)
n = int(input()) d, c = 0, 0 for i in range(n): p, q = map(int, input().split()) d = d + q c = c + p*q print((d-1)+(c-1)//9)
[ "assignment.value.change", "identifier.change", "expression.operation.binary.change" ]
660,131
660,132
u021548497
python
p02856
M = int(input()) D = C = 0 for i in range(M): d, c = map(int, input().split()) D += d C += c print(C - 1 + (D - 1) // 9)
M = int(input()) CD = C = 0 for i in range(M): d, c = map(int, input().split()) CD += c * d C += c print(C - 1 + (CD - 1) // 9)
[ "assignment.variable.change", "identifier.change", "call.arguments.change", "expression.operation.binary.change", "io.output.change" ]
660,148
660,149
u716529032
python
p02856
#!/usr/bin/python # -*- coding: utf-8 -*- import sys import math import collections M, = map(int, sys.stdin.readline().rstrip().split(" ")) total_sum = 0 total_digits = 0 for _ in range(M): d, c = map(int, sys.stdin.readline().rstrip().split(" ")) total_digits += c total_sum += d*c answer = (total_sum // 9...
#!/usr/bin/python # -*- coding: utf-8 -*- import sys import math import collections M, = map(int, sys.stdin.readline().rstrip().split(" ")) total_sum = 0 total_digits = 0 for _ in range(M): d, c = map(int, sys.stdin.readline().rstrip().split(" ")) total_digits += c total_sum += d*c answer = ((total_sum-1) ...
[]
660,156
660,157
u532827876
python
p02856
import sys input = sys.stdin.readline def main(): M = int(input()) count = 0 wa = 0 for _ in range(M): d, c = [int(x) for x in input().split()] count += c wa += d * c print(count - 1 + (wa // 9)) if __name__ == '__main__': main()
import sys input = sys.stdin.readline def main(): M = int(input()) count = 0 wa = 0 for _ in range(M): d, c = [int(x) for x in input().split()] count += c wa += d * c print(count - 1 + ((wa - 1) // 9)) if __name__ == '__main__': main()
[ "call.arguments.change" ]
660,197
660,198
u098012509
python
p02856
M = int(input()) D = 0 S = 0 for i in range(M): c,d = map(int,input().split()) D += d S += c*d print(D-1+S//9)
M = int(input()) D = 0 S = 0 for i in range(M): c,d = map(int,input().split()) D += d S += c*d print(D-1+(S-1)//9)
[ "call.arguments.change" ]
660,203
660,204
u170201762
python
p02856
m=int(input()) s,c=0,0 for i in range(m): d,c=map(int,input().split()) s+=d*c k+=c print(k-1+(s-1)//9)
m=int(input()) s,k=0,0 for i in range(m): d,c=map(int,input().split()) s+=d*c k+=c print(k-1+(s-1)//9)
[ "assignment.variable.change", "identifier.change" ]
660,220
660,221
u623819879
python
p02856
import sys read = sys.stdin.read M = int(input()) dc = map(int, read().split()) dig = [0] * 10 cnt = 0 answer = 0 for d, c in zip(*[iter(dc)] * 2): dig[d] += c trans = dict() for i in range(10): if i < 5: trans[i] = i + i elif i == 5: trans[i] = 1 else: trans[i] = trans[i - 1] ...
import sys read = sys.stdin.read M = int(input()) dc = map(int, read().split()) dig = [0] * 10 cnt = 0 answer = 0 for d, c in zip(*[iter(dc)] * 2): dig[d] += c trans = dict() for i in range(10): if i < 5: trans[i] = i + i elif i == 5: trans[i] = 1 else: trans[i] = trans[i - 1] ...
[ "expression.operation.binary.add" ]
660,232
660,233
u945181840
python
p02856
import sys read = sys.stdin.read M = int(input()) dc = map(int, read().split()) dig_sum = 0 dig = 0 for d, c in zip(*[iter(dc)] * 2): dig_sum += d * c dig += c answer = dig_sum // 9 + dig - 1 print(answer)
import sys read = sys.stdin.read M = int(input()) dc = map(int, read().split()) dig_sum = 0 dig = 0 for d, c in zip(*[iter(dc)] * 2): dig_sum += d * c dig += c answer = (dig_sum - 1) // 9 + dig - 1 print(answer)
[]
660,234
660,235
u945181840
python
p02856
M = int(input()) S = 0 res = -1 for _ in range(M): d, c = map(int, input().split()) res += c S += d*c res += S // 9 print(res)
M = int(input()) S = -1 res = -1 for _ in range(M): d, c = map(int, input().split()) res += c S += d*c res += S // 9 print(res)
[ "assignment.value.change", "expression.operation.unary.add" ]
660,238
660,239
u813102292
python
p02856
M = int(input()) S = 0 res = -1 for _ in range(M): d, c = map(int, input().split()) res += d S += c res += S // 9 print(res)
M = int(input()) S = -1 res = -1 for _ in range(M): d, c = map(int, input().split()) res += c S += d*c res += S // 9 print(res)
[ "assignment.value.change", "expression.operation.unary.add", "identifier.change" ]
660,240
660,239
u813102292
python
p02856
import sys input = sys.stdin.readline m = int(input()) sum1 = 0 sumc = 0 ans = 0 for i in range(m): d,c = map(int,input().split()) sum1 += d * c sumc += c ans += sumc + sum1 // 9 - 1 print(ans)
import sys input = sys.stdin.readline m = int(input()) sum1 = 0 sumc = 0 ans = 0 for i in range(m): d,c = map(int,input().split()) sum1 += d * c sumc += c ans += sumc + (sum1 - 1) // 9 - 1 print(ans)
[]
660,244
660,245
u623231048
python
p02856
M = int(input()) a = 0 csum = 0 for i in range(M): d,c = map(int, input().split()) a += d*c csum += c print(a // 9 + 1 + csum - 2)
M = int(input()) a = 0 csum = 0 for i in range(M): d,c = map(int, input().split()) a += d*c csum += c print((a - 1) // 9 + 1 + csum - 2)
[ "call.arguments.change" ]
660,250
660,251
u552357043
python
p02856
M = int(input()) dc = [list(map(int,input().split())) for _ in range(M)] ans = 0 s = 0 for i in dc: d = i[0] c = i[1] ans += c s+=d*c if s>=10: t = s//9 ans+=t s-= t*9 ans -= 1 print(ans)
M = int(input()) dc = [list(map(int,input().split())) for _ in range(M)] ans = 0 s = 0 for i in dc: d = i[0] c = i[1] ans += c s+=d*c if s>=10: t = (s-1)//9 ans+=t s-= t*9 ans -= 1 print(ans)
[]
660,281
660,282
u268554510
python
p02856
M = int(input()) dc = [list(map(int,input().split())) for _ in range(M)] ans = 0 s = 0 for i in dc: d = i[0] c = i[1] ans += c s+=d*c if s>=9: t = s//9 ans+=t s-= t*9 ans -= 1 print(ans)
M = int(input()) dc = [list(map(int,input().split())) for _ in range(M)] ans = 0 s = 0 for i in dc: d = i[0] c = i[1] ans += c s+=d*c if s>=10: t = (s-1)//9 ans+=t s-= t*9 ans -= 1 print(ans)
[ "literal.number.integer.change", "control_flow.branch.if.condition.change" ]
660,283
660,282
u268554510
python
p02856
M = int(input()) dc = [list(map(int,input().split())) for _ in range(M)] ans = 0 s = 0 for i in dc: d = i[0] c = i[1] ans += c s+=d*c if s>=10: t = s//10 ans+=t s-= t*10 ans -= 1 print(ans)
M = int(input()) dc = [list(map(int,input().split())) for _ in range(M)] ans = 0 s = 0 for i in dc: d = i[0] c = i[1] ans += c s+=d*c if s>=10: t = (s-1)//9 ans+=t s-= t*9 ans -= 1 print(ans)
[ "literal.number.integer.change", "assignment.value.change", "expression.operation.binary.change" ]
660,284
660,282
u268554510
python
p02856
M = int(input()) s = 0 t = 0 for _ in range(M): d, c = map(int,input().split()) s += d * c t += c ans = (s//10) + t-1 print(ans)
M = int(input()) s = 0 t = 0 for _ in range(M): d, c = map(int,input().split()) s += d * c t += c ans = (s-1)//9 + t-1 print(ans)
[ "assignment.change" ]
660,291
660,292
u983918956
python
p02856
M = int(input()) lis = [0] * 10 able =0 for i in range(M): d,c = map(int,input().split()) lis[d] = c able += d * c print ( sum(lis)-1 + (able-1) // 9 )
M = int(input()) lis = [0] * 10 able =0 for i in range(M): d,c = map(int,input().split()) lis[d] += c able += d * c print ( sum(lis)-1 + (able-1) // 9 )
[ "assignment.value.change" ]
660,307
660,308
u828766688
python
p02856
M = int(input()) lis = [0] * 10 able =0 for i in range(M): d,c = map(int,input().split()) lis[d] = c able += d * c print ( sum(lis) + (able-1) // 9 )
M = int(input()) lis = [0] * 10 able =0 for i in range(M): d,c = map(int,input().split()) lis[d] += c able += d * c print ( sum(lis)-1 + (able-1) // 9 )
[ "assignment.value.change" ]
660,309
660,308
u828766688
python
p02856
M = int(input()) lis = [0] * 10 able =0 for i in range(M): d,c = map(int,input().split()) lis[d] = c able += d * c print ( sum(lis) - 1 + (able-1) // 9 )
M = int(input()) lis = [0] * 10 able =0 for i in range(M): d,c = map(int,input().split()) lis[d] += c able += d * c print ( sum(lis)-1 + (able-1) // 9 )
[ "assignment.value.change" ]
660,310
660,308
u828766688
python
p02856
M = int(input()) lis = [0] * 10 able =0 for i in range(M): d,c = map(int,input().split()) lis[d] = c able += d * c #print (sum(lis),able) print ( sum(lis) -1 + able // 10 )
M = int(input()) lis = [0] * 10 able =0 for i in range(M): d,c = map(int,input().split()) lis[d] += c able += d * c print ( sum(lis)-1 + (able-1) // 9 )
[ "assignment.value.change", "call.arguments.change", "literal.number.integer.change", "expression.operation.binary.change", "io.output.change" ]
660,311
660,308
u828766688
python