problem_id stringlengths 6 6 | buggy_code stringlengths 8 526k | fixed_code stringlengths 12 526k | labels listlengths 0 15 ⌀ | buggy_submission_id int64 1 1.54M | fixed_submission_id int64 2 1.54M | user_id stringlengths 10 10 | language stringclasses 8
values |
|---|---|---|---|---|---|---|---|
p02630 | from collections import Counter
n = int(input())
ls = list(map(int, input().split()))
q = int(input())
count = Counter(ls)
sm = sum(ls)
for _ in range(q):
b, q = map(int, input().split())
if b in count:
sm -= count[b] * b
sm += count[b] * q
print(sm)
if q in count:
count[q] ... | from collections import Counter
n = int(input())
ls = list(map(int, input().split()))
q = int(input())
count = Counter(ls)
sm = sum(ls)
for _ in range(q):
b, q = map(int, input().split())
if b in count:
sm -= count[b] * b
sm += count[b] * q
print(sm)
else:
print(sm)
if q... | [
"call.add"
] | 344,335 | 344,336 | u418197217 | python |
p02630 | import numpy as np
M = 100002
if __name__ == "__main__":
N = int(input())
A = [int(x) for x in input().split()]
Q = int(input())
Num = np.zeros((M))
Sum = sum(A)
for i in range(N):
Num[i] += 1
for i in range(Q):
B, C = [int(x) for x in input().split()]
if(Num[B] == 0):
print(int(Sum))
... | import numpy as np
M = 100002
if __name__ == "__main__":
N = int(input())
A = [int(x) for x in input().split()]
Q = int(input())
Num = np.zeros((M))
Sum = sum(A)
for i in range(N):
Num[A[i]] += 1
for i in range(Q):
B, C = [int(x) for x in input().split()]
if(Num[B] == 0):
print(int(Sum)... | [] | 344,466 | 344,467 | u805011545 | python |
p02630 | N=int(input())
A=list(map(int,input().split()))
a=[0]*(10**5+1)
num=0
for i in range(N):
s=A[i]
a[s]+=1
num+=s
Q=int(input())
ans=[]
print(num)
for i in range(Q):
B,C=map(int,input().split())
a[C]+=a[B]
num+=(C-B)*a[B]
a[B]=0
ans.append(num)
for i in ans:
print(i) | N=int(input())
A=list(map(int,input().split()))
a=[0]*(10**5+1)
num=0
for i in range(N):
s=A[i]
a[s]+=1
num+=s
Q=int(input())
ans=[]
for i in range(Q):
B,C=map(int,input().split())
a[C]+=a[B]
num+=(C-B)*a[B]
a[B]=0
ans.append(num)
for i in ans:
print(i) | [
"call.remove"
] | 344,472 | 344,473 | u265506056 | python |
p02630 | from collections import Counter
N = int(input())
A = list(map(int, input().split()))
c = Counter(A)
S = sum(A)
Q = int(input())
for _ in range(Q):
x, y = map(int, input().split())
S += (c[x]*(y-x))
print(S)
c[y] = c[x]
c[x] = 0 | from collections import Counter
N = int(input())
A = list(map(int, input().split()))
c = Counter(A)
S = sum(A)
Q = int(input())
for _ in range(Q):
x, y = map(int, input().split())
S += (c[x]*(y-x))
print(S)
c[y] += c[x]
c[x] = 0 | [
"assignment.value.change"
] | 344,474 | 344,475 | u686036872 | python |
p02630 | from collections import Counter
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
B = []
C = []
for _ in range(Q):
b, c = map(int, input().split())
B.append(b)
C.append(c)
counter = Counter(A)
ans = 0
for num, count in counter.items():
ans += num * count
for i in range(Q):
if ... | from collections import Counter
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
B = []
C = []
for _ in range(Q):
b, c = map(int, input().split())
B.append(b)
C.append(c)
counter = Counter(A)
ans = 0
for num, count in counter.items():
ans += num * count
for i in range(Q):
if ... | [
"call.arguments.change"
] | 344,484 | 344,485 | u351892848 | python |
p02630 | from collections import Counter
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
B = []
C = []
for _ in range(Q):
b, c = map(int, input().split())
B.append(b)
C.append(c)
counter = Counter(A)
ans = 0
for num, count in counter.items():
ans += num * count
for i in range(Q):
if ... | from collections import Counter
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
B = []
C = []
for _ in range(Q):
b, c = map(int, input().split())
B.append(b)
C.append(c)
counter = Counter(A)
ans = 0
for num, count in counter.items():
ans += num * count
for i in range(Q):
if ... | [
"assignment.value.change",
"expression.operation.binary.change",
"call.add"
] | 344,486 | 344,485 | u351892848 | python |
p02630 | import collections as cl
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
sum = 0
for i in range(N):
sum += A[i]
dic = cl.Counter(A)
l = []
for _ in range(Q):
b, c = map(int, input().split())
x = dic.get(b)
if x == None:
l.append(sum)
continue
if b < c:
... | import collections as cl
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
sum = 0
for i in range(N):
sum += A[i]
dic = cl.Counter(A)
l = []
for _ in range(Q):
b, c = map(int, input().split())
x = dic.get(b)
if x == None:
l.append(sum)
continue
if b < c:
... | [
"call.remove"
] | 344,487 | 344,488 | u008718882 | python |
p02630 | #atcoder template
def main():
import sys
imput = sys.stdin.readline
#文字列入力の時は上記はerrorとなる。
#ここにコード
#input
N = int(input())
A = list(map(int, input().split()))
D = Counter(A)
S = sum(A)
Q = int(input())
B = [0] * Q
C = [0] * Q
for i in range(Q):
b, c = map(int, ... | #atcoder template
def main():
import sys
imput = sys.stdin.readline
#文字列入力の時は上記はerrorとなる。
#ここにコード
#input
from collections import Counter
N = int(input())
A = list(map(int, input().split()))
D = Counter(A)
S = sum(A)
Q = int(input())
B = [0] * Q
C = [0] * Q
for i i... | [] | 344,491 | 344,492 | u461454424 | python |
p02630 | from collections import Counter
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
ans = sum(A)
C = Counter(A)
for i in range(Q):
b, c = map(int, input().split())
if b in A:
cnt = C[b]
C[c] += cnt
C[b] = 0
ans += (c-b) * cnt
print(ans) | from collections import Counter
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
ans = sum(A)
C = Counter(A)
for i in range(Q):
b, c = map(int, input().split())
if C[b] != 0:
cnt = C[b]
C[c] += cnt
C[b] = 0
ans += (c-b) * cnt
print(ans) | [
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change"
] | 344,497 | 344,496 | u370721525 | python |
p02630 | n = int(input())
a =list(map(int, input().split()))
q = int(input())
b = [0]*q
c = [0]*q
for i in range(q):
b[i],c[i]=map(int, input().split())
at = [0]*10**5+100
sum = 0
for i in a:
at[i]= at[i]+1
sum = sum+i
for i in range(q):
m= at[b[i]]
at[b[i]]=0
at[c[i]]=at[c[i]]+m
sum = sum + (c... | n = int(input())
a =list(map(int, input().split()))
q = int(input())
b = [0]*q
c = [0]*q
for i in range(q):
b[i],c[i]=map(int, input().split())
at = [0]*(10**5+100)
sum = 0
for i in a:
at[i]= at[i]+1
sum = sum+i
for i in range(q):
m= at[b[i]]
at[b[i]]=0
at[c[i]]=at[c[i]]+m
sum = sum + ... | [] | 344,498 | 344,499 | u881675205 | python |
p02630 | n = int(input())
a =list(map(int, input().split()))
q = int(input())
b = [0]*q
c = [0]*q
for i in range(q):
b[i],c[i]=map(int, input().split())
at = [0]*10**5+2
sum = 0
for i in a:
at[i]= at[i]+1
sum = sum+i
for i in range(q):
m= at[b[i]]
at[b[i]]=0
at[c[i]]=at[c[i]]+m
sum = sum + (c[i... | n = int(input())
a =list(map(int, input().split()))
q = int(input())
b = [0]*q
c = [0]*q
for i in range(q):
b[i],c[i]=map(int, input().split())
at = [0]*(10**5+100)
sum = 0
for i in a:
at[i]= at[i]+1
sum = sum+i
for i in range(q):
m= at[b[i]]
at[b[i]]=0
at[c[i]]=at[c[i]]+m
sum = sum + ... | [
"literal.number.integer.change",
"assignment.value.change",
"expression.operation.binary.change"
] | 344,500 | 344,499 | u881675205 | python |
p02630 | n=int(input())
elements= input().split()
q=int(input())
actions=[]
for i in range(q):
actions.append(input().split())
dict={}
for e in elements:
count=dict.get(e,0)
count+=1
dict[e]=count
sum=0
for key in dict.keys():
sum+=int(key)* dict[key]
for act in actions:
count=dict.get(act[0],0)
... | n=int(input())
elements= input().split()
q=int(input())
actions=[]
for i in range(q):
actions.append(input().split())
dict={}
for e in elements:
count=dict.get(e,0)
count+=1
dict[e]=count
sum=0
for key in dict.keys():
sum+=int(key)* dict[key]
for act in actions:
count=dict.get(act[0],0)
... | [
"assignment.add"
] | 344,508 | 344,509 | u082676125 | python |
p02630 | n = int(input())
a = list(map(int,input().split()))
ans = sum(a)
import collections
cca = collections.Counter(a)
for i in range(int(input())):
b,c = map(int,input().split())
num = cca[b]
cca[b] = 0
cca[c] += num
print(ans - num*(b-c)) | n = int(input())
a = list(map(int,input().split()))
ans = sum(a)
import collections
cca = collections.Counter(a)
for i in range(int(input())):
b,c = map(int,input().split())
num = cca[b]
cca[b] = 0
cca[c] += num
ans -= num*(b-c)
print(ans) | [
"call.remove",
"assignment.compound.arithmetic.replace.add",
"expression.operator.arithmetic.replace.remove",
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change",
"call.add"
] | 344,536 | 344,537 | u883040023 | python |
p02630 | def main():
import sys
def input(): return sys.stdin.readline().rstrip()
n = int(input())
A = list(map(int, input().split()))
q = int(input())
import numpy as np
A.sort()
ans = sum(A)
from bisect import bisect_left,bisect_right
from collections import Counter
count = Counter(... | def main():
import sys
def input(): return sys.stdin.readline().rstrip()
n = int(input())
A = list(map(int, input().split()))
q = int(input())
import numpy as np
A.sort()
ans = sum(A)
from bisect import bisect_left,bisect_right
from collections import Counter
count = Counter(... | [
"control_flow.branch.if.add"
] | 344,555 | 344,554 | u266014018 | python |
p02630 | n=int(input())
a=list(map(int,input().split()))
q=int(input())
ans=sum(a)
L=[0]*(10**5+1)
for i in range(n):
L[a[i]]+=1
for i in range(q):
b,c=map(int,input().split())
num=L[b]
L[c]+=num
ans-=num*b
ans+=num*c
print(ans) | n=int(input())
a=list(map(int,input().split()))
q=int(input())
ans=sum(a)
L=[0]*(10**5+1)
for i in range(n):
L[a[i]]+=1
for i in range(q):
b,c=map(int,input().split())
num=L[b]
L[b]=0
L[c]+=num
ans-=num*b
ans+=num*c
print(ans)
| [
"assignment.add"
] | 344,565 | 344,566 | u113107956 | python |
p02630 | from sys import stdin
readline = stdin.readline
N = int(readline())
A = list(map(int, readline().split()))
Q = int(readline())
t = [0] * (N + 1)
s = sum(A)
for a in A:
t[a] += 1
for _ in range(Q):
B, C = map(int, readline().split())
s -= B * t[B]
s += C * t[B]
t[C] += t[B]
t[B] = 0
print(... | from sys import stdin
readline = stdin.readline
N = int(readline())
A = list(map(int, readline().split()))
Q = int(readline())
t = [0] * (10 ** 5 + 1)
s = sum(A)
for a in A:
t[a] += 1
for _ in range(Q):
B, C = map(int, readline().split())
s -= B * t[B]
s += C * t[B]
t[C] += t[B]
t[B] = 0
... | [
"assignment.value.change",
"identifier.replace.remove",
"literal.replace.add",
"expression.operation.binary.change"
] | 344,567 | 344,568 | u347640436 | python |
p02630 | # -*- coding: utf-8 -*-
import collections
N = int(input())
A = list(map(int, input().split()))
A_amount = dict(collections.Counter(A))
result = sum(A)
Q = int(input())
for q in range(Q):
B, C = map(int, input().split())
B_elem = A_amount.get(B, None)
if B_elem is not None:
C_elem = A_amount.get(C... | # -*- coding: utf-8 -*-
import collections
N = int(input())
A = list(map(int, input().split()))
A_amount = dict(collections.Counter(A))
result = sum(A)
Q = int(input())
for q in range(Q):
B, C = map(int, input().split())
B_elem = A_amount.get(B, None)
if B_elem is not None:
C_elem = A_amount.get(C... | [
"call.remove"
] | 344,582 | 344,583 | u693025087 | python |
p02630 | def sumdic(dic):
s=0
for k, v in dic.items():
s+=int(k)*v
return s
a=int(input())
dic={}
for x in input().split():
if x in dic:
dic[x]+=1
else:
dic[x]=1
s=sumdic(dic)
d=int(input())
for i in range(d):
(b,c)=[x for x in input().split()]
if c in dic:
dic[c]+=dic[b]
s+=(int(c)-int(b))*di... | def sumdic(dic):
s=0
for k, v in dic.items():
s+=int(k)*v
return s
a=int(input())
dic={}
for x in input().split():
if x in dic:
dic[x]+=1
else:
dic[x]=1
s=sumdic(dic)
d=int(input())
for i in range(d):
(b,c)=[x for x in input().split()]
if c in dic and b in dic:
dic[c]+=dic[b]
s+=(int(... | [
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change"
] | 344,591 | 344,592 | u579508806 | python |
p02630 | import sys
input = sys.stdin.readline
n = int(input())
a = list(map(int, input().split()))
q = int(input())
info = []
for i in range(q):
info.append(list(map(int, input().split())))
a_dict = dict()
for num in a:
if num in a_dict.keys():
a_dict[num] += 1
else:
a_dict[num] = 1
a_key = list(... | import sys
input = sys.stdin.readline
n = int(input())
a = list(map(int, input().split()))
q = int(input())
info = []
for i in range(q):
info.append(list(map(int, input().split())))
a_dict = dict()
for num in a:
if num in a_dict.keys():
a_dict[num] += 1
else:
a_dict[num] = 1
a_key = list(... | [
"literal.number.integer.change",
"variable_access.subscript.index.change",
"expression.operation.binary.change"
] | 344,595 | 344,596 | u204208382 | python |
p02630 | N = int(input())
A = list(map(int, input().split()))
AA = {}
t = 0
for a in A:
t += a
if a in AA:
AA[a] += 1
else:
AA[a] = 1
Q = int(input())
ans = []
for i in range(Q):
b, c = list(map(int, input().split()))
if b in AA:
if c not in AA:
AA[c] = 0
AA[c] += AA[b]
t += (c - b) * AA[b]
ans += [t]
del... | N = int(input())
A = list(map(int, input().split()))
AA = {}
t = 0
for a in A:
t += a
if a in AA:
AA[a] += 1
else:
AA[a] = 1
Q = int(input())
ans = []
for i in range(Q):
b, c = list(map(int, input().split()))
if b in AA:
if c not in AA:
AA[c] = 0
AA[c] += AA[b]
t += (c - b) * AA[b]
ans += [t]
del... | [] | 344,610 | 344,611 | u364774090 | python |
p02630 | from collections import Counter
n = int(input())
a_list = list(map(int, input().split()))
q = int(input())
bc_list = []
for _ in range(q):
bc_list.append(list(map(int, input().split())))
sum_num = sum(a_list)
counter = Counter(a_list)
for i, (b, c) in enumerate(bc_list):
sum_num = sum_num + ((c - b) * counte... | from collections import Counter
n = int(input())
a_list = list(map(int, input().split()))
q = int(input())
bc_list = []
for _ in range(q):
bc_list.append(list(map(int, input().split())))
sum_num = sum(a_list)
counter = Counter(a_list)
for i, (b, c) in enumerate(bc_list):
sum_num = sum_num + ((c - b) * counte... | [
"assignment.add"
] | 344,627 | 344,628 | u891218252 | python |
p02630 | import sys
stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip() # ignore trailing spaces
n = ni()
a = na()
q = ni()
l = [na() for _ in range(q)]
import collections
c = collections.Counter(a)
ans = sum(a)
for i in l:
if c[i[0]] >0:
... | import sys
stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip() # ignore trailing spaces
n = ni()
a = na()
q = ni()
l = [na() for _ in range(q)]
import collections
c = collections.Counter(a)
ans = sum(a)
for i in l:
if c[i[0]] >0:
... | [
"call.add"
] | 344,670 | 344,671 | u683956577 | python |
p02630 | from collections import Counter
dicy = {}
def swap(a,b):
tmp = 0
try:
tmp = dicy.pop(a)
except Exception:
tmp = 0
try:
dicy[b] += tmp
except Exception:
dicy[b] = tmp
return (int(b)-int(a)) * tmp
max = input()
dicy = dict(Counter(input().split(' ')))
result = 0
for v,k in dicy.items():
result += int... | from collections import Counter
dicy = {}
def swap(a,b):
tmp = 0
try:
tmp = dicy.pop(a)
except Exception:
tmp = 0
try:
dicy[b] += tmp
except Exception:
dicy[b] = tmp
return (int(b)-int(a)) * tmp
max = input()
dicy = dict(Counter(input().split(' ')))
result = 0
for v,k in dicy.items():
result += int... | [
"call.remove"
] | 344,674 | 344,675 | u014562811 | python |
p02630 | from collections import Counter
n = input()
N = int(n)
A = [int(a) for a in input().split()]
q = input()
Q = int(q)
B, C = [], []
for i in range(Q):
b, c = input().split()
B.append(int(b))
C.append(int(c))
my_dict = Counter(A)
def cals_sum(my_dict):
values = [ my_dict[key]*key for key in my_dict.key... | from collections import Counter
n = input()
N = int(n)
A = [int(a) for a in input().split()]
q = input()
Q = int(q)
B, C = [], []
for i in range(Q):
b, c = input().split()
B.append(int(b))
C.append(int(c))
my_dict = Counter(A)
def cals_sum(my_dict):
values = [ my_dict[key]*key for key in my_dict.key... | [
"expression.operation.binary.remove"
] | 344,694 | 344,695 | u285492845 | python |
p02630 | n=int(input())
a=list(map(int,input().split()))
d={}
for i in a:
if i in d:
d[i]+=1
else:
d[i]=1
q=int(input())
s=sum(a)
for i in range(q):
b,c=map(int,input().split())
if c in d and b in d:
d[c]+=d[b]
elif b in d:
d[c]=d[b]
if b in d:
s=s+(c-b)*d[b]
p... | n=int(input())
a=list(map(int,input().split()))
d={}
for i in a:
if i in d:
d[i]+=1
else:
d[i]=1
q=int(input())
s=sum(a)
for i in range(q):
b,c=map(int,input().split())
if c in d and b in d:
d[c]+=d[b]
elif b in d:
d[c]=d[b]
if b in d:
s=s+(c-b)*d[b]
... | [
"call.add"
] | 344,745 | 344,746 | u606784601 | python |
p02630 | def main():
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline
from collections import Counter
N = int(input())
A = list(map(int, input().split()))
CA = Counter(A)
sumA = 0
for key, value in CA.items():
sumA += key*value
Q = int(input())
for i in ran... | def main():
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline
from collections import Counter
N = int(input())
A = list(map(int, input().split()))
CA = Counter(A)
sumA = 0
for key, value in CA.items():
sumA += key*value
Q = int(input())
for i in ran... | [
"assignment.value.change"
] | 344,753 | 344,754 | u111473084 | python |
p02630 | n,a,d = int(input()),list(map(int,input().split())),[0 for i in range(100100)]
for x in a:
d[x] += 1
s,q = sum(a),int(input())
for i in range(q):
b,c = map(int,input().split())
s += (c-b)*d[x]
d[c] += d[b]
d[b] = 0
print(s) | n,a,d = int(input()),list(map(int,input().split())),[0 for i in range(100100)]
for x in a:
d[x] += 1
s,q = sum(a),int(input())
for i in range(q):
b,c = map(int,input().split())
s += (c-b)*d[b]
d[c] += d[b]
d[b] = 0
print(s) | [
"identifier.change",
"variable_access.subscript.index.change",
"expression.operation.binary.change"
] | 344,771 | 344,772 | u548624367 | python |
p02630 | n = int(input())
a = list(map(int, input().split()))
q = int(input())
d = {}
total = 0
for i in a:
total += i
d[i] = d.get(i, 0) + 1
#クエリによって、それぞれの数値の個数を変更し、
#対象となる個数×差分で合計を修正し出力する
for i in range(q):
b, c = map(int, input().split())
b_cnt = d.get(b, 0)
c_cnt = d.get(c, 0)
total = total + b_cnt * (c - b)
... | n = int(input())
a = list(map(int, input().split()))
q = int(input())
d = {}
total = 0
for i in a:
total += i
d[i] = d.get(i, 0) + 1
#クエリによって、それぞれの数値の個数を変更し、
#対象となる個数×差分で合計を修正し出力する
for i in range(q):
b, c = map(int, input().split())
b_cnt = d.get(b, 0)
c_cnt = d.get(c, 0)
total = total + b_cnt * (c - b)
... | [
"assignment.add"
] | 344,803 | 344,804 | u312482829 | python |
p02630 |
N=int(input())
A=list(map(int,input().split()))
Q=int(input())
arg=[0]*(N+5)
for a in A:
arg[a]+=1
ans=sum(A)
for _ in range(Q):
a,b=map(int,input().split())
ans+=arg[a]*(b-a)
print(ans)
arg[b]+=arg[a]
arg[a]=0
|
N=int(input())
A=list(map(int,input().split()))
Q=int(input())
arg=[0]*(100005)
for a in A:
arg[a]+=1
ans=sum(A)
for _ in range(Q):
a,b=map(int,input().split())
ans+=arg[a]*(b-a)
print(ans)
arg[b]+=arg[a]
arg[a]=0
| [
"assignment.value.change",
"identifier.replace.remove",
"literal.replace.add",
"expression.operation.binary.change",
"expression.operation.binary.remove"
] | 344,855 | 344,856 | u211706121 | python |
p02630 | import collections
def calc_sum(c):
sum_val = 0
for key, val in c.items():
sum_val += key * val
return sum_val
N = int(input())
arr = list(map(int, input().split()))
Q = int(input())
actions = []
for i in range(Q):
B, C = map(int, input().split())
actions.append({'B':B, 'C':C})
c = coll... | import collections
def calc_sum(c):
sum_val = 0
for key, val in c.items():
sum_val += key * val
return sum_val
N = int(input())
arr = list(map(int, input().split()))
Q = int(input())
actions = []
for i in range(Q):
B, C = map(int, input().split())
actions.append({'B':B, 'C':C})
c = coll... | [
"identifier.change",
"variable_access.subscript.index.change",
"expression.operation.binary.change"
] | 344,879 | 344,880 | u633203155 | python |
p02630 | from collections import Counter
N = int(input())
A = list(map(int,input().split()))
Q = int(input())
S = sum(A)
counter = Counter(A)
for i in range(Q):
B,C = list(map(int,input().split()))
S += counter[B]*C - counter[B]*B
counter[C] += counter[B]
print(S)
| from collections import Counter
N = int(input())
A = list(map(int,input().split()))
Q = int(input())
S = sum(A)
counter = Counter(A)
for i in range(Q):
B,C = list(map(int,input().split()))
S += counter[B]*C - counter[B]*B
counter[C] += counter[B]
counter[B] = 0
print(S)
| [
"assignment.add"
] | 344,924 | 344,925 | u441575327 | python |
p02630 | from collections import Counter
n=int(input())
a=list(map(int,input().split()))
d=dict(Counter(a))
ans=sum(a)
q=int(input())
for _ in range(q):
b,c=map(int,input().split())
if b not in d.keys(): continue
ans+=(c*d[b]-b*d[b])
print(ans)
if c in d.keys(): d[c]+=d[b]
else: d[c]=d[b]
d[b]=0 | from collections import Counter
n=int(input())
a=list(map(int,input().split()))
d=dict(Counter(a))
ans=sum(a)
q=int(input())
for _ in range(q):
b,c=map(int,input().split())
if b not in d.keys():
print(ans)
continue
ans+=(c*d[b]-b*d[b])
print(ans)
if c in d.keys(): d[c]+=d[b]
else... | [
"call.add"
] | 344,927 | 344,928 | u131881594 | python |
p02630 | n = int(input())
a = list(map(int, input().split()))
q = int(input())
numl = [0] * 100005
resl = []
suma = sum(a)
for i in range(n):
numl[a[i]]+=1
for i in range(q):
b, c = map(int, input().split())
bn = numl[b]
suma += (c - b)* bn
resl.append(suma)
numl[c] -= bn
numl[c] += bn
for i in resl:... | n = int(input())
a = list(map(int, input().split()))
q = int(input())
numl = [0] * 100005
resl = []
suma = sum(a)
for i in range(n):
numl[a[i]]+=1
for i in range(q):
b, c = map(int, input().split())
bn = numl[b]
suma += (c - b)* bn
resl.append(suma)
numl[b] -= bn
numl[c] += bn
for i in resl:... | [
"identifier.change",
"variable_access.subscript.index.change"
] | 344,929 | 344,930 | u177370876 | python |
p02630 | n=int(input())
l=list(map(int,input().split()))
num=[0]*(10**5+1)
for i in l:
num[i]+=1
q=int(input())
count=sum(l)
for _ in range(q):
b,c=map(int,input().split())
count+=num[b]*(c-b)
num[c]+=num[b]
num[b]==0
print(count) | n=int(input())
l=list(map(int,input().split()))
num=[0]*(10**5+1)
for i in l:
num[i]+=1
q=int(input())
count=sum(l)
for _ in range(q):
b,c=map(int,input().split())
count+=num[b]*(c-b)
num[c]+=num[b]
num[b]=0
print(count) | [
"expression.operation.compare.replace.remove",
"assignment.replace.add",
"misc.typo"
] | 344,933 | 344,934 | u272525952 | python |
p02630 | N = input()
arr = [int(x) for x in input().split()]
q = int(input())
ans = sum(arr)
hashmap = {}
for val in arr:
if val in hashmap:
hashmap[val] += 1
else:
hashmap[val] = 1
while q > 0:
[x, y] = [int(x) for x in input().split()]
if x in hashmap:
if y in hashmap:
... | N = input()
arr = [int(x) for x in input().split()]
q = int(input())
ans = sum(arr)
hashmap = {}
for val in arr:
if val in hashmap:
hashmap[val] += 1
else:
hashmap[val] = 1
while q > 0:
[x, y] = [int(x) for x in input().split()]
if x in hashmap:
if y in hashmap:
... | [] | 344,945 | 344,946 | u544865362 | python |
p02630 | def sum_dict(d, sum, b, c):
val = 0
if b in d:
val = d[b]
sum -= (b * val)
del d[b]
d[c] = d.get(c, 0) + val
sum += (c * val)
return sum, d
n = int(input())
a = [int(x) for x in input().split()]
d = {}
for i in a:
d[i] = d.get(i, 0) + 1
s = sum(a)
q = int(inp... | def sum_dict(d, sum, b, c):
val = 0
if b in d:
val = d[b]
sum -= (b * val)
del d[b]
d[c] = d.get(c, 0) + val
sum += (c * val)
return sum, d
n = int(input())
a = [int(x) for x in input().split()]
d = {}
for i in a:
d[i] = d.get(i, 0) + 1
s = sum(a)
q = int(inp... | [
"call.arguments.add"
] | 344,996 | 344,997 | u102059282 | python |
p02630 | R = lambda: map(int, input().split())
R()
a = [0] * 100001
s = 0
for x in R():
s += x
a[x] += 1
q, = R()
for _ in range(q):
b, c = R()
s += (c - b) * a[b]
print(s)
a[c]+=d[b]
a[b] = 0
| R = lambda: map(int, input().split())
R()
a = [0] * 100001
s = 0
for x in R():
s += x
a[x] += 1
q, = R()
for _ in range(q):
b, c = R()
s += (c - b) * a[b]
print(s)
a[c]+=a[b]
a[b] = 0
| [
"identifier.change"
] | 345,015 | 345,016 | u021019433 | python |
p02630 | import collections
N = int(input())
A = list(map(int,input().split()))
Q = int(input())
l=[]
for _ in range(Q):
l.append(list(map(int,input().split())))
c = collections.Counter(A)
sum=sum(A)
for i in range(Q):
print(c)
if c[l[i][0]] == 0:
print(sum)
continue
else:
sum+=c[l[i][0]]... | import collections
N = int(input())
A = list(map(int,input().split()))
Q = int(input())
l=[]
for _ in range(Q):
l.append(list(map(int,input().split())))
c = collections.Counter(A)
sum=sum(A)
for i in range(Q):
if c[l[i][0]] == 0:
print(sum)
continue
else:
sum+=c[l[i][0]]*(l[i][1]-l[i... | [
"call.remove"
] | 345,023 | 345,024 | u370852395 | python |
p02630 | import collections
N = int(input())
A = list(map(int,input().split()))
Q = int(input())
l=[]
for _ in range(Q):
l.append(list(map(int,input().split())))
c = collections.Counter(A)
sum=sum(A)
for i in range(Q):
if c[l[i][0]] == 0:
print(sum)
break
else:
sum+=c[l[i][0]]*(l[i][1]-l[i][0... | import collections
N = int(input())
A = list(map(int,input().split()))
Q = int(input())
l=[]
for _ in range(Q):
l.append(list(map(int,input().split())))
c = collections.Counter(A)
sum=sum(A)
for i in range(Q):
if c[l[i][0]] == 0:
print(sum)
continue
else:
sum+=c[l[i][0]]*(l[i][1]-l[i... | [
"control_flow.break.remove",
"control_flow.continue.add"
] | 345,025 | 345,024 | u370852395 | python |
p02630 | from collections import Counter
n = int(input())
a = list(map(int, input().split()))
q = int(input())
C = Counter(a)
s = sum(a)
for i in range(q):
b, c = map(int, input().split())
print(s + (c - b) * C[b])
s += (c - b) * C[b]
C[c] += C[b] | from collections import Counter
n = int(input())
a = list(map(int, input().split()))
q = int(input())
C = Counter(a)
s = sum(a)
for i in range(q):
b, c = map(int, input().split())
print(s + (c - b) * C[b])
s += (c - b) * C[b]
C[c] += C[b]
C[b] = 0 | [
"assignment.add"
] | 345,026 | 345,027 | u923270446 | python |
p02630 | from collections import Counter
N=int(input())
A=list(map(int,input().split()))
Q=int(input())
#print()
#print(N)
#print(A)
#print(Q)
#print()
counterA = dict(Counter(A))
counterAkeys=set(counterA.keys())
#print(counterAkeys)
sumA = sum(A)
#print(sumA,counterA)
for _ in range(Q):
b,c=map(int,input().split())
#pri... | from collections import Counter
N=int(input())
A=list(map(int,input().split()))
Q=int(input())
#print()
#print(N)
#print(A)
#print(Q)
#print()
counterA = dict(Counter(A))
counterAkeys=set(counterA.keys())
#print(counterAkeys)
sumA = sum(A)
#print(sumA,counterA)
for _ in range(Q):
b,c=map(int,input().split())
#pri... | [
"assignment.add"
] | 345,032 | 345,033 | u789436713 | python |
p02630 | def main():
import sys
input = sys.stdin.readline
from collections import Counter
N = int(input())
A = list(map(int, input().split()))
C = Counter(A)
Q = int(input())
ans = sum(A)
for _ in range(Q):
b,c = map(int, input().split())
x = C[b]
ans += (c-b) * x
... | def main():
import sys
input = sys.stdin.readline
from collections import Counter
N = int(input())
A = list(map(int, input().split()))
C = Counter(A)
Q = int(input())
ans = sum(A)
for _ in range(Q):
b,c = map(int, input().split())
x = C[b]
ans += (c-b) * x
... | [
"assignment.add"
] | 345,044 | 345,045 | u219417113 | python |
p02630 | n = int(input())
dic = {}
list = [int(i) for i in input().split()]
for i in list:
if i not in dic:
dic[i] = 0
dic[i] += 1
q = int(input())
ans = sum(list)
for j in range(q):
b,c = (int(x) for x in input().split())
if b not in dic:
pass
else:
if c not in dic:
dic[c... | n = int(input())
dic = {}
list = [int(i) for i in input().split()]
for i in list:
if i not in dic:
dic[i] = 0
dic[i] += 1
q = int(input())
ans = sum(list)
for j in range(q):
b,c = (int(x) for x in input().split())
if b not in dic:
print(ans)
continue
else:
if c not in... | [
"call.arguments.add",
"control_flow.continue.add"
] | 345,066 | 345,067 | u970082363 | python |
p02630 | import bisect
import collections
n=int(input())
a=sorted(list(map(int,input().split())))
q=int(input())
A=collections.Counter(a)
ans=sum(a)
for _ in range(q):
b,c=map(int,input().split())
k=A[b]
ans=(c-b)*k+ans
print(ans)
del A[b]
A[c]=k | import bisect
import collections
n=int(input())
a=sorted(list(map(int,input().split())))
q=int(input())
A=collections.Counter(a)
ans=sum(a)
for _ in range(q):
b,c=map(int,input().split())
k=A[b]
ans=(c-b)*k+ans
print(ans)
del A[b]
A[c]+=k
| [
"assignment.value.change"
] | 345,116 | 345,117 | u344065503 | python |
p02630 | import sys
readline = sys.stdin.readline
N = int(readline())
A = list(map(int, readline().split()))
x = [0] * (10**5+5)
for a in A:
x[a] += 1
s = sum(A)
Q = int(readline())
for _ in range(Q):
b, c = map(int, readline().split())
s += (c - b) * x[b]
print(s)
x[c] += x[b]
| import sys
readline = sys.stdin.readline
N = int(readline())
A = list(map(int, readline().split()))
x = [0] * (10**5+5)
for a in A:
x[a] += 1
s = sum(A)
Q = int(readline())
for _ in range(Q):
b, c = map(int, readline().split())
s += (c - b) * x[b]
print(s)
x[c] += x[b]
x[b] = 0
| [
"assignment.add"
] | 345,183 | 345,184 | u644516473 | python |
p02630 | import collections
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
BC = [list(map(int, input().split())) for i in range(Q)]
ans = sum(A)
cnt = collections.Counter(A)
dp = [0]*(10**5+1)
for i in cnt.items():
dp[i[0]] = i[1]
for i in range(Q):
ans += (BC[i][1] - BC[i][0]) * dp[BC[i][0]]
... | import collections
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
BC = [list(map(int, input().split())) for i in range(Q)]
ans = sum(A)
cnt = collections.Counter(A)
dp = [0]*(10**5+1)
for i in cnt.items():
dp[i[0]] = i[1]
for i in range(Q):
ans += (BC[i][1] - BC[i][0]) * dp[BC[i][... | [
"expression.operation.compare.replace.remove",
"assignment.replace.add",
"misc.typo"
] | 345,232 | 345,233 | u695261159 | python |
p02630 | n=int(input())
*a,=map(int, input().split())
from collections import Counter
ca=Counter(a)
q=int(input())
sm=sum(a)
for _ in range(q):
bi,ci=map(int, input().split())
if ci in ca:
if bi in ca:
sm+=(ci-bi)*ca[ci]
ca[ci]+=ca[bi]
del ca[bi]
else:
if bi in ca:... | n=int(input())
*a,=map(int, input().split())
from collections import Counter
ca=Counter(a)
q=int(input())
sm=sum(a)
for _ in range(q):
bi,ci=map(int, input().split())
if ci in ca:
if bi in ca:
sm+=(ci-bi)*ca[bi]
ca[ci]+=ca[bi]
del ca[bi]
else:
if bi in ca:... | [
"identifier.change",
"variable_access.subscript.index.change",
"expression.operation.binary.change"
] | 345,247 | 345,248 | u520276780 | python |
p02630 | n=int(input())
*a,=map(int, input().split())
from collections import Counter
ca=Counter(a)
q=int(input())
sm=sum(a)
for _ in range(q):
bi,ci=map(int, input().split())
if ci in ca:
if bi in ca:
sm+=(ci-bi)*ca[ci]
ca[ci]+=ca[bi]
del ca[bi]
else:
if bi in ca:... | n=int(input())
*a,=map(int, input().split())
from collections import Counter
ca=Counter(a)
q=int(input())
sm=sum(a)
for _ in range(q):
bi,ci=map(int, input().split())
if ci in ca:
if bi in ca:
sm+=(ci-bi)*ca[bi]
ca[ci]+=ca[bi]
del ca[bi]
else:
if bi in ca:... | [
"identifier.change",
"variable_access.subscript.index.change",
"expression.operation.binary.change"
] | 345,249 | 345,248 | u520276780 | python |
p02630 | n=int(input())
a=list(map(int,input().split()))
q=int(input())
dic={}
for i in range(len(a)):
dic.setdefault(a[i],1)
dic[a[i]]+=1
answer=sum(a)
for i in range(q):
b,c=map(int,input().split())
dic.setdefault(b,0)
dic.setdefault(c,0)
dic[c]+=dic[b]
answer=answer+dic[b]*c-dic[b]*b
dic[b] = ... | n=int(input())
a=list(map(int,input().split()))
q=int(input())
dic={}
for i in range(len(a)):
dic.setdefault(a[i],0)
dic[a[i]]+=1
answer=sum(a)
for i in range(q):
b,c=map(int,input().split())
dic.setdefault(b,0)
dic.setdefault(c,0)
dic[c]+=dic[b]
answer=answer+dic[b]*c-dic[b]*b
dic[b] = ... | [
"literal.number.integer.change",
"call.arguments.change"
] | 345,265 | 345,266 | u811817592 | python |
p02630 | n=int(input())
a=list(map(int,input().split()))
q=int(input())
dic={}
for i in range(len(a)):
dic.setdefault(a[i],1)
dic[a[i]]+=1
answer=sum(a)
for i in range(q):
b,c=map(int,input().split())
dic.setdefault(b,0)
dic.setdefault(c,dic[b])
dic[c]+=dic[b]
answer=answer+dic[b]*c-dic[b]*b
dic[b] =... | n=int(input())
a=list(map(int,input().split()))
q=int(input())
dic={}
for i in range(len(a)):
dic.setdefault(a[i],0)
dic[a[i]]+=1
answer=sum(a)
for i in range(q):
b,c=map(int,input().split())
dic.setdefault(b,0)
dic.setdefault(c,0)
dic[c]+=dic[b]
answer=answer+dic[b]*c-dic[b]*b
dic[b] = ... | [
"literal.number.integer.change",
"call.arguments.change",
"identifier.replace.remove",
"literal.replace.add"
] | 345,267 | 345,266 | u811817592 | python |
p02630 | n = int(input())
# w = list(map(int, input().split()))
#n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
# data = [list(map(int, input().split())) for i in range(n)]
q = int(input())
#p = list(map(int, input().split()))
#a = list(map(int, input().split()))
# ab_sorted = sorted(ab, key=lambda x... | import collections
n = int(input())
# w = list(map(int, input().split()))
#n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
# data = [list(map(int, input().split())) for i in range(n)]
q = int(input())
#p = list(map(int, input().split()))
#a = list(map(int, input().split()))
# ab_sorted = sort... | [] | 345,282 | 345,283 | u696444274 | python |
p02630 | import collections
n = int(input())
l = list(map(int, input().split()))
a = int(input())
c = collections.Counter(l)
answer = sum(l)
for i in range(a):
j,k = map(int, input().split())
save = c[j]
del c[j]
c[k] += save
answer = answer + c[k] -save
print(answer)
| import collections
n = int(input())
l = list(map(int, input().split()))
a = int(input())
c = collections.Counter(l)
answer = sum(l)
for i in range(a):
j,k = map(int, input().split())
save = c[j]
del c[j]
c[k] += save
answer = answer + k*save - j*save
print(answer)
| [
"assignment.value.change",
"expression.operation.binary.change"
] | 345,284 | 345,285 | u907403674 | python |
p02630 | N = int(input())
A = list(map(int, input().split()))
Q = int(input())
table = [0] * 100001
c = 0
s = 0
for i in A:
table[i] += 1
s += i
print(su,s)
for i in range(Q):
B, C = map(int,input().split())
c = table[B]
s += (C - B) * c
table[C] += table[B]
table[B] = 0
print(s)
| N = int(input())
A = list(map(int, input().split()))
Q = int(input())
table = [0] * 100001
c = 0
s = 0
for i in A:
table[i] += 1
s += i
for i in range(Q):
B, C = map(int,input().split())
c = table[B]
s += (C - B) * c
table[C] += table[B]
table[B] = 0
print(s)
| [
"call.remove"
] | 345,289 | 345,290 | u021387650 | python |
p02630 | N = int(input())
A = list(map(int, input().split()))
Q = int(input())
table = [0] * 100001
c = 0
s = 0
for i in A:
table[i] += 1
sum += i
for i in range(Q):
B, C = map(int,input().split())
c = table[B]
s += (C - B) * c
table[C] += table[B]
table[B] = 0
print(s)
| N = int(input())
A = list(map(int, input().split()))
Q = int(input())
table = [0] * 100001
c = 0
s = 0
for i in A:
table[i] += 1
s += i
for i in range(Q):
B, C = map(int,input().split())
c = table[B]
s += (C - B) * c
table[C] += table[B]
table[B] = 0
print(s)
| [
"identifier.change"
] | 345,291 | 345,290 | u021387650 | python |
p02630 | from collections import defaultdict
N = int(input())
raw_numbers = list(map(int, input().split()))
numbers = defaultdict(int)
for num in raw_numbers:
numbers[num] += 1
total = sum(raw_numbers)
Q = int(input())
for _ in range(Q):
a, b = list(map(int, input().split()))
taken = numbers[a]
total... | from collections import defaultdict
N = int(input())
raw_numbers = list(map(int, input().split()))
numbers = defaultdict(int)
for num in raw_numbers:
numbers[num] += 1
total = sum(raw_numbers)
Q = int(input())
for _ in range(Q):
a, b = list(map(int, input().split()))
taken = numbers[a]
total... | [
"assignment.add"
] | 345,302 | 345,303 | u536600145 | python |
p02630 | from collections import defaultdict
n = int(input())
raw_numbers = list(map(int, input().split()))
Q = int(input())
total = sum(raw_numbers)
numbers = defaultdict(int)
for num in raw_numbers:
numbers[num] += 1
for i in range(q):
b, c = map(int, input().split())
taken = numbers[b]
total -= numbe... | from collections import defaultdict
n = int(input())
raw_numbers = list(map(int, input().split()))
q = int(input())
total = sum(raw_numbers)
numbers = defaultdict(int)
for item in raw_numbers:
numbers[item] += 1
for i in range(q):
b, c = map(int, input().split())
taken = numbers[b]
total -= num... | [
"assignment.variable.change",
"identifier.change",
"variable_access.subscript.index.change"
] | 345,304 | 345,305 | u536600145 | python |
p02630 | from collections import defaultdict
n = int(input())
raw_numbers = list(map(int, input().split()))
Q = int(input())
total = sum(raw_numbers)
numbers = defaultdict(int)
for num in raw_numbers:
numbers[num] += 1
for i in range(q):
b, c = map(int, input().split())
taken = numbers[b]
total -= numb... | from collections import defaultdict
n = int(input())
raw_numbers = list(map(int, input().split()))
q = int(input())
total = sum(raw_numbers)
numbers = defaultdict(int)
for item in raw_numbers:
numbers[item] += 1
for i in range(q):
b, c = map(int, input().split())
taken = numbers[b]
total -= num... | [
"assignment.variable.change",
"identifier.change",
"variable_access.subscript.index.change"
] | 345,306 | 345,305 | u536600145 | python |
p02630 | def main():
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
map_ = []
for _ in range(Q):
b, c = list(map(int, input().split()))
map_.append([b, c])
mem = {}
for a in A:
if not(a in mem):
mem[a] = 0
mem[a] += 1
sum_ = sum(A)
for i in range(Q):
from_, to... | def main():
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
map_ = []
for _ in range(Q):
b, c = list(map(int, input().split()))
map_.append([b, c])
mem = {}
for a in A:
if not(a in mem):
mem[a] = 0
mem[a] += 1
sum_ = sum(A)
for i in range(Q):
from_, to... | [
"control_flow.break.remove",
"control_flow.continue.add"
] | 345,311 | 345,312 | u522140891 | python |
p02630 | # # ####################################################################
# import io
# import sys
# _INPUT = """\
# 1
# 10
# 3
# 10 1
# 1 2
# 3 1
# """
# sys.stdin = io.StringIO(_INPUT)
####################################################################
N = int(input())
A = [int(i) for i in input().split()]
Q = int... | # # ####################################################################
# import io
# import sys
# _INPUT = """\
# 1
# 10
# 3
# 10 1
# 1 2
# 3 1
# """
# sys.stdin = io.StringIO(_INPUT)
####################################################################
N = int(input())
A = [int(i) for i in input().split()]
Q = int... | [
"assignment.value.change"
] | 345,319 | 345,320 | u833492079 | python |
p02630 | N = int(input())
A = list(map(int, input().split()))
S = sum(A)
L = [0] * 100001
for i in A:
L[i] += 1
Q = int(input())
for i in range(Q):
B, C = map(int, input().split())
S += (C - B) * L[B]
L[C] += Ct[B]
L[B] = 0
print(S) | N = int(input())
A = list(map(int, input().split()))
S = sum(A)
L = [0] * 100001
for i in A:
L[i] += 1
Q = int(input())
for i in range(Q):
B, C = map(int, input().split())
S += (C - B) * L[B]
L[C] += L[B]
L[B] = 0
print(S) | [
"identifier.change"
] | 345,336 | 345,337 | u833238721 | python |
p02630 | N = int(input())
A = list(map(int, input().split()))
Q = int(input())
S = []
c = 0
s = sum(A)
table = [0] * 100010
# A = pd.Series(A)
# for a in A:
# print(a)
for i in A:
table[i] += 1
for i in range(Q):
B, C = map(int,input().split())
# if B in A:
# c = A.count(B)
c = table[B]
s += (C - B)... | N = int(input())
A = list(map(int, input().split()))
Q = int(input())
S = []
c = 0
s = sum(A)
table = [0] * 100010
# A = pd.Series(A)
# for a in A:
# print(a)
for i in A:
table[i] += 1
for i in range(Q):
B, C = map(int,input().split())
# if B in A:
# c = A.count(B)
c = table[B]
s += (C - B... | [
"assignment.value.change"
] | 345,338 | 345,339 | u039860745 | python |
p02630 | # -*- coding: utf-8 -*-
from sys import stdin
from operator import itemgetter
from collections import deque, Counter
import math
import pprint
from functools import reduce
# stdin = open("sample.txt")
MOD = 1000000007
INF = float('inf')
alpha = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","... | # -*- coding: utf-8 -*-
from sys import stdin
from operator import itemgetter
from collections import deque, Counter
import math
import pprint
from functools import reduce
# stdin = open("sample.txt")
MOD = 1000000007
INF = float('inf')
alpha = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","... | [
"call.add"
] | 345,342 | 345,343 | u595353654 | python |
p02630 | n=int(input())
ls = list(map(int,input().split()))
ls = sorted(ls)
ans = sum(ls)
newls = [0]*(n+1)
for p in ls:
newls[p] += 1
ls = newls
q=int(input())
for _ in range(q):
b,c = map(int,input().split())
tmp = ls[b]
ans = ans + tmp*c - tmp*b
ls[b] = 0
ls[c] = tmp
print(ans)
| n=int(input())
ls = list(map(int,input().split()))
ls = sorted(ls)
ans = sum(ls)
newls = [0]*(100000+1+1)
for p in ls:
newls[p] += 1
ls = newls
q=int(input())
for _ in range(q):
b,c = map(int,input().split())
tmp = ls[b]
ans = ans + tmp*c - tmp*b
ls[b] = 0
ls[c] += tmp
print(ans)
| [
"assignment.value.change",
"identifier.replace.remove",
"literal.replace.add",
"expression.operation.binary.change"
] | 345,438 | 345,439 | u115110170 | python |
p02630 |
n = int(input())
a = [int(i) for i in input().split()]
q = int(input())
bc = []
d = {}
suma = sum(a)
for nr in a:
if nr not in d:
d[nr] = 1
else:
d[nr] += 1
for i in range(q):
bc = [int(i) for i in input().split()]
b = bc[0]
c = bc[1]
if b not in d:
print(suma)
... |
n = int(input())
a = [int(i) for i in input().split()]
q = int(input())
bc = []
d = {}
suma = sum(a)
for nr in a:
if nr not in d:
d[nr] = 1
else:
d[nr] += 1
for i in range(q):
bc = [int(i) for i in input().split()]
b = bc[0]
c = bc[1]
if b not in d:
print(suma)
... | [
"assignment.add"
] | 345,448 | 345,449 | u391340825 | python |
p02630 | N = int(input())
CNT = {}
S = 0
for a in map(int, input().split()):
if not(a in CNT):
CNT[a] = 0
CNT[a] += 1
S += a
Q = int(input())
for _ in range(Q):
B,C = map(int, input().split())
if B in CNT:
cnt = CNT[B]
S -= B*cnt
S += C*cnt
if not(C in CN... | N = int(input())
CNT = {}
S = 0
for a in map(int, input().split()):
if not(a in CNT):
CNT[a] = 0
CNT[a] += 1
S += a
Q = int(input())
for _ in range(Q):
B,C = map(int, input().split())
if B in CNT:
cnt = CNT[B]
del CNT[B]
S -= B*cnt
S += C*cnt
... | [] | 345,450 | 345,451 | u729417323 | python |
p02630 | from collections import defaultdict
n=int(input())
num_dict=defaultdict(int)
a_sum=0
for a in map(int,input().split()):
num_dict[a]+=1
a_sum+=a
for i in range(int(input())):
b,c=map(int,input().split())
a_sum+=c*num_dict[c]-b*num_dict[b]
num_dict[c]+=num_dict[b]
num_dict[b]=0
print(a_sum) | from collections import defaultdict
n=int(input())
num_dict=defaultdict(int)
a_sum=0
for a in map(int,input().split()):
num_dict[a]+=1
a_sum+=a
for i in range(int(input())):
b,c=map(int,input().split())
a_sum+=c*num_dict[b]-b*num_dict[b]
num_dict[c]+=num_dict[b]
num_dict[b]=0
print(a_sum)
| [
"identifier.change",
"variable_access.subscript.index.change",
"expression.operation.binary.change"
] | 345,510 | 345,511 | u391157755 | python |
p02630 | array = [0 for i in range(11)]
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
for a in A:
array[a] += 1
souwa = sum(A)
B = []
C = []
for i in range(Q):
b, c = map(int, input().split())
B.append(b)
C.append(c)
for i in range(Q):
souwa = souwa + (C[i]-B[i])*array[B[i]]
ar... | array = [0 for i in range(100001)]
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
for a in A:
array[a] += 1
souwa = sum(A)
B = []
C = []
for i in range(Q):
b, c = map(int, input().split())
B.append(b)
C.append(c)
for i in range(Q):
souwa = souwa + (C[i]-B[i])*array[B[i]]
... | [
"literal.number.integer.change",
"assignment.value.change",
"call.arguments.change",
"control_flow.loop.range.bounds.upper.change"
] | 345,546 | 345,547 | u893178798 | python |
p02630 | import sys
readline = sys.stdin.readline
def solve():
N = int(readline())
A = list(map(int, readline().split()))
Q = int(readline())
BC = [list(map(int, readline().split())) for i in range(Q)]
count = {}
for a in A:
count[a] = count.get(a, 0) + 1
s = sum(A)
for b, c in BC... | import sys
readline = sys.stdin.readline
def solve():
N = int(readline())
A = list(map(int, readline().split()))
Q = int(readline())
BC = [list(map(int, readline().split())) for i in range(Q)]
count = {}
for a in A:
count[a] = count.get(a, 0) + 1
s = sum(A)
for b, c in BC... | [
"call.add"
] | 345,552 | 345,553 | u733011130 | python |
p02630 | import sys
sys.setrecursionlimit(10000000)
MOD = 10 ** 9 + 7
INF = 10 ** 15
def main():
N = int(input())
num = [0] * 100005
A = list(map(int,input().split()))
S = sum(A)
for a in A:
num[a] += 1
Q = int(input())
for _ in range(Q):
c,d = map(int,input().split())
x... | import sys
sys.setrecursionlimit(10000000)
MOD = 10 ** 9 + 7
INF = 10 ** 15
def main():
N = int(input())
num = [0] * 100005
A = list(map(int,input().split()))
S = sum(A)
for a in A:
num[a] += 1
Q = int(input())
for _ in range(Q):
c,d = map(int,input().split())
x... | [
"assignment.add"
] | 345,618 | 345,619 | u561231954 | python |
p02630 | import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
import collections
counter = collections.defaultdict(int)
for key, value in collec... | import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
import collections
counter = collections.defaultdict(int)
for key, value in collec... | [
"assignment.add"
] | 345,658 | 345,659 | u016881126 | python |
p02630 | import sys
import collections
input = sys.stdin.readline
def main():
N = int(input())
A =list(map(int,input().split()))
AD = collections.Counter(A)
Q = int(input())
ans =0
for key, item in AD.items():
ans += key * item
for i in range(Q):
b, c = map(int,input().split())
... | import sys
import collections
input = sys.stdin.readline
def main():
N = int(input())
A =list(map(int,input().split()))
AD = collections.Counter(A)
Q = int(input())
ans =0
for key, item in AD.items():
ans += key * item
for i in range(Q):
b, c = map(int,input().split())
... | [] | 345,660 | 345,661 | u408071652 | python |
p02630 | n = int(input())
alist = [int(s) for s in input().split(" ")]
adict = {}
ans = 0
for a in alist:
ans += a
if a in adict:
adict[a] += 1
else:
adict[a] = 1
q = int(input())
bclist = []
for _ in range(q):
b, c = [int(s) for s in input().split(" ")]
bclist.append([b, c])
for b, c in bclist:
if c in adi... | n = int(input())
alist = [int(s) for s in input().split(" ")]
adict = {}
ans = 0
for a in alist:
ans += a
if a in adict:
adict[a] += 1
else:
adict[a] = 1
q = int(input())
bclist = []
for _ in range(q):
b, c = [int(s) for s in input().split(" ")]
bclist.append([b, c])
for b, c in bclist:
if c in adi... | [
"expression.operation.binary.change",
"expression.operation.binary.remove"
] | 345,708 | 345,709 | u018776180 | python |
p02630 | from collections import Counter
N=int(input())
A=list(map(int,input().split()))
s=sum(A)
Q=int(input())
cnt=Counter(A)
for _ in range(Q):
b,c=map(int,input().split())
if b in cnt:
s-=cnt[b]*b
s+=cnt[b]*c
print(s)
if c in cnt:
cnt[c]+=cnt[b]
cnt[b]=0
... | from collections import Counter
N=int(input())
A=list(map(int,input().split()))
s=sum(A)
Q=int(input())
cnt=Counter(A)
for _ in range(Q):
b,c=map(int,input().split())
if b in cnt:
s-=cnt[b]*b
s+=cnt[b]*c
print(s)
if c in cnt:
cnt[c]+=cnt[b]
cnt[b]=0
... | [
"assignment.add"
] | 345,714 | 345,715 | u970449052 | python |
p02630 | N=int(input())
a_list=list(map(int,input().split()))
Q=int(input())
N_list=[0]*(N+1)
sumn=0
for a in a_list:
N_list[a]+=1
sumn+=a
for i in range(Q):
b,c=map(int,input().split())
henka=(c-b)*N_list[b]
sumn+=henka
N_list[c]+=N_list[b]
N_list[b]=0
print(sumn)
| N=int(input())
a_list=list(map(int,input().split()))
Q=int(input())
N_list=[0]*(100001)
sumn=0
for a in a_list:
N_list[a]+=1
sumn+=a
for i in range(Q):
b,c=map(int,input().split())
henka=(c-b)*N_list[b]
sumn+=henka
N_list[c]+=N_list[b]
N_list[b]=0
print(sumn)
| [
"assignment.value.change",
"identifier.replace.remove",
"literal.replace.add",
"expression.operation.binary.change",
"expression.operation.binary.remove"
] | 345,814 | 345,813 | u025241948 | python |
p02630 | import sys
sys.setrecursionlimit(10**7) #再帰関数の上限,10**5以上の場合python
import math
from copy import copy, deepcopy
from copy import deepcopy as dcp
from operator import itemgetter
from bisect import bisect_left, bisect, bisect_right#2分探索
#bisect_left(l,x), bisect(l,x)#aはソート済みである必要あり。aの中からx未満の要素数を返す。rightだと以下
from collection... | import sys
sys.setrecursionlimit(10**7) #再帰関数の上限,10**5以上の場合python
import math
from copy import copy, deepcopy
from copy import deepcopy as dcp
from operator import itemgetter
from bisect import bisect_left, bisect, bisect_right#2分探索
#bisect_left(l,x), bisect(l,x)#aはソート済みである必要あり。aの中からx未満の要素数を返す。rightだと以下
from collection... | [
"assignment.add"
] | 345,823 | 345,824 | u424768586 | python |
p02630 | n=int(input())
arr=list(map(int,input().split()))
s=0
d={}
for i in arr:
if i in d:
d[i]+=1
else:
d[i]=1
s+=i
for i in range(int(input())):
a,b=map(int,input().split())
if a in d:
s=s-a*d[a]+b*d[a]
if b in d:
d[b]+=d[a]
else:
if a in d:
d[b... | n=int(input())
arr=list(map(int,input().split()))
s=0
d={}
for i in arr:
if i in d:
d[i]+=1
else:
d[i]=1
s+=i
for i in range(int(input())):
a,b=map(int,input().split())
if a in d:
s=s-a*d[a]+b*d[a]
if b in d and a in d:
d[b]+=d[a]
else:
if a in d:
... | [
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change"
] | 345,843 | 345,844 | u567225946 | python |
p02630 | N = int(input())
A = list(map(int, input().split()))
Q = int(input())
BC = [list(map(int, input().split())) for _ in range(Q)]
ans = sum(A)
R = {}
for i in A:
if i in R:
R[i] += 1
else:
R[i] = 1
for b, c in BC:
if b in R:
t = R[b]
ans += t * (c - b)
if c in R:
R[c] += t
else:
... | N = int(input())
A = list(map(int, input().split()))
Q = int(input())
BC = [list(map(int, input().split())) for _ in range(Q)]
ans = sum(A)
R = {}
for i in A:
if i in R:
R[i] += 1
else:
R[i] = 1
for b, c in BC:
if b in R:
t = R[b]
R[b] = 0
ans += t * (c - b)
if c in R:
R[c] += t
... | [
"assignment.add"
] | 345,853 | 345,854 | u456353530 | python |
p02631 | N = int(input())
A = map(int, input().split())
XOR = 0
for a in A:
XOR ^= a
for i in range(N):
A[i] = A[i]^XOR
print(*A)
| N = int(input())
A = list(map(int, input().split()))
XOR = 0
for a in A:
XOR ^= a
for i in range(N):
A[i] = A[i]^XOR
print(*A) | [
"call.add",
"call.arguments.change"
] | 345,909 | 345,910 | u845573105 | python |
p02631 | n = int(input())
lis = list(map(int, input().split()))
t = lis[0]
for i in range(1, n):
t ^= i
ans = [0] * n
for i , j in enumerate(lis):
ans[i] = t ^ j
print(*ans) | n = int(input())
lis = list(map(int, input().split()))
t = lis[0]
for i in range(1, n):
t ^= lis[i]
ans = [0] * n
for i , j in enumerate(lis):
ans[i] = t ^ j
print(*ans) | [] | 345,915 | 345,916 | u501451051 | python |
p02631 | N = int(input())
a_list = list(map(int, input().split()))
all_xor = 0
res = []
for a in a_list:
all_xor ^= a
for a in a_list:
res.append(a ^ all_xor)
print(res)
| N = int(input())
a_list = list(map(int, input().split()))
all_xor = 0
res = []
for a in a_list:
all_xor ^= a
for a in a_list:
res.append(a ^ all_xor)
print(*res)
| [
"call.arguments.change"
] | 345,927 | 345,928 | u326278153 | python |
p02631 | N = int(input())
A = map(int, input().split())
ax = 0
ans = []
for a in A:
ax ^= a
for a in A:
ans.append(a^ax)
print(" ".join(map(str,ans))) | N = int(input())
A = list(map(int, input().split()))
ax = 0
ans = []
for a in A:
ax ^= a
for a in A:
ans.append(a^ax)
print(" ".join(map(str,ans))) | [
"call.add",
"call.arguments.change"
] | 345,939 | 345,940 | u952656646 | python |
p02631 | n = int(input())
a = sorted(list(map(int, input().split())))
x = 0
for i in a:
x ^= i
for i in range(n):
a[i] ^= x
print(*a) | n = int(input())
a = list(map(int, input().split()))
x = 0
for i in a:
x ^= i
for i in range(n):
a[i] ^= x
print(*a) | [
"call.remove",
"call.arguments.change"
] | 345,965 | 345,966 | u731603651 | python |
p02631 | n = int(input())
a = list(map(int,input().split()))
xor_a = 0
for i in range(n):
xor_a ^= a[i]
print(xor_a)
ans = []
for i in range(n):
ans.append(a[i] ^ xor_a)
print(*ans)
| n = int(input())
a = list(map(int,input().split()))
xor_a = 0
for i in range(n):
xor_a ^= a[i]
#print(xor_a)
ans = []
for i in range(n):
ans.append(a[i] ^ xor_a)
print(*ans)
| [
"call.remove"
] | 345,976 | 345,977 | u167681994 | python |
p02631 | N = int(input())
A = map(int, input().split())
total = 0
for a in A:
total ^= a
result = []
for a in A:
result.append(total ^ a)
print(*result) | N = int(input())
A = list(map(int, input().split()))
total = 0
for a in A:
total ^= a
result = []
for a in A:
result.append(total ^ a)
print(*result) | [
"call.add",
"call.arguments.change"
] | 345,982 | 345,983 | u809714729 | python |
p02631 | N = int(input())
a = list(map(int,input().split()))
tmp = 0
for i in a:
tmp ^= i
ans = a[:]
for i in range(N):
ans[i] ^= tmp
print(ans) | N = int(input())
a = list(map(int,input().split()))
tmp = 0
for i in a:
tmp ^= i
ans = a[:]
for i in range(N):
ans[i] ^= tmp
print(*ans) | [
"call.arguments.change"
] | 345,987 | 345,988 | u634461820 | python |
p02631 | n = int(input())
arr = list(map(int,input().split()))
xors = 0
for val in arr:
xors^=val
ans = []
for i in range(n):
ans.append(xros^arr[i])
print(*ans) | n = int(input())
arr = list(map(int,input().split()))
xors = 0
for val in arr:
xors^=val
ans = []
for i in range(n):
ans.append(xors^arr[i])
print(*ans)
| [
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 345,995 | 345,996 | u228303592 | python |
p02631 | N = int(input())
A = list(map(int, input().split()))
s = 0
for i in range(N):
s ^= A[i]
print(s)
for i in range(N):
ans = s^A[i]
print(ans, end=" ") | N = int(input())
A = list(map(int, input().split()))
s = 0
for i in range(N):
s ^= A[i]
for i in range(N):
ans = s^A[i]
print(ans, end=" ") | [
"call.remove"
] | 346,035 | 346,036 | u841856382 | python |
p02631 | N = int(input())
A = list(map(int, input().split()))
xor = 0
for i in A:
A ^= i
for j in range(N):
print(A^a[i], end=' ')
| N = int(input())
A = list(map(int, input().split()))
xor = 0
for i in A:
xor ^= i
for j in range(N):
print(xor^A[j], end=' ') | [
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change",
"variable_access.subscript.index.change"
] | 346,042 | 346,043 | u455809703 | python |
p02631 | n = int(input())
a = list(map(int, input().split()))
x = 0
for i in range(1, n):
x = x^a[i]
l = [x]
for i in range(n-1):
x = a[i]^a[i+1]
l.append(l[i]^x)
print(l)
| n = int(input())
a = list(map(int, input().split()))
x = 0
for i in range(1, n):
x = x^a[i]
l = [x]
for i in range(n-1):
x = a[i]^a[i+1]
l.append(l[i]^x)
print(*l)
| [
"call.arguments.change"
] | 346,065 | 346,066 | u326775883 | python |
p02631 | n = int(input())
a = list(map(int, input().split()))
b = 0
for i in range(n):
b ^= a[i]
ans = []
for i in range(n):
ap = b ^ a[i]
ans.append(ap)
print(*list(set(ans)))
| n = int(input())
a = list(map(int, input().split()))
b = 0
for i in range(n):
b ^= a[i]
ans = []
for i in range(n):
ap = b ^ a[i]
ans.append(ap)
print(*ans)
| [
"call.remove",
"call.arguments.change"
] | 346,073 | 346,074 | u126146165 | python |
p02631 | n = int(input())
arr = list(map(int, input().split()))
for i in arr:
total ^= i
for i in arr:
print(total ^ i, end=' ') | n = int(input())
arr = list(map(int, input().split()))
total = 0
for i in arr:
total ^= i
for i in arr:
print(total ^ i, end=' ') | [
"assignment.add"
] | 346,079 | 346,080 | u139132412 | python |
p02631 | N = int(input())
A = list(map(int, input().split()))
p = 0
for i in range(1, N):
p ^= A[i]
print(p)
ans = [str(p)]
for i in range(1, N):
t = A[i-1] ^ A[i]
p = p ^ t
ans.append(str(p))
print(" ".join(ans))
| N = int(input())
A = list(map(int, input().split()))
p = 0
for i in range(1, N):
p ^= A[i]
ans = [str(p)]
for i in range(1, N):
t = A[i-1] ^ A[i]
p = p ^ t
ans.append(str(p))
print(" ".join(ans))
| [
"call.remove"
] | 346,085 | 346,086 | u327465093 | python |
p02631 | n = int(input())
list = [int(i) for i in input().split()]
total = 0
ans = []
for i in range(n):
total = total ^ list[i]
print(total)
for j in range(n):
ans.append(str(total^list[j]))
print(" ".join(ans))
| n = int(input())
list = [int(i) for i in input().split()]
total = 0
ans = []
for i in range(n):
total = total ^ list[i]
for j in range(n):
ans.append(str(total^list[j]))
print(" ".join(ans))
| [
"call.remove"
] | 346,113 | 346,114 | u970082363 | python |
p02631 | n=int(input())
alist=list(map(int,input().split()))
allh=alist[0]^alist[1]
for i in range(n-1):
allh = allh ^ alist[i+2]
outlist=[]
for a in alist:
outlist.append(str(allh ^ a))
outlist.append(" ")
outlist.pop()
print("".join(outlist))
| n=int(input())
alist=list(map(int,input().split()))
allh=alist[0]^alist[1]
for i in range(n-2):
allh = allh ^ alist[i+2]
outlist=[]
for a in alist:
outlist.append(str(allh ^ a))
outlist.append(" ")
outlist.pop()
print("".join(outlist))
| [
"literal.number.integer.change",
"call.arguments.change",
"expression.operation.binary.change",
"control_flow.loop.range.bounds.upper.change"
] | 346,142 | 346,143 | u485979475 | python |
p02631 | n=int(input())
alist=list(map(int,input().split()))
allh=alist[0]^alist[1]
for i in range(n-1):
allh = allh ^ alist[i+1]
outlist=[]
for a in alist:
outlist.append(str(allh ^ a))
outlist.append(" ")
outlist.pop()
print("".join(outlist))
| n=int(input())
alist=list(map(int,input().split()))
allh=alist[0]^alist[1]
for i in range(n-2):
allh = allh ^ alist[i+2]
outlist=[]
for a in alist:
outlist.append(str(allh ^ a))
outlist.append(" ")
outlist.pop()
print("".join(outlist))
| [
"literal.number.integer.change",
"call.arguments.change",
"expression.operation.binary.change",
"control_flow.loop.range.bounds.upper.change",
"assignment.value.change",
"variable_access.subscript.index.change"
] | 346,144 | 346,143 | u485979475 | python |
p02631 | import math # noqa: F401
from typing import Dict, List, Optional, Tuple, Union # noqa: F401
def sum_xor(A: List[int]) -> int:
sum_ = 0
for a in A:
sum_ ^= a
return sum_
def main(N: int, A: List[int]):
sum_ = sum_xor(A)
for a in A:
print(a ^ sum_, end="")
print()
if __name... | import math # noqa: F401
from typing import Dict, List, Optional, Tuple, Union # noqa: F401
def sum_xor(A: List[int]) -> int:
sum_ = 0
for a in A:
sum_ ^= a
return sum_
def main(N: int, A: List[int]):
sum_ = sum_xor(A)
for a in A:
print(a ^ sum_, end=" ")
print()
if __nam... | [
"literal.string.change",
"call.arguments.change",
"io.output.change"
] | 346,162 | 346,163 | u673894722 | python |
p02631 | n=int(input())
a=list(map(int,input().split()))
ans=[]
b=a.copy()
del b[0]
a1=0
a2=a[1]
for i in b:
a1=a1^i
ans.append(a1)
for i in b:
ansii=a1^i
ansi=a2^ansii
ans.append(ansi)
for i in range(n):
print(ans[i],end=' ') | n=int(input())
a=list(map(int,input().split()))
ans=[]
b=a.copy()
del b[0]
a1=0
a2=a[0]
for i in b:
a1=a1^i
ans.append(a1)
for i in b:
ansii=a1^i
ansi=a2^ansii
ans.append(ansi)
for i in range(n):
print(ans[i],end=' ') | [
"literal.number.integer.change",
"assignment.value.change",
"variable_access.subscript.index.change"
] | 346,164 | 346,165 | u919235786 | python |
p02631 | n = int(input())
a=list(map(int,input().split()))
forward = []
back = []
result = ''
t = 0
for i in range(n):
t ^= a[i]
forward.append(t)
t = 0
for i in range(n-1, -1, -1):
t ^= a[i]
back.append(t)
print(forward, back)
for i in range(n):
if i == 0:
t = back[n-2]
elif i == n-1:
t... | n = int(input())
a=list(map(int,input().split()))
forward = []
back = []
result = ''
t = 0
for i in range(n):
t ^= a[i]
forward.append(t)
t = 0
for i in range(n-1, -1, -1):
t ^= a[i]
back.append(t)
for i in range(n):
if i == 0:
t = back[n-2]
elif i == n-1:
t = forward[n-2]
e... | [
"call.remove"
] | 346,179 | 346,178 | u984592063 | python |
p02631 | def main():
n = int(input())
a = list(map(int,input().split()))
s = 0
for i, aa in enumerate(a):
if i == 0:
s = aa
else:
s ^= aa
ans = []
if s % 2 == 0:
for i, aa in enumerate(a):
ans.append(s^aa)
else:
for i, aa in enumera... | def main():
n = int(input())
a = list(map(int,input().split()))
s = 0
for i, aa in enumerate(a):
if i == 0:
s = aa
else:
s ^= aa
# print(bin(s))
ans = []
if n % 2 == 0:
for i, aa in enumerate(a):
ans.append(s^aa)
else:
... | [
"identifier.change",
"control_flow.branch.if.condition.change",
"call.arguments.change"
] | 346,186 | 346,187 | u321035578 | python |
p02631 | n = int(input())
a = list(map(int,input().split()))
x = 0
for i in range(n):
x = x^a[i]
print(x)
for i in range(n):
print(x^a[i],end="")
print(" ",end="")
print("") | n = int(input())
a = list(map(int,input().split()))
x = 0
for i in range(n):
x = x^a[i]
for i in range(n):
print(x^a[i],end="")
print(" ",end="")
print("") | [
"call.remove"
] | 346,190 | 346,191 | u614181788 | python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.