s_id
stringlengths
10
10
p_id
stringlengths
6
6
u_id
stringlengths
10
10
date
stringlengths
10
10
language
stringclasses
1 value
original_language
stringclasses
11 values
filename_ext
stringclasses
1 value
status
stringclasses
1 value
cpu_time
stringlengths
1
5
memory
stringlengths
1
7
code_size
stringlengths
1
6
code
stringlengths
1
539k
s189051964
p03845
u366959492
1559092991
Python
Python (3.4.3)
py
Runtime Error
17
2940
142
n=int(input()) t=list(map(int,input().split())) m=int(input()) for i in range(m): p,x=map(int,input().split()) t[p+1]=x print(sum(t))
s773000991
p03845
u095756391
1558905054
Python
Python (3.4.3)
py
Runtime Error
23
3444
209
import copy n = int(input()) t = list(map(int, input().split())) m = int(input()) for i in range(M): copy_t = copy.copy(t) p, x = map(int, input().split()) copy_t[p-1] = x print(sum(copy_t))
s680154869
p03845
u023958502
1558724818
Python
Python (3.4.3)
py
Runtime Error
18
3060
175
n = int(input()) t = list(map(int,input().split())) m = int(input()) all = sum(t) for i in range(m): p,x = map(int,input().split()) all = all + x - t[i] print(all)
s318649656
p03845
u220345792
1557797702
Python
Python (3.4.3)
py
Runtime Error
17
2940
160
_ = input() T = list(map(int, input().split())) M = int(input()) for i in range(M): P, X = map(int, input().split()) ans = sum(T[:P]+T[P+1])+X print(ans)
s593154575
p03845
u220345792
1557797619
Python
Python (3.4.3)
py
Runtime Error
17
3060
146
_ = input() T = list(map(int, input().split())) M = int(input()) for i in range(M): P, X = map(int, input().split()) ans = sum(T[:P]+T[P+1])+X
s332343703
p03845
u977193988
1557336859
Python
Python (3.4.3)
py
Runtime Error
17
2940
168
N=int(input()) T=[int(i) for i in raw_input().split()] M=int(input()) for i in range(M): p,x=map(int,raw_input().split()) time=sum(T)-T[p-1]+x print(time)
s649537661
p03845
u977193988
1557329957
Python
Python (3.4.3)
py
Runtime Error
17
2940
173
N=int(input()) T=[int(i) for i in raw_input().split()] M=int(input()) PX=[] for i in range(M): p,x=map(int,raw_input().split()) time=sum(T)-T[p-1]+x print(time)
s076775267
p03845
u977193988
1557329490
Python
Python (3.4.3)
py
Runtime Error
17
3064
338
N=int(input()) T=[int(i) for i in raw_input().split()] M=int(input()) PX=[] for i in range(M): PX.append([int(k) for k in raw_input().split()]) if N>=M: for h in range(M): time=sum(T)-(T[PX[h][0]-1]-PX[h][1]) print(time) else: for h in range(N): time=sum(T)-(T[PX[h][0]-1]-PX[h][1]) print(time)
s633626836
p03845
u977193988
1557329268
Python
Python (3.4.3)
py
Runtime Error
17
3060
224
N=int(input()) T=[int(i) for i in raw_input().split()] M=int(input()) PX=[] for i in range(M): PX.append([int(k) for k in raw_input().split()]) for h in range(M): time=sum(T)-(T[PX[h][0]-1]-PX[h][1]) print(time)
s869079209
p03845
u732870425
1556838954
Python
Python (3.4.3)
py
Runtime Error
17
3060
239
N = int(input()) T = list(map(int, input().split())) M = int(input()) PX = [list(map(int, input().split())) for _ in range(M)] sum_before = sum(T) for i in range(M): sum_after = sum_before - T[PX[i][0]] + PX[i][1] print(sum_after)
s395105375
p03845
u941753895
1556307287
Python
Python (3.4.3)
py
Runtime Error
17
3060
282
# 入力 N=int(input()) tl=list(map(int,input().split())) M=int(input()) # 和 sm=sum(tl) al=[] for i in range(N): P,X=map(int,input().split()) # 変更した場合の変化量を求める a=X-tl[P-1] # 解答を保存 al.append(sm+a) # 出力 for x in al: print(x)
s435644930
p03845
u941753895
1556307204
Python
Python (3.4.3)
py
Runtime Error
18
3060
229
# 入力 N=int(input()) tl=list(map(int,input().split())) M=int(input()) # 和 sm=sum(tl) for i in range(N): P,X=map(int,input().split()) # 変更した場合の変化量を求める a=X-tl[P-1] # 出力 print(sm+a)
s420341023
p03845
u658627575
1555422922
Python
Python (3.4.3)
py
Runtime Error
18
3060
407
N = int(input()) #N = int(line) #line = test_data.readline() T = [int(t) for t in input().split()] #T = [2,1,4] #T = [int(t) for t in test_data.readline().split()] total_time = sum(T) #line = test_data.readline() M = int(input()) #M = int(line) for i in range(M): #line = test_data.readline() P, X = map(int,input().split()) #P, X = map(int,line.split()) ans = 0 ans = total_time - T[i] + X print(ans)
s041224405
p03845
u658627575
1555422808
Python
Python (3.4.3)
py
Runtime Error
17
2940
389
N = input() #N = int(line) #line = test_data.readline() #T = [int(t) for t in input().split()] T = [2,1,4] #T = [int(t) for t in test_data.readline().split()] total_time = sum(T) #line = test_data.readline() M = input() #M = int(line) for i in range(M): #line = test_data.readline() P, X = input().split() #P, X = map(int,line.split()) ans = 0 ans = total_time - T[i] + X print(ans)
s194053052
p03845
u658627575
1555422749
Python
Python (3.4.3)
py
Runtime Error
18
2940
545
# ファイルをオープンする #test_data = open("test.txt", "r") # 行ごとにすべて読み込んでリストデータにする #line = test_data.readline() N = input() #N = int(line) #line = test_data.readline() T = [int(t) for t in input().split()] #T = [int(t) for t in test_data.readline().split()] total_time = sum(T) #line = test_data.readline() M = input() #M = int(line) for i in range(M): #line = test_data.readline() P, X = input().split() #P, X = map(int,line.split()) ans = 0 ans = total_time - T[i] + X print(ans)
s631609756
p03845
u658627575
1555422434
Python
Python (3.4.3)
py
Runtime Error
17
2940
545
# ファイルをオープンする #test_data = open("test.txt", "r") # 行ごとにすべて読み込んでリストデータにする #line = test_data.readline() N = input() #N = int(line) #line = test_data.readline() T = [int(t) for t in input().split()] #T = [int(t) for t in test_data.readline().split()] total_time = sum(T) #line = test_data.readline() M = input() #M = int(line) for i in range(M): #line = test_data.readline() P, X = input().split() #P, X = map(int,line.split()) ans = 0 ans = total_time - T[i] + X print(ans)
s840590405
p03845
u658627575
1555421884
Python
Python (3.4.3)
py
Runtime Error
17
2940
180
N = input() T = [int(t) for t in input.split()] total_time = sum(T) M = input() for i in range(M): P, X = input().split() ans = 0 ans = total_time - T[i] + X print(ans+"¥n")
s324305516
p03845
u658627575
1555421687
Python
Python (3.4.3)
py
Runtime Error
17
2940
181
N = input() T = [int(t) for t in input.split()] total_time = sum(T) M = input() for i in range(M): P, X = input().split() ans = 0 ans = total_time - N[i] + X print(ans+"¥n")
s594910439
p03845
u210827208
1555133405
Python
Python (3.4.3)
py
Runtime Error
17
2940
139
n=int(input()) T=list(map(int,input())) m=int(input()) for i in range(m): p,k=map(int,input().split()) T[p-1]=k print(sum(T))
s098832940
p03845
u225415456
1554409638
Python
Python (3.4.3)
py
Runtime Error
18
3060
170
N = int(input()) a = [int(x) for x in input().split()] M = int(input()) for i in range(M): x,y = map(int,input().split()) a[0] = x a[1] = y print(sum(a))
s958591945
p03845
u077019541
1553446190
Python
Python (3.4.3)
py
Runtime Error
17
3060
196
N = int(input()) Ts=list(map(int,input().split())) M = int(input()) for i in range(M): p,x = map(int,input().split()) anslist = copy.deepcopy(Ts) anslist[p-1]=x print(sum(anslist))
s011663172
p03845
u518042385
1553007340
Python
Python (3.4.3)
py
Runtime Error
18
2940
147
n=int(input()) l=list(input()) m=int(input()) time=0 for i in l: time+=i for i in range(m): p,x=map(int,input().split()) print(time-l(p-1)+x)
s687634127
p03845
u393512980
1552944636
Python
Python (3.4.3)
py
Runtime Error
17
3060
214
n=int(input()) t=list(map(int,input().split())) m=int(input()) p,x=[],[] for _ in range(m): _p,_x=map(int,input().split()) p.append(_p) x.append(_x) s=sum(t) for i in range(m): print(s-t[p[i]-1]+x[p[i]-1])
s999530152
p03845
u393512980
1552944546
Python
Python (3.4.3)
py
Runtime Error
18
3060
210
n=int(input()) t=list(map(int,input().split())) m=int(input()) p,x=[],[] for _ in range(m): _p,_x=map(int,input().split()) p.append(_p) x.append(_x) s=sum(t) for i in range(m): print(s-t[p[i]]+x[p[i]])
s192235619
p03845
u393512980
1552944452
Python
Python (3.4.3)
py
Runtime Error
17
3064
233
n=int(input()) t=list(map(int,input().split())) m=int(input()) p,x=[],[] for _ in range(m): _p,_x=map(int,input().split()) p.append(_p) x.append(_x) s=sum(t) ans=s for i in range(m): ans=min(ans,s-t[p[i]]+x[p[i]]) print(ans)
s996106151
p03845
u393512980
1552944394
Python
Python (3.4.3)
py
Runtime Error
17
3064
232
n=int(input()) t=list(map(int,input().split())) m=int(input()) p,x=[],[] for _ in range(m): _p,_x=map(int,input().split()) p.append(_p) x.append(_x) s=sum(t) ans=s for i in range(m): ans=min(ans,s-t[p[i]]+x[p[i]]) print(ans)
s042052351
p03845
u878138257
1552866118
Python
Python (3.4.3)
py
Runtime Error
19
3064
334
n = int(input()) listA = list(map(int, input().split())) m = int(input()) listB = [] while True: try: listB.append(list(map(int,input().split()))) except: break; for i in range(1,m+1): x=listA[listB[i][0]] listA[listB[i][0]] = listB[i][1] s=0 for j in range(n): s = s+listA[j] print(s) listA[listB[i][0]]=x
s352160354
p03845
u878138257
1552865972
Python
Python (3.4.3)
py
Runtime Error
17
3064
335
n = int(input()) listA = list(int, input().split()) m = int(input()) listB = [] while True: try: listB.append(list(map(int,input().split()))) except: break; for i in range(1,m+1): x=listA[listB[i][0]] listA[listB[i][0]] = listB[i][1] s=0 for j in range(n): s = s+listA[j] print(s) listA[listB[i][0]]=x
s480512440
p03845
u945418216
1552323788
Python
Python (3.4.3)
py
Runtime Error
17
3060
204
n = int(input()) tt = list(map(int, input().split())) m = int(input()) drinks = [list(map(int,input().split())) for _ in range(m)] ans = sum(tt) for i in range(m): print(ans - (tt[i] - drinks[i][1]))
s131332011
p03845
u555947166
1552016001
Python
Python (3.4.3)
py
Runtime Error
18
3060
190
N = int(input()) Tlist = list(map(int, input().split())) M = int(input()) PX = [list(map(int, input().split())) for i in range(M)] for i in range(M): print(sum(Tlist)-Tlist[i]+PX[i][1])
s307192687
p03845
u449555432
1550988327
Python
Python (3.4.3)
py
Runtime Error
20
3064
226
n=int(input()) t = list(map(int,input().split())) m = int(input()) l = [list(map(int,input().split())) for i in range(m)] print(sum(t)-t[l[0][0]-1]+l[0][1]) print(sum(t)-t[l[1][0]-1]+l[1][1]) print(sum(t)-t[l[2][0]-1]+l[2][1])
s782628266
p03845
u449555432
1550988302
Python
Python (3.4.3)
py
Runtime Error
18
3064
244
n=int(input()) t = list(map(int,input().split())) m = int(input()) l = [list(map(int,input().split())) for i in range(m)] print(t) print(l) print(sum(t)-t[l[0][0]-1]+l[0][1]) print(sum(t)-t[l[1][0]-1]+l[1][1]) print(sum(t)-t[l[2][0]-1]+l[2][1])
s645121554
p03845
u518064858
1550702187
Python
Python (3.4.3)
py
Runtime Error
18
3060
248
n=int(input()) t=list(map(int,input.split())) m=int(input()) for i in range(m): p,x=map(int,input().split()) s=0 for j in range(len(t)): if j==p-1: s+=x else: s+=t[j] print(s)
s001873582
p03845
u796942881
1550584240
Python
Python (3.4.3)
py
Runtime Error
18
3060
261
N = int(input()) T = [int(i) for i in input().split()] M = int(input()) PX = [] for i in range(M): # 0-indexed PX.append([int(j) for j in input().split()]) PX[i][0] -= 1 ans = sum(T) for i in range(M): print(ans - T[PX[i][0]] + T[PX[i][1]])
s300821960
p03845
u796942881
1550584191
Python
Python (3.4.3)
py
Runtime Error
18
3060
261
N = int(input()) T = [int(i) for i in input().split()] M = int(input()) PX = [] for i in range(M): # 0-indexed PX.append([int(j) for j in input().split()]) PX[i][0] -= 1 ans = sum(T) for i in range(M): print(ans - T[PX[i][0]] + T[PX[i][1]])
s311689399
p03845
u239981649
1549002174
Python
PyPy3 (2.4.0)
py
Runtime Error
184
38384
168
n = int(input()) *a0, = map(int, input().split()) m = int(input()) for _ in range(m): k, b = map(int, input().split()) a = a0[:] a[k] = b print(sum(a))
s939314537
p03845
u316386814
1548976165
Python
Python (3.4.3)
py
Runtime Error
19
3060
179
n = int(input()) ts = list(map(int, input().split())) su = sum(ts) m = int(input()) for _ in range(m): p, x = list(map(int, input().split())) ans = su - ts[p] + x print(ans)
s580159982
p03845
u316386814
1548976138
Python
Python (3.4.3)
py
Runtime Error
18
2940
181
n = int(input()) ts = list(map(int, input().split()))) su = sum(ts) m = int(input()) for _ in range(m): p, x = list(map(int, input().split()))) ans = su - ts[p] + x print(ans)
s880892720
p03845
u316386814
1548976071
Python
Python (3.4.3)
py
Runtime Error
18
2940
179
n = int(input()) ts = list(map(int, input(.split()))) su = sum(ts) m = int(input()) for _ in range(m): p, x = list(map(int, input(.split()))) ans = su - ts[p] + x print(ans)
s230161222
p03845
u667024514
1548713737
Python
Python (3.4.3)
py
Runtime Error
19
3060
163
n = int(input()) lis = list(map(int,input().split())) m = int(input()) num = sum(lis) for i in range(n): a,b = map(int,input().split()) print(num-(lis[a-1]-b))
s230481748
p03845
u762682474
1548680370
Python
Python (3.4.3)
py
Runtime Error
18
3064
405
def execute(n, tn, m, pxm): result = [] for px in pxm: cp = tn[:] cp[px[0] - 1] = px[1] result.append(sum(cp)) return result if __name__ == '__main__': n = int(input()) tn = map(int, input().split()) m = int(input()) pxm = [] for _ in range(m): p, x = map(int, input().split()) pxm.append([p, x]) print(execute(n, tn, m, pxm))
s757113479
p03845
u273201018
1548622860
Python
Python (3.4.3)
py
Runtime Error
17
3060
176
N = int(input()) T = list(map(int, input().split())) S = sum(T) M = int(input()) PX = [int(input()) for _ in range(M)] for px in PX: P, X = px print(S - T[P-1] + X)
s151854400
p03845
u740284863
1546569479
Python
Python (3.4.3)
py
Runtime Error
18
2940
208
N = int(input()) Problems = list(map(int,input().split())) results = [] M = int(input()) for i in range(M): temPro = Problems p,t = map(int,input().split()) temPro[p-1] = t print(sum(temPro))
s583530032
p03845
u740284863
1546569236
Python
Python (3.4.3)
py
Runtime Error
19
2940
175
N = int(input()) Problems = list(map(int,input().split())) M = int(input()) for i in range(M): p,t = map(int,input().split()) Problems[p] = t print(sum(Problems))
s887473856
p03845
u726439578
1546547368
Python
Python (3.4.3)
py
Runtime Error
18
3064
250
n=int(input()) t=list(map(int,input().split())) m=int(input()) p1=[] x1=[] for i in range(m): p,x=map(int,input().split()) p1.append(p) x1.append(x) for i in range(m): print(p1[i]) print(x1[i]) print(sum(t)-t[p1[i]]+x1[p1[i]])
s650631333
p03845
u726439578
1546546608
Python
Python (3.4.3)
py
Runtime Error
18
3064
220
n=int(input()) t=list(map(int,input().split())) m=int(input()) p1=[] x1=[] for i in range(m): p,x=map(int,input().split()) p1.append(p) x1.append(x) for i in range(m): print(sum(t)-t[p1[i]-1]+x1[p1[i]-1])
s779183368
p03845
u089032001
1546376564
Python
Python (3.4.3)
py
Runtime Error
18
3060
162
n = int(input()) T = list(map(int, input().split())) sumT = sum(T) m = int(input()) for i in range(m): a, b = map(int, input().split()) print(sumT - T[a] + b)
s343266904
p03845
u089032001
1546376434
Python
Python (3.4.3)
py
Runtime Error
18
3060
170
n = int(input()) T = list(map(int, input().split())) sumT = sum(T) m = int(input()) D = list(map(int, input().split())) for i, d in enumerate(D): print(sumT - T[i] + d)
s522894812
p03845
u853900545
1545453320
Python
Python (3.4.3)
py
Runtime Error
19
3060
145
n=int(input()) a=list(map(int,input().split())) m=int(input()) s=sum(a) for i in range(m): p,x=map(int,input().split()) print(s+x-a[p+1])
s227790512
p03845
u111365959
1542941285
Python
Python (3.4.3)
py
Runtime Error
17
3060
153
n = int(input()) a = [input() for _ in range(n)] m = int(input()) for _ in range(m): b,c = [int(x) for x in input.split()] a[b-1] = c print(sum(a))
s464052013
p03845
u111365959
1542941205
Python
Python (3.4.3)
py
Runtime Error
17
3060
143
n = input() a = [input() for _ in range(n)] m = input() for _ in range(m): b,c = [int(x) for x in input.split()] a[b-1] = c print(sum(a))
s025440187
p03845
u448743361
1542114345
Python
Python (3.4.3)
py
Runtime Error
18
3064
240
n=int(input()) t=list(map(int,input().split())) m=int(input()) maxn=[] for i in range(m): tem=0 p,m=map(int,input().split()) tem=t[p-1] t[p-1]=m maxn.append(sum(t)) t[p-1]=tem for i in range(m-1): print(maxn[i])
s486282470
p03845
u733321071
1542045313
Python
Python (3.4.3)
py
Runtime Error
19
2940
170
# -*- coding: utf-8 n = int(input()) t = list(map(int, input().split())) for i in range(int(input())): p, x = map(int, input().split()) print(sum(t) - t[p] + x)
s962250555
p03845
u733321071
1542045282
Python
Python (3.4.3)
py
Runtime Error
19
2940
170
# -*- coding: utf-8 n = int(input()) t = list(map(int, input().split())) for i in range(int(input())): p, x = map(int, input().split()) print(sum(t) - t[p] + x)
s946054447
p03845
u240793404
1540906254
Python
Python (3.4.3)
py
Runtime Error
30
3444
294
from copy import deepcopy n = int(input()) t = list(map(int,input().split())) m = int(input()) p = [] x = [] for i in range(m): tmpp,tmpx = map(int,input().split()) p.append(tmpp) x.append(tmpx) for j in p: tmplist = deepcopy(t) tmplist[j-1] = x[j-1] print(sum(tmplist))
s149075229
p03845
u957722693
1540298342
Python
Python (3.4.3)
py
Runtime Error
18
3060
254
n=int(input()) t=list(map(int,input().split())) m=int(input()) drink=[] all=sum(t) for i in range(m): drink.append(list(map(int,input().split()))) for j in range(m): if drink[j][0]<=n: print(all-t[drink[j][0]]+drink[j][1]) else: print(all)
s682883079
p03845
u957722693
1540298023
Python
Python (3.4.3)
py
Runtime Error
17
3064
207
n=int(input()) t=list(map(int,input().split())) m=int(input()) drink=[] all=sum(t) for i in range(m): drink.append(list(map(int,input().split()))) for j in range(m): print(all-t[drink[j][0]]+drink[j][1])
s488091271
p03845
u957722693
1540297535
Python
Python (3.4.3)
py
Runtime Error
17
3064
192
n=int(input()) t=list(map(int,input().split())) m=int(input()) drink=[] all=sum(t) for i in range(m): drink[i]=list(map(int,input().split())) for j in range(n): print(all-t[j]+drink[j][1])
s352390129
p03845
u247366051
1539310643
Python
Python (3.4.3)
py
Runtime Error
17
2940
173
n = int(raw_input()) t = map(int, raw_input().split()) s = sum(t) m = int(raw_input()) for _ in range(m): p, x = map(int, raw_input().split()) print s - t[p - 1] + x
s472265734
p03845
u702759722
1539163171
Python
Python (3.4.3)
py
Runtime Error
17
3060
204
# -*- coding: utf-8 -*- # 入力 N = int(input()) T = map(int, input().split()) M = int(input()) for i in range(0, M): p, x = map(int, input().split()) Time = sum(T) - T[p - 1] + x print(Time)
s799129840
p03845
u853900545
1538622506
Python
Python (3.4.3)
py
Runtime Error
17
3064
311
n = int(input()) t = list(map(int,input().split())) m = int(input()) p = [] s = sum(t) for i in range(m): p.append(input().split()) if n<=m: for i in range(m): print(s-t[i]+int(p[i][1])) else: for i in range(n): print(s-t[i]+int(p[i][1])) for i in range(n-m): print(s)
s271702752
p03845
u853900545
1538622361
Python
Python (3.4.3)
py
Runtime Error
17
3060
188
n = int(input()) t = list(map(int,input().split())) m = int(input()) p = [] s = sum(t) for i in range(m): p.append(input().split()) for i in range(m): print(s-t[i]+int(p[i][1]))
s065357704
p03845
u853900545
1538622047
Python
Python (3.4.3)
py
Runtime Error
17
3060
180
n = int(input()) t = list(map(int,input().split())) m = int(input()) p = [] s = sum(t) for i in range(m): p.append(input().split()) for i in range(m): print(s-t[i]+p[i])
s524970746
p03845
u853900545
1538621956
Python
Python (3.4.3)
py
Runtime Error
17
3060
180
n = int(input()) t = list(map(int,input().split())) m = int(input()) p = [] s = sum(t) for i in range(m): p.attend(input().split()) for i in range(m): print(s-t[i]+p[i])
s008933163
p03845
u940102677
1538536471
Python
Python (3.4.3)
py
Runtime Error
17
2940
147
n = int(input()) t = [0] + list(map(int,input().split())) s = sum(t) for _ in [0]*int(input()): p,x = map(int,input().split()) pritn(s-t[p]+x)
s231384843
p03845
u278864208
1535219060
Python
Python (3.4.3)
py
Runtime Error
18
3064
247
N = int(input()) Ts = input().split() Ts = [int(i) for i in Ts] Tsum = sum(Ts) M = int(input()) res_list = [] for i in range(M): P,X = map(int,input().split()) res = Tsum - Ts[i] + X res_list.append(res) for i in res_list: print(i)
s393888947
p03845
u278864208
1535219001
Python
Python (3.4.3)
py
Runtime Error
18
3060
191
N = int(input()) Ts = input().split() Ts = [int(i) for i in Ts] Tsum = sum(Ts) M = int(input()) for i in range(M): P,X = map(int,input().split()) res = Tsum - Ts[i] + X print(res)
s789396826
p03845
u787562674
1535168326
Python
Python (2.7.6)
py
Runtime Error
10
2568
249
N = int(input()) T_list = [int(i) for i in input().split()] M = int(input()) M_list = [[int(i) for i in input().split()] for i in range(M)] base_value = sum(T_list) for i in range(M): print(base_value - (T_list[M_list[i][0]-1] - M_list[i][1]))
s413462446
p03845
u858136677
1534727870
Python
Python (3.4.3)
py
Runtime Error
17
2940
298
#include <iostream> #include <vector> using namespace std; int main(){ int n; cin >> n; int t[n]; int sum; for(int i=0; i<n; i++){ cin >> t[i]; sum += t[i]; } int m; cin >> m; int p,x; for(int i=0; i<m; i++){ cin >> p >> x; cout << sum-t[p-1]+x << endl; } }
s371398134
p03845
u275934251
1534560922
Python
Python (3.4.3)
py
Runtime Error
18
2940
170
N = int(input()) t = map(int, input().split()) M = int(input()) cal = sum(t) for j in range(M): p, x = map(int, input().split()) print(cal - t[p - 1] + x)
s548157419
p03845
u275934251
1534560751
Python
Python (3.4.3)
py
Runtime Error
17
3060
172
N = int(input()) t = map(int, input().split()) M = int(input()) cal = sum(t) for j in range(M): p, x = map(int, input().split()) print(cal - t[[p] - 1] + x)
s406941793
p03845
u275934251
1534560593
Python
Python (3.4.3)
py
Runtime Error
18
3060
178
N = int(input()) t = map(int, input().split()) M = int(input()) cal = sum(t) for j in range(M): p, x = list(map(int, input().split())) print(cal - t[[p] - 1] + x)
s662330289
p03845
u275934251
1534560303
Python
Python (3.4.3)
py
Runtime Error
17
3060
193
N = int(input()) t = [int(input().split()) for i in range(N)] M = int(input()) cal = sum(t) for j in range(M): p, x = list(map(int, input().split())) print(cal - t[[p] - 1] + x)
s261233613
p03845
u275934251
1534559710
Python
Python (3.4.3)
py
Runtime Error
17
3060
205
N = int(input()) t = [int(input().split()) for i in range(N)] M = int(input()) a = list(map(int, input().split())) cal = sum(t) for j in range(M): print(cal - t[a[j][0] - 1] + a[j][1])
s798176481
p03845
u275934251
1534559704
Python
Python (3.4.3)
py
Runtime Error
17
3060
205
N = int(input()) t = [int(input().split()) for i in range(N)] M = int(input()) a = list(map(int, input().split())) cal = sum(t) for j in range(M): print(cal - t[a[j][0] - 1] + a[j][1])
s942981025
p03845
u275934251
1534559502
Python
Python (3.4.3)
py
Runtime Error
17
3064
227
N = int(input()) t = [int(input().split()) for i in range(N)] M = int(input()) for k in range(M): a = list(map(int, input().split())) cal = sum(t) for j in range(M): print(cal - t[a[j][0] - 1] + a[j][1])
s437661067
p03845
u275934251
1534559352
Python
Python (3.4.3)
py
Runtime Error
18
3064
227
N = int(input()) t = [int(input().split()) for i in range(N)] M = int(input()) a = [] for k in range(M): a.append(map(int, input())) cal = sum(t) for j in range(M): print(cal - t[a[j][0] - 1] + a[j][1])
s985458926
p03845
u275934251
1534558381
Python
Python (3.4.3)
py
Runtime Error
18
3064
235
N = int(input()) t = [int(input().split()) for i in range(N)] M = int(input()) a = [] for k in range(M): a.append(map(int, input().split())) cal = sum(t) for j in range(M): print(cal - t[a[j][0] - 1] + a[j][1])
s402912984
p03845
u275934251
1534556969
Python
Python (3.4.3)
py
Runtime Error
17
3064
227
N = int(input()) t = [int(input()) for i in range(N)] M = int(input()) a = [] for k in range(M): a.append(map(int, input().split())) cal = sum(t) for j in range(M): print(cal - t[a[j][0] - 1] + a[j][1])
s350608436
p03845
u275934251
1534556844
Python
Python (3.4.3)
py
Runtime Error
18
3064
227
N = int(input()) t = [int(input()) for i in range(N)] M = int(input()) a = [] for i in range(M): a.append(map(int, input().split())) cal = sum(t) for j in range(M): print(cal - t[a[j][0] - 1] + a[j][1])
s221635216
p03845
u275934251
1534556444
Python
Python (3.4.3)
py
Runtime Error
17
3060
232
N = int(input()) t = [int(input()) for i in range(N)] M = int(input()) a = [] for i in range(2): a.append(map(int, raw_input().split())) cal = sum(t) for j in range(M): print(cal - t[a[j][0] - 1] + a[j][1])
s996350434
p03845
u275934251
1534554917
Python
Python (3.4.3)
py
Runtime Error
18
3060
232
N = int(input()) t = [int(input()) for i in range(N)] M = int(input()) a = [] for i in range(M): a.append(map(int, raw_input().split())) cal = sum(t) for j in range(M): print(cal - t[a[j][0] - 1] + a[j][1])
s104247572
p03845
u275934251
1534554498
Python
Python (3.4.3)
py
Runtime Error
18
3060
227
N = int(input()) t = [input() for i in range(N)] M = int(input()) a = [] for i in range(M): a.append(map(int, raw_input().split())) cal = sum(t) for j in range(M): print(cal - t[a[j][0] - 1] + a[j][1])
s911750572
p03845
u275934251
1534554427
Python
Python (3.4.3)
py
Runtime Error
18
3064
454
N = int(input()) t = [input() for i in range(N)] M = int(input()) a = [] for i in range(M): a.append(map(int, raw_input().split())) cal = sum(t) for j in range(M): print(cal - t[a[j][0] - 1] + a[j][1]) N = int(input()) t = [input() for i in range(N)] M = int(input()) a = [] for i in range(M): a.append(map(int, raw_input().split())) cal = sum(t) for j in range(M): print(cal - t[a[j][0] - 1] + a[j][1])
s375666818
p03845
u275934251
1534553680
Python
Python (3.4.3)
py
Runtime Error
17
3060
236
N = int(input()) t = [input() for i in range(N)] M = input() a = [] for i in range(M): a.append(map(int, raw_input().split())) #a=[[P1 X1]みたいな] cal = sum(t) for j in range(M): print(cal - t[a[j][0]] + a[j][1])
s875293950
p03845
u277802731
1534209856
Python
Python (3.4.3)
py
Runtime Error
17
3060
275
#50b #n 問題数 n = int(input()) #t 時間 t = [int(i) for i in input().split()] #m ドリンクの種類 m = int(input()) ans = [] for i in range(m): a,b = map(int,input().split()) temp = sum(t) - t[a-1] + b ans[i] = temp for i in range(m): print(ans[i])
s365773984
p03845
u140251125
1533776282
Python
Python (3.4.3)
py
Runtime Error
18
3060
223
# input N = int(input()) T = list(map(int, input().split())) M = int(input()) P = [list(map(int, input().split())) for _ in range(M)] for i in range(M): T[P[i][0]] -= P[i][1] print(sum(T)) T[P[i][0]] += P[i][1]
s199543041
p03845
u136395536
1528448150
Python
Python (3.4.3)
py
Runtime Error
17
2940
243
N = int(input()) t = input().split() T = [] for i in range(N): T.append(int(t[i])) M = int(input()) time = [] total = sum(T) for k in range(M): p,x = (int(i) for i in input().split()) time.append(total - T[p] + x) print(time)
s108222615
p03845
u136395536
1528448087
Python
Python (3.4.3)
py
Runtime Error
17
2940
243
N = int(input()) t = input().split() T = [] for i in range(N): T.append(int(t[i])) M = int(input()) time = [] total = sum(T) for i in range(M): p,x = (int(i) for i in input().split()) time.append(total - T[p] + x) print(time)
s352266443
p03845
u399280934
1528255741
Python
Python (3.4.3)
py
Runtime Error
18
2940
139
n=int(input()) t=list(map(int,input().split())) m=int(input()) for i in range(m): p,x=map(int,input().split()) print(sum(t)-t[i]+x)
s359227711
p03845
u403355272
1526685783
Python
Python (3.4.3)
py
Runtime Error
17
3064
226
N = int(input()) T = list(map(int,input().split())) M = int(input()) P,X = [],[] for i in range(M): p,x = map(int,input().split()) P.append(p - 1) X.append(x) sumA = sum(T) for lack in range(M): print(T + X[i] + T[P[i]] )
s231319112
p03845
u284102701
1517508358
Python
Python (3.4.3)
py
Runtime Error
17
2940
820
#include <bits/stdc++.h> //#include <math.h> using namespace std; #define INF 1.1e9 #define LINF 1.1e18 #define FOR(i,a,b) for (int i=(a);i<(b);++i) #define REP(i,n) FOR(i,0,n) #define ALL(v) (v).begin(),(v).end() #define pb push_back #define pf push_front #define fi first #define se second #define BIT(x,n) bitset<n>(x) #define PI 3.14159265358979323846 typedef long long ll; typedef pair<int,int> P; typedef pair<ll,P> PP; void chmax(int &a,int b) { a=max(a,b); } void chmin(int &a,int b) { a=min(a,b); } //----------------------------------------------------------------------------- int n,m; int sum; int t[100]; int main() { cin.tie(0); ios::sync_with_stdio(false); cin>>n; REP(i,n) { cin>>t[i]; sum+=t[i]; } cin>>m; REP(i,m) { int p,x;cin>>p>>x;p--; cout<<sum-t[p]+x<<endl; } return 0; }
s285217470
p03845
u976162616
1496096922
Python
Python (3.4.3)
py
Runtime Error
17
2940
406
N = int(input()) T = list(map(int, input().split())) M = int(input()) data = [] for x in range(M): p,x = map(int, input().split()) p -= 1 data.append([p, x]) result = 2 ** 60 for p,x in data: res = 0 for i,t in enumerate(T): if (i == p): res += x else: res += t print (res)
s946447813
p03845
u481333386
1490488448
Python
Python (3.4.3)
py
Runtime Error
30
3700
443
# -*- coding: utf-8 -*- from copy import deepcopy def main(): problems = int(input()) solve_times = [int(e) for e in input().split()] drinks = int(input()) for i in range(drinks): solve_times_copy = deepcopy(solve_times_copy) problem_idx, solve_time = [int(e) for e in input().split()] problem_idx -= 1 solve_times_copy[problem_idx] = solve_time print(sum(solve_times_copy)) main()
s691182289
p03845
u481333386
1490488327
Python
Python (3.4.3)
py
Runtime Error
35
3956
450
# -*- coding: utf-8 -*- from copy import deepcopy def main(): problems = int(input()) solve_times = [int(e) for e in input().split()] drinks = int(input()) for i in range(drinks): solve_times_copy = deepcopy(solve_times_copy) problem_idx, solve_time = [int(e) for e in input().split()] problem_idx -= 1 solve_times_copy[problem_idx] = solve_time print(sum(solve_times_copy)) print(main())
s546642641
p03845
u802614675
1483381849
Python
Python (2.7.6)
py
Runtime Error
16
2568
243
_ = raw_input() tests = [int(test) for test in raw_input().split(" ")] total_time = sum(tests) drinks = raw_input() for _ in range(drinks): i = raw_input().split(" ") no, time = i[0], i[1] print total_time - (tests[no - 1] - time)
s683807926
p03845
u095015466
1482185599
Python
Python (2.7.6)
py
Runtime Error
17
2568
149
n=int(raw_input()) t=map(int,raw_input().split()) total=sum(t) m=int(raw_input()) for _ in xrange(m): p,x=map(int,raw_input()) print total-t[p-1]+x
s961491878
p03845
u095015466
1482185522
Python
Python (2.7.6)
py
Runtime Error
16
2568
147
n=int(raw_input()) t=map(int,raw_input().split()) total=sum(t) m=int(raw_input()) for _ in xrange(m): p,x=map(int,raw_input()) print sum-t[p-1]+x
s395184217
p03845
u272028993
1482160687
Python
Python (2.7.6)
py
Runtime Error
18
2568
274
n=int(raw_input()) t=map(int,raw_input().split()) m=int(raw_input()) xt=[map(int,raw_input().split()) for _ in xrange(m)] ans=[0]*m for i in xrange(m): tmp=t tmp[xt[i][0]]=xt[i][1] for j in xrange(n): ans[i]+=tmp[j] for j in xrange(n): print(ans[j])
s176003717
p03845
u270343876
1482123069
Python
Python (2.7.6)
py
Runtime Error
16
2568
176
N = int(raw_input()) line = map(int,raw_input().split(' ')) M = int(raw_input()) for i in range(M): x = map(int,raw_input().split(' ') print sum(line)-(line[x[0]]-x[1])