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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
s817946705 | p03844 | u419832736 | 1495253031 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 118 | A, op, B = input().split()
if op == "+" :
input (int(A) + int(B))
if op == "-" :
input (int(A) - int(B))
input() |
s292635411 | p03844 | u052746401 | 1491110358 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3444 | 530 | import copy
n = int(input())
a = list(map(int, input().split()))
a.sort()
flag = True
if n % 2 == 1:
if a[0] != 0:
print(0)
else:
ans = [i for i in range(2, n, 2) for j in range(2)]
ans.insert(0, 0)
if ans != a:
print(0)
flag = False
if flag:
print((2**((n - 1) // 2)) % (1e9 + 7))
else:
ans = [i for i in range(1, n, 2) for j in range(2)]
if ans != a:
print(0)
flag = False
if flag:
print((2**(n // 2)) % (1e9 + 7))
|
s362821945 | p03844 | u252805217 | 1487104430 | Python | Python (3.4.3) | py | Runtime Error | 24 | 3064 | 341 | n = int(input())
a = [int(x) for x in input().split()]
def is_satisfied(s):
ln = len(s)
check = [s.count(i) == 2 for i in range(ln - 1, 1, -2)]
if ln % 2 == 0:
check.append(s.count(1) == 2)
else:
check.append(s.count(0) == 1)
return all(check)
ans = 2 ** (n // 2) if is_satisfied(a) else 0
print(ans)
|
s633914383 | p03844 | u425351967 | 1485963317 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3064 | 472 | N=int(input())
A=[int(n) for n in input().split()]
div=10**9+7
A.sort()
if N % 2 == 0:
for i in range(int(N/2)):
if A[2*i] != 2*i+1 or A[2*i+1] != 2*i+1:
print (0)
sys.exit()
print(2**int(N/2) % div)
if N % 2 == 1:
if A[0]!=0:
print(0)
sys.exit()
for i in range(int((N-1)/2)):
if A[2*i+1] !=2*i+2 or A[2*i+2]!= 2*i+2:
print(0)
sys.exit()
print(2**int((N-1)/2) % div)
|
s696203267 | p03844 | u327543932 | 1485387428 | Python | Python (2.7.6) | py | Runtime Error | 16 | 2696 | 80 | a,op,b=raw_input().split()
if op=='+':
print a+b
else op=='-':
print a-b |
s148842533 | p03844 | u755962107 | 1483880043 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3068 | 129 | arr = input().split()
if arr[1] == "+"
print(int(arr[0]) + int(arr[2]))
elif arr[1] == "-"
print(int(arr[0]) - int(arr[2])) |
s107046257 | p03844 | u802614675 | 1483381784 | Python | Python (2.7.6) | py | Runtime Error | 16 | 2568 | 239 | _ = 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] - time)
|
s804514830 | p03844 | u449045132 | 1483377750 | Python | Python (2.7.6) | py | Runtime Error | 17 | 2568 | 591 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import sys
def main():
count = int(raw_input())
li = [int(n) for n in raw_input().split()]
if count%2 == 1: # 奇数
if li.count(0) != 1:
print 0
return
for i in range(count)[2::2]:
if li.count(i) != 2:
print 0
return
print 2**(count/2)
else: # 偶数
for i in range(count)[1::2]:
if li.count(i) != 2:
print 0
return
print 2**(count/2)
if __name__ == "__main__":
main() |
s714461986 | p03844 | u449045132 | 1483373619 | Python | Python (2.7.6) | py | Runtime Error | 16 | 2684 | 488 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import sys
def read_data():
lines = [line.rstrip() for line in sys.stdin]
ns = [int(n) for n in lines[1].split()]
ms = []
for line in lines[3:]:
num, sec = line.split()
ms.append((int(num)-1, int(sec)))
return ns, ms
def main():
ns, ms = read_data()
for (drink_num, drink_sec) in ms:
result = sum(ns) - ns[drink_num] + drink_sec
print result
if __name__ == "__main__":
main() |
s039400476 | p03844 | u449045132 | 1483373258 | Python | Python (2.7.6) | py | Runtime Error | 17 | 2684 | 455 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import sys
def read_data():
lines = [line.rstrip() for line in sys.stdin]
ns = [int(n) for n in lines[1].split()]
ms = [(int(line.split()[0]), int(line.split()[1])) for line in lines[3:]]
return ns, ms
def main():
ns, ms = read_data()
for (drink_num, drink_sec) in ms:
result = sum(ns) - ns[drink_num-1] + drink_sec
print result
if __name__ == "__main__":
main() |
s535430230 | p03844 | u012693733 | 1483327534 | Python | Python (2.7.6) | py | Runtime Error | 18 | 2820 | 407 | #input
T = []
N = int(raw_input())
T = raw_input().split()
M = int(raw_input())
PX = []
X = 0
T1 = []
#input matrix
for i in range(M):
PX.append(map(int,raw_input().split()))
for j in range(M):
#new time
T1 = T[:]
PJ = PX[j][0]
XJ = PX[j][1]
a = int(PJ)
b = int(XJ)
T1[a-1] = b
#plus each time
X = 0
for k in range(N):
X += int(T1[k])
print X
|
s124185748 | p03844 | u504419796 | 1483219241 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3064 | 143 | A = int(input())
B = int(input())
OP = input(plus_minus)
if OP == "-":
print(int(A) + int(B))
elif OP == "+":
print(int(A) - int(B))
|
s169901748 | p03844 | u504419796 | 1483219050 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3068 | 139 | A = int(input())
B = int(input())
OP = input(plus_minus)
if OP == -:
print(int(A) + int(B))
elif OP == +:
print(int(A) - int(B))
|
s654767600 | p03844 | u504419796 | 1483218405 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3064 | 66 | A = input()
B = input()
op = + or -
print(int(A) + op + int(B))
|
s080526331 | p03844 | u513091050 | 1483218399 | Python | Python (2.7.6) | py | Runtime Error | 17 | 2568 | 274 | import sys
def main():
arg = sys.argv[1:]
a = int(arg[0])
b = int(arg[2])
op = arg[1]
#if a < 1 or b > 10 **9:
# return 0
if op == "+":
return a + b
elif op == "-":
return a - b
#else:
# return 0
print main()
|
s028625904 | p03844 | u513091050 | 1483218260 | Python | Python (2.7.6) | py | Runtime Error | 17 | 2568 | 270 | import sys
def main():
arg = sys.argv[1:]
a = int(arg[0])
b = int(arg[2])
op = arg[1]
if a < 1 or b > 10 **9:
return 0
if op == "+":
return a + b
elif op == "-":
return a - b
else:
return 0
print main()
|
s773839402 | p03844 | u513091050 | 1483218259 | Python | Python (2.7.6) | py | Runtime Error | 17 | 2568 | 270 | import sys
def main():
arg = sys.argv[1:]
a = int(arg[0])
b = int(arg[2])
op = arg[1]
if a < 1 or b > 10 **9:
return 0
if op == "+":
return a + b
elif op == "-":
return a - b
else:
return 0
print main()
|
s947821534 | p03844 | u513091050 | 1483217509 | Python | Python (2.7.6) | py | Runtime Error | 17 | 2568 | 216 | import sys
def main():
arg = sys.argv[1:]
if arg[1] == "+":
return int(arg[0]) + int(arg[2])
elif arg[1] == "-":
return int(arg[0]) - int(arg[2])
else:
return 0
print main()
|
s728537511 | p03844 | u461592867 | 1482986977 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3064 | 62 | a, op, b = input().split()
a = int(a)
b = int(b)
print(a op b) |
s414430952 | p03844 | u338422115 | 1482855495 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3064 | 293 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
N=int(input())
T=input().split()
X=[]
for i in range(int(input())):
X.append(input().split()[1])
T=list(map(int,T))
X=list(map(int,X))
for y in range(len(X)):
T_tmp = T
X_tmp = X
T_tmp[y] = X_tmp[y]
print(sum(T_tmp))
|
s160617463 | p03844 | u338422115 | 1482855354 | Python | Python (3.4.3) | py | Runtime Error | 24 | 3064 | 251 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
N=int(input())
T=input().split()
X=[]
for i in range(int(input())):
X.append(input().split()[1])
T=list(map(int,T))
X=list(map(int,X))
for y in range(len(X)):
T[y]=X[y]
print(sum(T))
|
s888050190 | p03844 | u359930418 | 1482521292 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3064 | 132 | A, op, B = (input()).split()
A = int(A)
B = int(B)
op = str("+", "-")
if op =="+":
print(A + B)
elif op == "-":
print(A - B) |
s312699378 | p03844 | u359930418 | 1482520879 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3064 | 135 | A, op, B = str(input()).split()
A = int(A)
B = int(B)
op = str("+", "-")
if op =="+":
print(A + B)
elif op == "-":
print(A - B) |
s716724760 | p03844 | u359930418 | 1482520426 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3064 | 133 | A, op, B = str(input()).split("")
A = int(A)
B = int(B)
op = str("+", "-")
if op =="+":
print(A+B)
elif op == "-":
print(A-B) |
s452746165 | p03844 | u359930418 | 1482520073 | Python | Python (3.4.3) | py | Runtime Error | 24 | 3064 | 131 | A, op, B = str(input()).split()
A = int(A)
B = int(B)
op = str("+", "-")
if op =="+":
print(A+B)
elif op == "-":
print(A-B) |
s934387393 | p03844 | u359930418 | 1482519756 | Python | Python (3.4.3) | py | Runtime Error | 24 | 3188 | 130 | A, op, B = str(input()).split
A = int(A)
B = int(B)
op = str("+", "-")
if op =="+":
print(A+B)
elif op == "-":
print(A-B)
|
s951154321 | p03844 | u359930418 | 1482519452 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3064 | 124 | A, op, B = str(input())
A = int(A)
B = int(B)
op = str("+", "-")
if op =="+":
print(A+B)
elif op == "-":
print(A-B)
|
s397909840 | p03844 | u359930418 | 1482518654 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3064 | 119 | A, op, B = input()
A = int(A)
B = int(B)
op = str("+", "-")
if op =="+":
print(A+B)
elif op == "-":
print(A-B)
|
s853750303 | p03844 | u359930418 | 1482518436 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3064 | 100 | A, op, B = input()
A = int(A)
B = int(B)
if op =="+":
print(A+B)
elif op == "-":
print(A-B)
|
s788745056 | p03844 | u359930418 | 1482518086 | Python | Python (3.4.3) | py | Runtime Error | 24 | 3064 | 99 | A, op, B = input()
A = int(A)
B = int(B)
if op =="+":
print(A+B)
else op == "-":
print(A-B) |
s386220210 | p03844 | u359930418 | 1482516859 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3064 | 66 | A = int(input())
B = int(input())
op = "+" or "-"
print(A op B)
|
s238606329 | p03844 | u359930418 | 1482516762 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3064 | 63 | A = int(input())
B = int(input())
print(A + B)
print(A - B)
|
s940769960 | p03844 | u359930418 | 1482516658 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3064 | 61 | a = int(input())
b = int(input())
print(a + b)
print(a - b)
|
s729737288 | p03844 | u359930418 | 1482516590 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3064 | 69 | a = int(input())
b = int(input())
op = "+" or "-"
print(a + op + b)
|
s110531252 | p03844 | u359930418 | 1482516465 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3064 | 62 | a = int(input())
b = int(input())
op = + or -
print(a op b)
|
s335440019 | p03844 | u450260982 | 1482259710 | Python | Python (3.4.3) | py | Runtime Error | 24 | 3064 | 112 | data = input().split()
if data[1] = "+":
print int(data[0] + data[2])
else
print int(data[0] - data[2]) |
s341768592 | p03844 | u450260982 | 1482259172 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3064 | 133 | data = input().split() # "1 2 3"と入力
if data[1]) = "+":
print int(data[0] + data[2])
else
print int(data[0] - data[2]) |
s083336586 | p03844 | u450260982 | 1482259077 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3064 | 122 | data = input().split() # "1 2 3"と入力
if data[1]) = "+":
print data[0] + data[2]
else
print data[0] - data[2] |
s283215751 | p03844 | u886545507 | 1482242204 | Python | Python (2.7.6) | py | Runtime Error | 16 | 2568 | 206 | #ABC050B
n=int(raw_input())
t=map(int,raw_input().split())
m=int(raw_input())
v=[]
for i in xrange(m):
u=t[:]
p,x=map(int,raw_input().split())
u[p-1]=x
v.append(sum(u))
for i in xrange(m):
print v[i]
|
s655120794 | p03844 | u822353071 | 1482184210 | Python | Python (2.7.6) | py | Runtime Error | 17 | 2568 | 102 | #001
a,op,b = input().split(" ")
a = int(a)
b = int(b)
if op=="+":
print(a+b)
else:
print(a-b) |
s476965640 | p03844 | u272028993 | 1482161020 | Python | Python (2.7.6) | py | Runtime Error | 17 | 2568 | 276 | 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]-1]=xt[i][1]
for j in xrange(n):
ans[i]+=tmp[j]
for j in xrange(n):
print(ans[j])
|
s287002308 | p03844 | u069170167 | 1482120225 | Python | PyPy3 (2.4.0) | py | Runtime Error | 205 | 38384 | 286 | N = int(input())
A = list(map(int, input().split()))
M = N//2
if N % 2 == 1 and A.count(0) == 1 and all(A.count(i*2+2)==2 for i in range(M)):
print((2 ** M) % (10**9+7))
elif N % 2 == 0 and all(A.count(i*2+1)==2 for i in range(M)):
print((2 ** M) % (10**9+7))
else:
print(0) |
s870895452 | p03844 | u272496669 | 1482119619 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3064 | 98 | l = input().split()
if l[1] = "+":
print(int(l[0])+int(l[2]))
else:
print(int(l[0])-int(l[2])) |
s479020188 | p03844 | u781758937 | 1482118403 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3064 | 449 | import sys
sys.setrecursionlimit(10000)
N = int(input())
A = list(map(int,input().split()))
error = 0
if N%2 == 1:
if A.count(0) != 1:
print(0)
elif sum(A) != (N+1)*(N-1)/2:
print(0)
else:
print(int((2**((N-1)/2))%(10**9+7)))
else:
if A.count(0) != 0:
print(0)
elif sum(A) != N**2/2:
print(0)
else:
print(int((2**(N/2))%(10**9+7)))
|
s108420685 | p03844 | u310790595 | 1482116658 | Python | Python (2.7.6) | py | Runtime Error | 1799 | 17012 | 497 | import numpy as np
import collections
N=int(raw_input())
A=map(int, raw_input().split())
count_A=collections.Counter(A).most_common(1)
cnt = 0
if N%2 == 0:
if A.count(0) >= 1:
print 0
cnt = 1
elif count_A [0][1] != 2:
print 0
cnt = 1
if cnt == 0:
print 2**(N/2)%(10**9+7)
else:
if A.count(0) >= 2:
print 0
cnt = 1
elif count_A[0][1] != 2:
print 0
cnt = 1
if cnt == 0:
print 2**(N/2)%(10**9+7) |
s338849132 | p03844 | u894364256 | 1482116465 | Python | Python (2.7.6) | py | Runtime Error | 16 | 2568 | 80 | a,op,b = map(raw_input().split())
if op=="+":
print a+b
else:
print a-b
|
s936926852 | p03844 | u379559362 | 1482114972 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3064 | 195 | n = input()
ti = input().split()
sum_ti = sum(map(int, ti))
m = input()
for m in range(int(m)):
px = input().split()
sum_p = sum_ti - int(ti[int(px[0])-1]) + int(px[1])
print(sum_p)
|
s710363347 | p03844 | u886790158 | 1482114201 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3064 | 532 |
N = int(input())
A = list(map(int, input().split()))
A_ = sorted(A)
if len(A_) == 1:
if A_[0] == 0:
print(1)
else:
print(0)
else:
if len(A_) % 2 == 0:
if A_[0] != 0 or A_[1] != 0:
print(0)
exit()
else:
if A_[0] != 0 or A_[1] == 0:
print(0)
exit()
for i in range(len(A_) // 2):
if A_[2*i] != A_[2*i+1]:
print(0)
exit()
ans_ = 2 ** (N // 2)
ans = ans_ % (10**9 + 7)
print(ans)
|
s867825217 | p03844 | u379559362 | 1482113720 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3064 | 135 | aopb = input().split('+'or'-')
if aopb[1] == '+':
print(int(aopb[0]) + int(aopb[2]))
else:
print(int(aopb[0]) - int(aopb[2]))
|
s816128901 | p03844 | u386131832 | 1482113564 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3064 | 99 | s=input().split()
a=int(s[0])
op=s[1]
b=int(s[1])
if op=="+":
print(a+b)
elif op=="=":
print(a-b) |
s480045017 | p03845 | u546853743 | 1601220079 | Python | Python (3.8.2) | py | Runtime Error | 24 | 9124 | 244 | n=int(input())
a=[]
for i in range(n):
t=int(input())
a.append(t)
m=int(input())
for j in range(m):
p,x=map(int,input().split())
for k in range(n):
if t==k+1:
a[k]=x
for j in range(m):
print(sum(a))
|
s228429419 | p03845 | u931394483 | 1601127777 | Python | Python (3.8.2) | py | Runtime Error | 25 | 9024 | 157 | n = int(input())
t = list(map(int,input().split()))
m = int(input())
a,b = 0,0
for _ in range(m):
a,b = map(int,input().split())
print(sum(t) - t[a] + b) |
s422559371 | p03845 | u796563423 | 1600120417 | Python | Python (3.8.2) | py | Runtime Error | 28 | 9088 | 189 | #Contest with Drinks Easy
n=int(input())
t=list(map(int,input().split()))
m=int(input())
for i in range(m):
a,b=map(int,input().split())
total=t
total[a]=b
print(sum(total)) |
s128512149 | p03845 | u796563423 | 1600120393 | Python | Python (3.8.2) | py | Runtime Error | 25 | 8884 | 165 | n=int(input())
t=list(map(int,input().split()))
m=int(input())
for i in range(m):
a,b=map(int,input().split())
total=t
total2[a]=b
print(sum(total2)) |
s914380523 | p03845 | u244836567 | 1599342478 | Python | Python (3.8.2) | py | Runtime Error | 24 | 9168 | 151 | a=int(input())
b=list(map(int,input().split()))
c=int(input())
d=[int(input()) for i in range(c)]
for i in range(c):
print(sum(b)-b[d[i][0]]+d[i][1]) |
s021252840 | p03845 | u999503965 | 1599202162 | Python | Python (3.8.2) | py | Runtime Error | 22 | 9108 | 161 | n=int(input())
l=list(map(int,input().split()))
m=int(input())
sum_l=sum(l)
for i in range(m):
p,x=map(int,input().split())
ams=sum_l-l[p-1]+x
print(ans) |
s900196934 | p03845 | u748722044 | 1599151649 | Python | PyPy3 (7.3.0) | py | Runtime Error | 102 | 74180 | 192 | n = int(input())
t = list(map(int, input().split())
t = [0] + t
maxRed = 0
for _ in range(int(input())):
p, x = map(int, input().split())
maxRed = max(maxRed, t[p]-x)
print(sum(t)-maxRed) |
s397393900 | p03845 | u705418271 | 1599077316 | Python | Python (3.8.2) | py | Runtime Error | 32 | 9032 | 162 | n=int(input())
t=list(map(int,input().split()))
m=int(input())
for i in range(m):
p,x=map(int,input().split())
y=t[p-1]
t[p-1]=x:
print(sum(t))
t[p-1]=y |
s472399206 | p03845 | u896741788 | 1598626847 | Python | Python (3.8.2) | py | Runtime Error | 23 | 8972 | 144 | n=int(input())
l=[0]+list(map(int,input().split()))\
ans=sum(l)
for i in range(int(input())):
a,s=map(int,input().split())
print(ans-l[a]+s) |
s887617179 | p03845 | u272457181 | 1598468071 | Python | Python (3.8.2) | py | Runtime Error | 28 | 9208 | 307 | N = int(input())
P=[]
T=input()
M = int(input())
for i in range(M):
P.append(tuple(map(int,input().split())))
Tlist = []
for i in range(N):
Tlist.append(int(T[2*i]))
for i in range(M):
A = 0
for j in range(N):
if Tlist[j] == P[i][0]-1:
A += P[i][1]
else:
A += Tlist[j]
print(A) |
s661602770 | p03845 | u272457181 | 1598466118 | Python | Python (3.8.2) | py | Runtime Error | 24 | 9040 | 285 | N = int(input())
A = 0
T, P=[], []
for i in range(N):
T.append(int(input))
M = int(input())
for i in range(M):
P.append(tuple(map(int,input().split())))
for i in range(M):
for j in range(N):
if T[j] == P[i][0]-1:
A += P[i][1]
else:
A += T[j]
print(A)
|
s158220762 | p03845 | u396211450 | 1597634998 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9164 | 157 | n=int(input())
l=list(map(int,input().split()))
l=[0]+l
s=sum(l)
k=int(input())
for _ in range(1,n+1):
m,n=map(int,input().split())
print(s-l[m]+n)
|
s829982750 | p03845 | u913482608 | 1597530097 | Python | Python (3.8.2) | py | Runtime Error | 23 | 8936 | 357 | #include <iostream>
#include <array>
using namespace std;
int main(){
int N, M, k, val, sum = 0, ans;
array<int, 100> p;
cin >> N;
for(int i = 0; i < N; i++){
cin >> p[i];
sum += p[i];
}
cin >> M;
for(int i = 0; i < M; i++){
cin >> k >> val;
cout << sum + val - p[k - 1] << '\n';
}
}
|
s472799156 | p03845 | u250662864 | 1597511258 | Python | Python (3.8.2) | py | Runtime Error | 23 | 9120 | 293 | num_problems = int(input())
a = input()
seconds_per = a.split()
for i in seconds_per:
total += int(i)
drinks = int(input())
for i in range(drinks):
b = input()
c = b.split()
question = int(c[0])
change = int(c[1])
new = total-int(seconds_per[question-1]) + change
print(new)
|
s311237029 | p03845 | u895918162 | 1597511061 | Python | Python (3.8.2) | py | Runtime Error | 20 | 9184 | 301 | num_prob = int(input())
prob = input()
new = prob.split()
sum = 0
num_drinks = int(input())
for j in new:
sum += int(j)
for i in range(num_drinks):
line = input()
new_line = line.split()
if new_line[1] != new[new_line[0]]:
sum -= new[new_line[0]]
sum += new_line[1]
print(sum)
|
s714705005 | p03845 | u895918162 | 1597510951 | Python | Python (3.8.2) | py | Runtime Error | 21 | 9108 | 291 | num_prob = int(input())
prob = input()
new = prob.split()
sum = 0
num_drinks = input()
for j in new:
sum += j
for i in range(num_drinks):
line = input()
new_line = line.split()
if new_line[1] != new[new_line[0]]:
sum -= new[new_line[0]]
sum += new_line[1]
print(sum)
|
s928917256 | p03845 | u895918162 | 1597510917 | Python | Python (3.8.2) | py | Runtime Error | 24 | 9116 | 278 | num_prob = int(input())
prob = input()
new = prob.split()
sum = 0
num_drinks = input()
for j in new:
sum += j
for i in range(num_drinks):
line = input()
new_line = line.split()
if new_line[1] != new[new_line[0]]:
sum -= new[new_line[0]]
sum += new_line[1]
|
s523936528 | p03845 | u980503157 | 1597510896 | Python | Python (3.8.2) | py | Runtime Error | 28 | 9132 | 290 | ProNum = int(input())
time = input()
time = time.split()
TotalTime = 0
for t in time:
TotalTime += int(t)
DrinkNum = int(input())
for d in range(DrinkNum):
line = input()
line = line.split()
diff = int(line[1]) - int(time[int(line[0])])
print(TotalTime+diff)
|
s933326709 | p03845 | u250662864 | 1597510888 | Python | Python (3.8.2) | py | Runtime Error | 25 | 9020 | 315 | num_problems = int(input())
a = input()
seconds_per = a.split()
drinks = int(input())
for i in range(drinks):
b = input()
c = b.split()
question = int(c[0])
change = int(c[1])
copy = seconds_per[question-1]
seconds_per[question-1] = change
print(sum(seconds_per))
seconds_per[question-1] = copy
|
s057359023 | p03845 | u980503157 | 1597510818 | Python | Python (3.8.2) | py | Runtime Error | 25 | 9092 | 290 | ProNum = int(input())
time = input()
time = time.split()
TotalTime = 0
for t in time:
TotalTime += int(t)
DrinkNum = int(input())
for d in range(DrinkNum):
line = input()
line = line.split()
diff = int(line[1]) - int(time(int(line[0])))
print(TotalTime+diff)
|
s478097634 | p03845 | u980503157 | 1597510774 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9140 | 266 | ProNum = int(input())
time = input()
time = time.split()
TotalTime = 0
for t in time:
TotalTime += t
DrinkNum = int(input())
for d in range(DrinkNum):
line = input()
line = line.split()
diff = int(line[1]) - int(time(int(line[0])))
print(TotalTime+diff) |
s933331805 | p03845 | u972658925 | 1597378817 | Python | Python (3.8.2) | py | Runtime Error | 22 | 9024 | 187 | print(a)
n = int(input())
t = list(map(int,input().split()))
m = int(input())
for i in range(m):
lst = list(t)
p,x = map(int,input().split())
lst[p-1] = x
print(sum(lst)) |
s200798078 | p03845 | u972658925 | 1597378797 | Python | Python (3.8.2) | py | Runtime Error | 24 | 9044 | 202 | print(a)
n = int(input())
t = list(map(int,input().split()))
m = int(input())
for i in range(m):
lst = list(t)
p,x = map(int,input().split())
lst[p-1] = x
print(sum(lst))
print(lst) |
s749634684 | p03845 | u552738814 | 1597012082 | Python | Python (3.8.2) | py | Runtime Error | 29 | 9132 | 359 | n = int(input())
time_list = list(map(int,input().split()))
m = int(input())
drink_num_time = []
drink_time = []
for i in range(m):
drink_num_time.append(list(map(int,input().split())))
normal_time = sum(time_list)
for i in range(m):
drink_time.append(normal_time+drink_num_time[i][1]-time_list[i])
for i in range(m):
print(drink_time[i])
|
s056899758 | p03845 | u075303794 | 1596083092 | Python | Python (3.8.2) | py | Runtime Error | 25 | 9028 | 150 | N=int(input())
T=list(map(int,input().split()))
M=int(input())
ans=sum(T)
for i in range(len(M)):
P,X=map(int,input().split())
print(ans-T[P-1]+X) |
s016296150 | p03845 | u863370423 | 1594463095 | Python | Python (3.8.2) | py | Runtime Error | 21 | 8976 | 390 | num_of_pro = raw_input()
problems = raw_input()
num_of_drinks = raw_input()
drinks_lines = []
count = 0
while count < int(num_of_drinks):
count += 1
each_line = raw_input()
drinks_lines.append(each_line)
for each_line in drinks_lines:
problem_num = [int(each_num) for each_num in problems.split()]
problem_num[int(each_line.split()[0]) -1] = int(each_line.split()[1])
print sum(problem_num) |
s244638021 | p03845 | u056358163 | 1593305648 | Python | Python (3.8.2) | py | Runtime Error | 28 | 8876 | 250 | 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)
t_sum = sum(T)
for i in range(M):
print(t_sum - T[P[i]-1] + X[P[i] - 1]) |
s224818693 | p03845 | u600261652 | 1592853432 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9116 | 156 | N = int(input())
t = list(map(int, input().split()))
T = sum(t)
M = int(input())
for _ in range(M):
p, x = map(int, input().split())
print(T+(T[p-1]-x)) |
s539689704 | p03845 | u640922335 | 1592311167 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 204 | N=int(input())
T=list(map(int,input().split()))
M=int(input())
total=0
for i in range(N):
total+=T[i]
for i in range(M):
K=total
P,X=map(int,input().split())
K=K-T[i]
K+=X
print(K) |
s978655246 | p03845 | u350093546 | 1591616607 | Python | PyPy3 (2.4.0) | py | Runtime Error | 171 | 38256 | 152 | n=int(input())
a=list(map(int,input().split()))
m=int(input())
b=[map(int,input().split()) for _ in range(m)]
for i in b:
print(sum(a)-a[i[0]]+i[1]) |
s622220029 | p03845 | u730769327 | 1591238991 | Python | PyPy3 (2.4.0) | py | Runtime Error | 166 | 38256 | 184 | n=int(input())
t=list(map(int,input().split()))
sum=0
for i in range(n):
sum+=t[i]
m=int(input())
for i in range(m):
p,x=map(int,input().split())
sumi=sum-t[p]+x
print(sumi)
|
s469200635 | p03845 | u453642820 | 1591025222 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 36 | print(sum(T[:P-1])+X+sum(T[P:])) |
s787014098 | p03845 | u493130708 | 1590010724 | Python | PyPy3 (2.4.0) | py | Runtime Error | 164 | 38384 | 3077 | # -*- coding: utf-8 -*-
#############
# Libraries #
#############
import sys
input = sys.stdin.readline
import math
#from math import gcd
import bisect
from collections import defaultdict
from collections import deque
from functools import lru_cache
#############
# Constants #
#############
MOD = 10**9+7
INF = float('inf')
#############
# Functions #
#############
######INPUT######
def I(): return int(input().strip())
def S(): return input().strip()
def IL(): return list(map(int,input().split()))
def SL(): return list(map(str,input().split()))
def ILs(n): return list(int(input()) for _ in range(n))
def SLs(n): return list(input().strip() for _ in range(n))
def ILL(n): return [list(map(int, input().split())) for _ in range(n)]
def SLL(n): return [list(map(str, input().split())) for _ in range(n)]
######OUTPUT######
def P(arg): print(arg); return
def Y(): print("Yes"); return
def N(): print("No"); return
def E(): exit()
def PE(arg): print(arg); exit()
def YE(): print("Yes"); exit()
def NE(): print("No"); exit()
#####Shorten#####
def DD(arg): return defaultdict(arg)
#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)
######Combination######
kaijo_memo = []
def kaijo(n):
if(len(kaijo_memo) > n):
return kaijo_memo[n]
if(len(kaijo_memo) == 0):
kaijo_memo.append(1)
while(len(kaijo_memo) <= n):
kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
return kaijo_memo[n]
gyaku_kaijo_memo = []
def gyaku_kaijo(n):
if(len(gyaku_kaijo_memo) > n):
return gyaku_kaijo_memo[n]
if(len(gyaku_kaijo_memo) == 0):
gyaku_kaijo_memo.append(1)
while(len(gyaku_kaijo_memo) <= n):
gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
return gyaku_kaijo_memo[n]
def nCr(n,r):
if(n == r):
return 1
if(n < r or r < 0):
return 0
ret = 1
ret = ret * kaijo(n) % MOD
ret = ret * gyaku_kaijo(r) % MOD
ret = ret * gyaku_kaijo(n-r) % MOD
return ret
######Factorization######
def factorization(n):
arr = []
temp = n
for i in range(2, int(-(-n**0.5//1))+1):
if temp%i==0:
cnt=0
while temp%i==0:
cnt+=1
temp //= i
arr.append([i, cnt])
if temp!=1:
arr.append([temp, 1])
if arr==[]:
arr.append([n, 1])
return arr
#####MakeDivisors######
def make_divisors(n):
divisors = []
for i in range(1, int(n**0.5)+1):
if n % i == 0:
divisors.append(i)
if i != n // i:
divisors.append(n//i)
return divisors
#####LCM#####
def lcm(a, b):
return a * b // gcd (a, b)
#####BitCount#####
def count_bit(n):
count = 0
while n:
n &= n -1
count += 1
return count
#####ChangeBase#####
def base_10_to_n(X, n):
if X//n:
return base_10_to_n(X//n, n)+[X%n]
return [X%n]
def base_n_to_10(X, n):
return sum(int(str(X)[-i])*n**i for i in range(len(str(X))))
#####IntLog#####
def int_log(n, a):
count = 0
while n>=a:
n //= a
count += 1
return count
#############
# Main Code #
#############
N = I()
T = IL()
s = sum(T)
M = IL()
for m,t in range(M):
P(s-T[m]+t) |
s333479153 | p03845 | u623819879 | 1589961036 | Python | PyPy3 (2.4.0) | py | Runtime Error | 169 | 38384 | 111 | I=input;I();t=[int(i)for i in I().S()]
for i in' '*int(input()):p,x=map(int,I().split());print(sum(t)+x-t[p-1]) |
s244064812 | p03845 | u623819879 | 1589960852 | Python | PyPy3 (2.4.0) | py | Runtime Error | 180 | 38384 | 114 | n=int(input())
t=[int(i)for i in input().split()]
m=int(input())
T=sum(t)
for i in' '*m:p,x=LI();print(T+x-t[p-1]) |
s368559645 | p03845 | u970809473 | 1589854434 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 147 | n=int(input())
a=list(map(int,input().split()))
m=int(input())
sum_a=sum(a)
for i in range(m):
s,t=map(int,input().split())
print(sum_a+t-a[s]) |
s578343493 | p03845 | u246661425 | 1588965130 | Python | PyPy3 (2.4.0) | py | Runtime Error | 188 | 38256 | 264 | import sys
input = sys.stdin.readline
n = int(input())
time_list = [map(int, input().split()) for _ in range(n)]
m = int(input())
problem_list = [map(int, input().split()) for _ in range(m)]
for i in problem_list:
time_list[i[0]-1] = i[1]
print(sum(time_list)) |
s670649013 | p03845 | u951582245 | 1588370387 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 200 | N = int(input())
T = list(map(int,input().split()))
M = int(input())
P = [0]*M
X = [0]*M
for i in range(M):
P[i],X[i] = map(int,input().split())
for i in range(M):
print(sum(T)-T[i]+X[i]) |
s788195479 | p03845 | u103902792 | 1588365415 | Python | Python (3.4.3) | py | Runtime Error | 24 | 2940 | 167 | n = int(input().split())
T = list(map(int,input().split()))
ans = sum(T)
m = int(input())
for i in range(m):
p, x = map(int,input().split())
print(ans-T[p-1]+x)
|
s085613361 | p03845 | u252964975 | 1587912987 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 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[P]-X)) |
s134905441 | p03845 | u699089116 | 1587788178 | Python | PyPy3 (2.4.0) | py | Runtime Error | 172 | 38384 | 185 | n = int(input())
t = list(map(int, input().split()))
m = int(input())
for _ in range(m):
temp = t.copy()
p, x = map(int, input().split())
temp[p-1] = x
print(sum(temp)) |
s452718947 | p03845 | u062881897 | 1587695861 | Python | PyPy3 (2.4.0) | py | Runtime Error | 182 | 38640 | 208 | N = int(input())
T = list(map(int,input().split()))
M = int(input())
d = [list(map(int,input().split())) for i in range(M)]
time = sum(T)
for i in range(len(d)):
time += d[i][0] - T[d[i][1]-1]
print(time) |
s145618614 | p03845 | u557953657 | 1587510353 | Python | PyPy3 (2.4.0) | py | Runtime Error | 175 | 38256 | 185 | import copy
n = int(input())
t = list(map(int,input().split()))
m = int(input())
for i in range(m):
p,x = map(int,input().split())
l = t.copy()
l[p-1] = x
print(sum(l)) |
s356661230 | p03845 | u809816772 | 1587257996 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 206 | N = int(input().split())
T = list(map(int,input().split()))
M = int(input().split())
P_X = [list(map(int, input().split())) for i in range(M)]
s = sum(T)
for i in range(M):
print(s-T[i-1][0]+T[i-1][1]) |
s300751660 | p03845 | u298633786 | 1586807050 | Python | PyPy3 (2.4.0) | py | Runtime Error | 168 | 38256 | 179 | N = int(input())
T = list(map(int, input().split()))
M = int(input())
for _ in range(M):
t = T.copy()
P, X = map(int, input().split())
t[P - 1] = X
print(sum(t))
|
s881271166 | p03845 | u818349438 | 1586796048 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 233 | n = int(input())
t = list(map(int,input().split()))
m = int(input())
res = sum(t)
px = [list(map(int,input().split()))for _ in range(m)]
for i in range(m):
p = px[i][0]-1
x = px[i][1]
ans = res -t[i]+x
print(ans)
|
s725172548 | p03845 | u292978925 | 1586546239 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 296 | import sys
input = sys.stdin.readlines()
N = int(input[0])
T_N = list(map(int, input[1].split()))
M = int(input[2])
P_M = [None] * M
P_X = [None] * M
for PX in input[3:]:
P_M, X_M = map(int, PX.split())
sumT = sum(T_N)
for idx1 in range(M):
print(sumT - T_N[P_M[idx1] - 1] + X_M[idx1])
|
s104841786 | p03845 | u292978925 | 1586545482 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 549 | import sys
input = sys.stdin.readline
"""
in1 = '5'
in2 = '7 2 3 8 5'
in3 = '3'
in4 = ['4 2', '1 7', '4 13']
N = int(in1)
T_N = list(map(int, in2.split()))
M = int(in3)
P_M = [None] * M
X_M = [None] * M
for i in range(M):
P_M[i], X_M[i] = (int(x) for x in in4[i].split())
"""
N = int(input())
T_N = list(map(int, input().split()))
M = int(input())
P_M = [None] * M
P_X = [None] * M
for i in range(M):
P_M[i], X_M[i] = (int(x) for x in input().split())
sumT = sum(T_N)
for idx1 in range(M):
print(sumT - T_N[P_M[idx1] - 1] + X_M[idx1])
|
s487879477 | p03845 | u292978925 | 1586544418 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 260 | import sys
input = sys.stdin.readline
N = int(input())
T_N = [int(input()) for _ in range(N)]
M = int(input())
for i in range(M):
P_M, X_M = map(int, input().split())
sumT = sum(T_N)
for idx1 in range(M):
print(sumT - T_N[P_M[idx1] - 1] + X_M[idx1])
|
s730511575 | p03845 | u292978925 | 1586544384 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 260 | import sys
input = sys.stdin.readline
N = int(input())
T_N = [int(input()) for _ in range(N)]
M = int(input())
for _ in range(M):
P_M, X_M = map(int, input().split())
sumT = sum(T_N)
for idx1 in range(M):
print(sumT - T_N[P_M[idx1] - 1] + X_M[idx1])
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.