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 |
|---|---|---|---|---|---|---|---|
p02817
|
s, t = map(input().split())
x = t + s
print(x)
|
s, t = map(str, input().split())
x = t + s
print(x)
|
[
"call.arguments.add"
] | 618,232
| 618,233
|
u200228637
|
python
|
p02817
|
s,t = map(str,input().split())
print(s+t)
|
s,t = map(str,input().split())
print(t+s)
|
[
"expression.operation.binary.remove"
] | 618,234
| 618,235
|
u175590965
|
python
|
p02817
|
s,t = map(input().split())
print(s+t)
|
s,t = map(str,input().split())
print(t+s)
|
[
"call.arguments.add",
"expression.operation.binary.remove"
] | 618,236
| 618,235
|
u175590965
|
python
|
p02817
|
s,t=map(str,input().split())
print(s+t)
|
s,t=map(str,input().split())
print(t+s)
|
[
"expression.operation.binary.remove"
] | 618,239
| 618,240
|
u069652661
|
python
|
p02817
|
S, T = map(str, input().split())
print(''.join(S+T))
|
S, T = map(str, input().split())
print(''.join(T+S))
|
[
"expression.operation.binary.remove"
] | 618,241
| 618,242
|
u289288647
|
python
|
p02817
|
S, T = map(str, input().split())
print(S+T)
|
S, T = map(str, input().split())
print(T+S)
|
[
"expression.operation.binary.remove"
] | 618,287
| 618,288
|
u523087093
|
python
|
p02817
|
a,b=map(int,input().split())
print(b+a)
|
a,b=map(str,input().split())
print(b+a)
|
[
"assignment.value.change",
"identifier.change",
"call.arguments.change"
] | 618,295
| 618,296
|
u559346857
|
python
|
p02817
|
ST = list(map(str, inpuy().split()))
print(ST[1]+ST[0])
|
ST = list(map(str, input().split()))
print(ST[1]+ST[0])
|
[
"assignment.value.change",
"identifier.change",
"call.function.change",
"call.arguments.change"
] | 618,320
| 618,321
|
u904081717
|
python
|
p02817
|
s,t=map(input().split())
print(t+s)
|
s,t=input().split();print(t+s)
|
[
"call.remove",
"call.arguments.change"
] | 618,324
| 618,325
|
u997393081
|
python
|
p02817
|
s=input()
t=input()
print(t+s)
|
s,t=input().split()
print(t+s)
|
[
"assignment.variable.change",
"call.remove",
"call.add"
] | 618,329
| 618,330
|
u035453792
|
python
|
p02817
|
S, T = map(input().split())
print('{}{}'.format(T, S))
|
S, T = map(str, input().split())
print('{}{}'.format(T, S))
|
[
"call.arguments.add"
] | 618,335
| 618,336
|
u088063513
|
python
|
p02817
|
S, T = map(int,input().split())
print('{}{}'.format(T,S))
|
S, T = map(str, input().split())
print('{}{}'.format(T, S))
|
[
"assignment.value.change",
"identifier.change",
"call.arguments.change"
] | 618,337
| 618,336
|
u088063513
|
python
|
p02817
|
s,t = (i for i in input().split())
print(s+t)
|
s,t = (i for i in input().split())
print(t+s)
|
[
"expression.operation.binary.remove"
] | 618,355
| 618,356
|
u221264296
|
python
|
p02817
|
S, T = map(str, input().split())
print(S+T)
|
S, T = map(str, input().split())
print(T+S)
|
[
"expression.operation.binary.remove"
] | 618,357
| 618,358
|
u284262180
|
python
|
p02817
|
s = [x.strip() for x in input().split()]
print(s[0] + s[1])
|
s = [x.strip() for x in input().split()]
print(s[1] + s[0])
|
[
"literal.number.integer.change",
"variable_access.subscript.index.change",
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change"
] | 618,359
| 618,360
|
u787679173
|
python
|
p02817
|
a,b = input().split()
print(a+b)
|
a,b = input().split()
print(b+a)
|
[
"expression.operation.binary.remove"
] | 618,374
| 618,375
|
u112247039
|
python
|
p02817
|
inp = str(input()).split(" ")
print(inp[0]+inp[1])
|
inp = str(input()).split(" ")
print(inp[1]+inp[0])
|
[
"literal.number.integer.change",
"variable_access.subscript.index.change",
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change"
] | 618,376
| 618,377
|
u716660050
|
python
|
p02817
|
# A - Strings
S, T = map(str, input().split())
print(S + T)
|
# A - Strings
S, T = map(str, input().split())
print(T + S)
|
[
"expression.operation.binary.remove"
] | 618,378
| 618,379
|
u537892680
|
python
|
p02817
|
S,T = input().split()
print(T,S)
|
S,T = input().split()
print(T+S)
|
[
"call.arguments.change",
"io.output.change"
] | 618,387
| 618,388
|
u857673087
|
python
|
p02817
|
S,T = map(input().split())
print(T,S)
|
S,T = input().split()
print(T+S)
|
[
"call.remove",
"call.arguments.change",
"io.output.change"
] | 618,389
| 618,388
|
u857673087
|
python
|
p02817
|
line = input()
s, t = line.split(" ")
ans = s + t
print(ans)
|
line = input()
s, t = line.split(" ")
ans = t + s
print(ans)
|
[
"expression.operation.binary.remove"
] | 618,461
| 618,462
|
u844813573
|
python
|
p02817
|
s,t = input().split()
print(str(s)+str(t))
|
s,t = input().split()
print(str(t)+str(s))
|
[
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change"
] | 618,463
| 618,464
|
u299791633
|
python
|
p02817
|
s,t=map(str,input.split())
print(t+s)
|
s,t=map(str,input().split())
print(t+s)
|
[
"call.add"
] | 618,471
| 618,472
|
u588794534
|
python
|
p02817
|
list= list(input().split())
print(list[0]+list[1])
|
list= list(input().split())
print(list[1]+list[0])
|
[
"literal.number.integer.change",
"variable_access.subscript.index.change",
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change"
] | 618,477
| 618,478
|
u886459614
|
python
|
p02817
|
S = input().split()
print(S[0]+S[1])
|
S = input().split()
print(S[1]+S[0])
|
[
"literal.number.integer.change",
"variable_access.subscript.index.change",
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change"
] | 618,489
| 618,490
|
u878291720
|
python
|
p02817
|
s, t = input().split()
print("%s%s" %(s,t))
|
s, t = input().split()
print("%s%s" %(t,s))
|
[] | 618,491
| 618,492
|
u435835715
|
python
|
p02817
|
a,b = input().split()
print(a,b,sep ='')
|
a,b = input().split()
print(b,a,sep ='')
|
[
"call.arguments.change",
"call.arguments.add"
] | 618,493
| 618,494
|
u345136423
|
python
|
p02817
|
s, t = map(str, input().split())
print(t,s)
|
s, t = map(str, input().split())
print(t+s)
|
[
"call.arguments.change",
"io.output.change"
] | 618,504
| 618,505
|
u597017430
|
python
|
p02817
|
s, t = map(str, input().split())
print(s+t)
|
s, t = map(str, input().split())
print(t+s)
|
[
"expression.operation.binary.remove"
] | 618,509
| 618,510
|
u215334265
|
python
|
p02817
|
S, T = map(str, input().split())
print("{}{}",format(T, S))
|
S, T = map(str, input().split())
print("{}{}".format(T, S))
|
[
"call.arguments.change",
"io.output.change"
] | 618,513
| 618,514
|
u238084414
|
python
|
p02817
|
s,t = str(input())
print(t+s)
|
s,t = str(input()).split()
print(t+s)
|
[
"call.add"
] | 618,517
| 618,518
|
u760636024
|
python
|
p02817
|
S,D= map(str,input().split())
print(S+D)
|
S,D= map(str,input().split())
print(D+S)
|
[
"expression.operation.binary.remove"
] | 618,528
| 618,529
|
u374765578
|
python
|
p02817
|
s,t = input().split()
print(s+t)
|
s,t = input().split()
print(t+s)
|
[
"expression.operation.binary.remove"
] | 618,532
| 618,533
|
u189806337
|
python
|
p02817
|
s,t = map(str, input().split())
print(s+t)
|
s,t = map(str, input().split())
print(t+s)
|
[
"expression.operation.binary.remove"
] | 618,534
| 618,535
|
u362563655
|
python
|
p02817
|
inputted = input().split()
S = inputted[0]
T = inputted[1]
answer = S + T
print(answer)
|
inputted = input().split()
S = inputted[0]
T = inputted[1]
answer = T + S
print(answer)
|
[
"expression.operation.binary.remove"
] | 618,547
| 618,548
|
u017624958
|
python
|
p02817
|
from sys import stdin
S, T = stdin.readline().rstrip().split()
print(S+T)
|
from sys import stdin
S, T = stdin.readline().rstrip().split()
print(T+S)
|
[
"expression.operation.binary.remove"
] | 618,564
| 618,565
|
u868981240
|
python
|
p02817
|
import sys
input = sys.stdin.readline
INF = float('inf')
def main():
S, T = map(str, input().split())
print(S + T)
if __name__ == '__main__':
main()
|
import sys
input = sys.stdin.readline
INF = float('inf')
def main():
S, T = map(str, input().split())
print(T + S)
if __name__ == '__main__':
main()
|
[
"expression.operation.binary.remove"
] | 618,568
| 618,569
|
u554781254
|
python
|
p02817
|
S, T = [int(i) for i in input().split()]
print(T+S)
|
S, T = [i for i in input().split()]
print(T+S)
|
[
"call.remove",
"call.arguments.change"
] | 618,583
| 618,584
|
u923712635
|
python
|
p02817
|
n = input()
(p,q) = n.split()
print(p+q)
|
n = input()
(p,q) = n.split()
print(q+p)
|
[
"expression.operation.binary.remove"
] | 618,585
| 618,586
|
u224554402
|
python
|
p02817
|
li = list(input())
print(li[1]+li[0])
|
li = input().split()
print(li[1]+li[0])
|
[
"call.remove",
"call.add"
] | 618,587
| 618,588
|
u594803920
|
python
|
p02817
|
s,t = input().split()
print(''.join([s,t]))
|
s,t = input().split()
print(''.join([t,s]))
|
[] | 618,606
| 618,607
|
u863442865
|
python
|
p02817
|
#S,T = map(int,input().split())
S,T = input().split()
#S = input()
print(S+T)
|
#S,T = map(int,input().split())
S,T = input().split()
#S = input()
print(T+S)
|
[
"expression.operation.binary.remove"
] | 618,617
| 618,618
|
u143051858
|
python
|
p02817
|
S, T = input().split()
ans = S + T
print(ans)
|
S, T = input().split()
ans = T + S
print(ans)
|
[
"expression.operation.binary.remove"
] | 618,619
| 618,620
|
u712284046
|
python
|
p02817
|
S,T = map(str,input().split())
print ( S + T )
|
S,T = map(str,input().split())
print ( T + S )
|
[
"expression.operation.binary.remove"
] | 618,633
| 618,634
|
u354623416
|
python
|
p02817
|
A,B = map(str,input().split())
out = A+B
print(out)
|
A,B = map(str,input().split())
out = B+A
print(out)
|
[
"expression.operation.binary.remove"
] | 618,637
| 618,638
|
u267029978
|
python
|
p02817
|
S,T = map(str,input().split())
print(S+T)
|
S,T = map(str,input().split())
print(T+S)
|
[
"expression.operation.binary.remove"
] | 618,641
| 618,642
|
u562015767
|
python
|
p02817
|
print(''.join(input().split().reverse()))
|
print(''.join(reversed(input().split())))
|
[
"call.add",
"call.remove"
] | 618,649
| 618,650
|
u781758937
|
python
|
p02817
|
print(''.join(input().split()))
|
print(''.join(reversed(input().split())))
|
[
"call.arguments.add",
"call.arguments.change"
] | 618,651
| 618,650
|
u781758937
|
python
|
p02817
|
s, t = input.split()
print(t+s)
|
s, t = input().split()
print(t+s)
|
[
"call.add"
] | 618,682
| 618,683
|
u550294762
|
python
|
p02817
|
a, b = input().split()
print(a, b, sep="")
|
a, b = input().split()
print(b, a, sep="")
|
[
"call.arguments.change",
"call.arguments.add"
] | 618,706
| 618,707
|
u528470578
|
python
|
p02817
|
s, t = input().split().rstrip()
print(t + s)
|
s, t = input().rstrip().split()
print(t + s)
|
[
"call.remove"
] | 618,712
| 618,713
|
u622570247
|
python
|
p02817
|
print("".join(input().split()))
|
print("".join(reversed(input().split())))
|
[
"call.arguments.add",
"call.arguments.change"
] | 618,720
| 618,721
|
u123745130
|
python
|
p02817
|
S, T = map(str, input().split())
ans = S + T
print(ans)
|
S, T = map(str, input().split())
ans = T + S
print(ans)
|
[
"expression.operation.binary.remove"
] | 618,738
| 618,739
|
u964521959
|
python
|
p02817
|
S,T=input().split('')
print(T+S)
|
S,T=input().split(' ')
print(T+S)
|
[
"literal.string.change",
"assignment.value.change",
"call.arguments.change"
] | 618,742
| 618,743
|
u474423089
|
python
|
p02817
|
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
S, T = input().split()
U = S+T
print(U)
|
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
S, T = input().split()
U = T+S
print(U)
|
[
"expression.operation.binary.remove"
] | 618,746
| 618,747
|
u939658851
|
python
|
p02817
|
ST = input().split()
s = ""
s += ST[0]
s += ST[1]
print(s)
|
ST = input().split()
s = ""
s += ST[1]
s += ST[0]
print(s)
|
[] | 618,750
| 618,751
|
u703890795
|
python
|
p02817
|
s, t = input().split()
print(s + t)
|
s, t = input().split()
print(t + s)
|
[
"expression.operation.binary.remove"
] | 618,758
| 618,759
|
u540698208
|
python
|
p02817
|
s,t = input().split()
print(s + t)
|
s,t = input().split()
print(t + s)
|
[
"expression.operation.binary.remove"
] | 618,770
| 618,771
|
u300457253
|
python
|
p02817
|
S,T=map(input().split())
print('{}{}'.format(T,S))
|
S,T=map(str,input().split())
print('{}{}'.format(T,S))
|
[
"call.arguments.add"
] | 618,772
| 618,773
|
u355154595
|
python
|
p02817
|
# -*- coding: utf-8 -*-
S = input()
T = input()
print(T+S)
|
# -*- coding: utf-8 -*-
S,T = input().split()
print(T+S)
|
[
"assignment.variable.change",
"call.remove",
"call.add"
] | 618,776
| 618,777
|
u401902038
|
python
|
p02817
|
S,T=input().split(" ")
print(S+T)
|
S,T=input().split(" ")
print(T+S)
|
[
"expression.operation.binary.remove"
] | 618,791
| 618,792
|
u930705402
|
python
|
p02817
|
S,T=input().split()
S+=T
print(S)
|
S,T=input().split()
T+=S
print(T)
|
[
"identifier.change",
"call.arguments.change",
"io.output.change"
] | 618,804
| 618,805
|
u301624971
|
python
|
p02817
|
num = list(input().split())
print(str(num[0])+str(num[1]))
|
num = list(input().split())
print(str(num[1])+str(num[0]))
|
[
"expression.operation.binary.remove",
"call.arguments.change"
] | 618,811
| 618,812
|
u515052479
|
python
|
p02817
|
l = input().split()
print(l[0]+l[1])
|
l = input().split()
print(l[1]+l[0])
|
[
"literal.number.integer.change",
"variable_access.subscript.index.change",
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change"
] | 618,824
| 618,825
|
u674574659
|
python
|
p02817
|
s,t =input().split()
print(s+t)
|
s,t =input().split()
print(t+s)
|
[
"expression.operation.binary.remove"
] | 618,832
| 618,833
|
u032222383
|
python
|
p02817
|
def main():
s,t =input().split
print(t+s)
main()
|
def main():
s,t =input().split()
print(t+s)
main()
|
[
"call.add"
] | 618,858
| 618,859
|
u597443755
|
python
|
p02817
|
import sys
sys.setrecursionlimit(12345678)
import itertools
from collections import Counter
from collections import defaultdict
from collections import deque
import bisect
from heapq import heappush, heappop
def main():
s, t = input().split()
print(s + t)
if __name__ == '__main__':
main()
|
import sys
sys.setrecursionlimit(12345678)
import itertools
from collections import Counter
from collections import defaultdict
from collections import deque
import bisect
from heapq import heappush, heappop
def main():
s, t = input().split()
print(t + s)
if __name__ == '__main__':
main()
|
[
"expression.operation.binary.remove"
] | 618,860
| 618,861
|
u374103100
|
python
|
p02817
|
S, T = input().split()
print(S + T)
|
S, T = input().split()
print(T + S)
|
[
"expression.operation.binary.remove"
] | 618,868
| 618,869
|
u588749694
|
python
|
p02817
|
s,t = map(str, input(),split())
print(t + s)
|
s,t = map(str, input().split())
print(t+s)
|
[
"assignment.value.change",
"call.arguments.change"
] | 618,870
| 618,871
|
u918363735
|
python
|
p02817
|
S,T=map(str, input().split())
ans=S+T
print(ans)
|
S,T=map(str, input().split())
ans=T+S
print(ans)
|
[
"expression.operation.binary.remove"
] | 618,872
| 618,873
|
u843506660
|
python
|
p02817
|
a,b= input().split()
print(a+b)
|
a,b= input().split()
print(b+a)
|
[
"expression.operation.binary.remove"
] | 618,885
| 618,886
|
u293198424
|
python
|
p02817
|
s,t=map(input().split())
ans=t+s
print(ans)
|
s,t=input().split()
ans=t+s
print(ans)
|
[
"call.remove",
"call.arguments.change"
] | 618,889
| 618,890
|
u768559443
|
python
|
p02817
|
S, T = input().split();print(S + T)
|
S, T = input().split();print(T + S)
|
[
"expression.operation.binary.remove"
] | 618,893
| 618,894
|
u257050137
|
python
|
p02817
|
A, B = (input().split())
print(B,A)
|
A, B = (input().split())
print(B+A)
|
[
"call.arguments.change",
"io.output.change"
] | 618,899
| 618,900
|
u799635973
|
python
|
p02817
|
s,t = map(input().split())
print(t + s)
|
a, b = map(str, input().split())
print(b + a)
|
[
"assignment.variable.change",
"identifier.change",
"call.arguments.add",
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change"
] | 618,901
| 618,902
|
u843318346
|
python
|
p02817
|
print("".join(input().split()))
|
print("".join(input().split()[::-1]))
|
[] | 618,903
| 618,904
|
u254050469
|
python
|
p02817
|
import sys
input=sys.stdin.readline
s,t = input().split()
print(s+t)
|
import sys
input=sys.stdin.readline
s,t = input().split()
print(t+s)
|
[
"expression.operation.binary.remove"
] | 618,917
| 618,918
|
u624696727
|
python
|
p02817
|
s, t = map(str, input().split())
print(s + t)
|
s, t = map(str, input().split())
print(t + s)
|
[
"expression.operation.binary.remove"
] | 618,947
| 618,948
|
u839584122
|
python
|
p02817
|
S,T = map(input().split())
U = ""
U = U + T + S
print(U)
|
S,T = input().split()
U = ""
U = U + T + S
print(U)
|
[
"call.remove",
"call.arguments.change"
] | 618,956
| 618,957
|
u940061594
|
python
|
p02817
|
if __name__ == '__main__':
a, b = input().split(' ')
print(a+b)
|
if __name__ == '__main__':
a, b = input().split(' ')
print(b+a)
|
[
"expression.operation.binary.remove"
] | 618,963
| 618,964
|
u644224332
|
python
|
p02817
|
chars = input.split(" ")
print(chars[1]+char[0])
|
chars = input().split(" ")
print(chars[1]+chars[0])
|
[
"call.add",
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change"
] | 618,967
| 618,966
|
u796708718
|
python
|
p02817
|
chars = input().split(" ")
print(chars[0]+chars[1])
|
chars = input().split(" ")
print(chars[1]+chars[0])
|
[
"literal.number.integer.change",
"variable_access.subscript.index.change",
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change"
] | 618,968
| 618,966
|
u796708718
|
python
|
p02817
|
a, b = map(str, input().split())
print(b, a)
|
a, b = map(str, input().split())
print(b + a)
|
[
"call.arguments.change",
"io.output.change"
] | 618,971
| 618,972
|
u383713431
|
python
|
p02817
|
s=input().split()
print("{}{}".format(s[0],s[1]))
|
s=input().split()
print("{}{}".format(s[1],s[0]))
|
[
"literal.number.integer.change",
"variable_access.subscript.index.change",
"call.arguments.change",
"io.output.change"
] | 618,978
| 618,979
|
u811535236
|
python
|
p02817
|
s,t=input(),input()
print(t+s)
|
s,t=input().split()
print(t+s)
|
[] | 618,980
| 618,981
|
u269724549
|
python
|
p02817
|
s, t = input.split()
print("".join([t,s]))
|
s, t = input().split()
print("".join([t,s]))
|
[
"call.add"
] | 618,989
| 618,990
|
u766349820
|
python
|
p02817
|
a=input().split()
print(a[0]+a[1])
|
a=input().split()
print(a[1]+a[0])
|
[
"literal.number.integer.change",
"variable_access.subscript.index.change",
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change"
] | 619,005
| 619,006
|
u042662066
|
python
|
p02817
|
S,T=map(str,input().split())
print(S+T)
|
S,T=map(str,input().split())
print(T+S)
|
[
"expression.operation.binary.remove"
] | 619,033
| 619,034
|
u333731247
|
python
|
p02817
|
S,T = map(str, input().split())
print('{}{}'.format(S,T))
|
S,T = map(str, input().split())
print('{}{}'.format(T,S))
|
[
"call.arguments.change",
"call.arguments.add"
] | 619,037
| 619,038
|
u971096161
|
python
|
p02816
|
def xor_next(values):
result = [0] * len(values)
for i in range(len(values)):
result[i] = values[i] ^ values[(i+1) % len(values)]
return result
def make_mp_table(values):
result = [-1] * (len(values) + 1)
j = -1
for i in range(len(values)):
while j != -1 and values[j] != values[i]:
j = result[j]
j += 1
result[i+1] = j
return result
def mp_find(target, pattern, table):
result = []
j = 0
for i in range(len(target)):
while(j != -1 and pattern[j] != target[i]):
j = table[j]
j += 1
if j == len(pattern):
result.append(i-(j-1))
j = table[j]
return result
def main():
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
xa = xor_next(a)
xb = xor_next(b)
mp_t = make_mp_table(xa)
xb += xb
res = mp_find(xb, xa, mp_t)
print(res)
res.sort(reverse=True)
for i in range(len(res)):
k = n-res[i]
if(k >= n):
continue
x = a[k] ^ b[0]
print(str(k) + ' ' + str(x))
main()
|
def xor_next(values):
result = [0] * len(values)
for i in range(len(values)):
result[i] = values[i] ^ values[(i+1) % len(values)]
return result
def make_mp_table(values):
result = [-1] * (len(values) + 1)
j = -1
for i in range(len(values)):
while j != -1 and values[j] != values[i]:
j = result[j]
j += 1
result[i+1] = j
return result
def mp_find(target, pattern, table):
result = []
j = 0
for i in range(len(target)):
while(j != -1 and pattern[j] != target[i]):
j = table[j]
j += 1
if j == len(pattern):
result.append(i-(j-1))
j = table[j]
return result
def main():
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
xa = xor_next(a)
xb = xor_next(b)
mp_t = make_mp_table(xa)
xb += xb
res = mp_find(xb, xa, mp_t)
res.sort(reverse=True)
for i in range(len(res)):
k = n-res[i]
if(k >= n):
continue
x = a[k] ^ b[0]
print(str(k) + ' ' + str(x))
main()
|
[
"call.remove"
] | 619,061
| 619,062
|
u927078824
|
python
|
p02816
|
def Z_algorithm(s):
n = len(s)
A = [n] + [0] * (n-1)
i, j = 1, 0
while i < n:
while i + j < n and s[j] == s[i+j]:
j += 1
A[i] = j
if j == 0:
i += 1
continue
k = 1
while i + k < n and k + A[k] < j:
A[i+k] = A[k]
k += 1
i += k
j -= k
return A
N = int(input())
A = [int(a) for a in input().split()]
B = [int(a) for a in input().split()]
AA = [A[i] ^ A[i-1] for i in range(N)]
BB = [B[i] ^ B[i-1] for i in range(N)]
T = Z_algorithm(AA + [-1] + BB + BB)
for i in range(N, 0, -1):
if T[N+i] >= N:
print(N-i, A[-i%N] ^ B[0])
|
def Z_algorithm(s):
n = len(s)
A = [n] + [0] * (n-1)
i, j = 1, 0
while i < n:
while i + j < n and s[j] == s[i+j]:
j += 1
A[i] = j
if j == 0:
i += 1
continue
k = 1
while i + k < n and k + A[k] < j:
A[i+k] = A[k]
k += 1
i += k
j -= k
return A
N = int(input())
A = [int(a) for a in input().split()]
B = [int(a) for a in input().split()]
AA = [A[i] ^ A[i-1] for i in range(N)]
BB = [B[i] ^ B[i-1] for i in range(N)]
T = Z_algorithm(AA + [-1] + BB + BB)
for i in range(N, 0, -1):
if T[N+i+1] >= N:
print(N-i, A[-i%N] ^ B[0])
|
[
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change",
"misc.off_by_one"
] | 619,069
| 619,070
|
u864197622
|
python
|
p02816
|
def Z_algorithm(s):
n = len(s)
A = [n] + [0] * (n-1)
i, j = 1, 0
while i < n:
while i + j < n and s[j] == s[i+j]:
j += 1
A[i] = j
if j == 0:
i += 1
continue
k = 1
while i + k < n and k + A[k] < j:
A[i+k] = A[k]
k += 1
i += k
j -= k
return A
N = int(input())
A = [int(a) for a in input().split()]
B = [int(a) for a in input().split()]
AA = [A[i] ^ A[i-1] for i in range(N)]
BB = [B[i] ^ B[i-1] for i in range(N)]
T = Z_algorithm(AA + BB + BB)
for i in range(N)[::-1]:
if T[N+i] >= N:
print(N - i, A[-i%N] ^ B[0])
|
def Z_algorithm(s):
n = len(s)
A = [n] + [0] * (n-1)
i, j = 1, 0
while i < n:
while i + j < n and s[j] == s[i+j]:
j += 1
A[i] = j
if j == 0:
i += 1
continue
k = 1
while i + k < n and k + A[k] < j:
A[i+k] = A[k]
k += 1
i += k
j -= k
return A
N = int(input())
A = [int(a) for a in input().split()]
B = [int(a) for a in input().split()]
AA = [A[i] ^ A[i-1] for i in range(N)]
BB = [B[i] ^ B[i-1] for i in range(N)]
T = Z_algorithm(AA + BB + BB)
for i in range(N, 0, -1):
if T[N+i] >= N:
print(N-i, A[-i%N] ^ B[0])
|
[] | 619,071
| 619,072
|
u864197622
|
python
|
p02816
|
def check(ccc, ddd, e, ans):
m = 2147483647
g = 1000000007
for l in range(e):
cl = ccc[l]
if any(c != cl for c in ccc[l::e]):
return
dl = ddd[l]
if any(d != dl for d in ddd[l::e]):
return
s = 0
for c in ccc[:e]:
s = (s * g + c) % m
t = 0
for d in ddd[:e]:
t = (t * g + d) % m
u = pow(g, e, m)
for h in range(e):
if s == t:
bh = bbb[h]
ans.update(((i - h) % n, aaa[i] ^ bh) for i in range(0, n, e))
return
t = (t * g + ddd[(e + h) % n] - ddd[h] * u) % m
def solve(n, aaa, bbb):
ccc = [a1 ^ a2 for a1, a2 in zip(aaa, aaa[1:])] + [aaa[-1] ^ aaa[0]]
ddd = [b1 ^ b2 for b1, b2 in zip(bbb, bbb[1:])] + [bbb[-1] ^ bbb[0]]
ans = set()
e = 1
while e * e <= n:
if n % e != 0:
e += 1
continue
check(ccc, ddd, e, ans)
check(ccc, ddd, n // e, ans)
e += 1
return ans
n = int(input())
aaa = list(map(int, input().split()))
bbb = list(map(int, input().split()))
ans = solve(n, aaa, bbb)
print(''.join('{} {}\n'.format(*answer) for answer in ans))
|
def check(ccc, ddd, e, ans):
m = 2147483647
g = 1000000007
for l in range(e):
cl = ccc[l]
if any(c != cl for c in ccc[l::e]):
return
dl = ddd[l]
if any(d != dl for d in ddd[l::e]):
return
s = 0
for c in ccc[:e]:
s = (s * g + c) % m
t = 0
for d in ddd[:e]:
t = (t * g + d) % m
u = pow(g, e, m)
for h in range(e):
if s == t:
bh = bbb[h]
ans.update(((i - h) % n, aaa[i] ^ bh) for i in range(0, n, e))
return
t = (t * g + ddd[(e + h) % n] - ddd[h] * u) % m
def solve(n, aaa, bbb):
ccc = [a1 ^ a2 for a1, a2 in zip(aaa, aaa[1:])] + [aaa[-1] ^ aaa[0]]
ddd = [b1 ^ b2 for b1, b2 in zip(bbb, bbb[1:])] + [bbb[-1] ^ bbb[0]]
ans = set()
e = 1
while e * e <= n:
if n % e != 0:
e += 1
continue
check(ccc, ddd, e, ans)
check(ccc, ddd, n // e, ans)
e += 1
return ans
n = int(input())
aaa = list(map(int, input().split()))
bbb = list(map(int, input().split()))
ans = solve(n, aaa, bbb)
print(''.join('{} {}\n'.format(*answer) for answer in sorted(ans)))
|
[
"call.add",
"call.arguments.change"
] | 619,075
| 619,076
|
u340781749
|
python
|
p02816
|
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = [a1^a2 for a1, a2 in zip(A, A[1:])] + [A[0]^A[-1]]
C = C + C
D = [b1^b2 for b1, b2 in zip(B, B[1:])] + [B[0]^B[-1]]
K = []
k = 0
while k < N:
next_k = k
is_first = True
for i in range(N):
if is_first and i>0 and C[k+i]==D[0]:
next_k = k + i
if C[k+i] != D[i]:
if next_k == k:
k = k + i + 1
else:
if D[k+i-next_k] == C[k+i]:
k = next_k
else:
k = k + i + 1
break
if i == N-1:
K.append(k)
if next_k == k:
break
else:
k = next_k
if len(K) == 2:
diff = K[1] - K[0]
while K[-1] < N:
K.append(K[-1]+diff)
_ = K.pop()
break
for k in K:
print(k, A[k]^B[0])
|
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = [a1^a2 for a1, a2 in zip(A, A[1:])] + [A[0]^A[-1]]
C = C + C
D = [b1^b2 for b1, b2 in zip(B, B[1:])] + [B[0]^B[-1]]
K = []
k = 0
while k < N:
next_k = k
is_first = True
for i in range(N):
if is_first and i>0 and C[k+i]==D[0]:
next_k = k + i
is_first = False
if C[k+i] != D[i]:
if next_k == k:
k = k + i + 1
else:
if D[k+i-next_k] == C[k+i]:
k = next_k
else:
k = k + i + 1
break
if i == N-1:
K.append(k)
if next_k == k:
break
else:
k = next_k
if len(K) == 2:
diff = K[1] - K[0]
while K[-1] < N:
K.append(K[-1]+diff)
_ = K.pop()
break
for k in K:
print(k, A[k]^B[0])
|
[
"assignment.add"
] | 619,098
| 619,099
|
u922449550
|
python
|
p02817
|
a, b = map(input().split())
print(b + a)
|
a, b = input().split()
print(b + a)
|
[
"call.remove",
"call.arguments.change"
] | 619,232
| 619,233
|
u847033024
|
python
|
p02817
|
str_l = list(map(str, input().split()))
print(''.join(str_l))
|
str_l = list(map(str, input().split()))
print(''.join(list(reversed(str_l))))
|
[
"call.add",
"call.arguments.add"
] | 619,238
| 619,239
|
u905895868
|
python
|
p02817
|
s,t = input().split()
s+=t
print(s)
|
s,t=input().split()
t+=s
print(t)
|
[
"identifier.change",
"call.arguments.change",
"io.output.change"
] | 619,256
| 619,257
|
u566529875
|
python
|
p02817
|
if __name__=="__main__":
s,t=input.split()
print(t+s)
|
if __name__=="__main__":
s,t=input().split()
print(t+s)
|
[
"call.add"
] | 619,258
| 619,259
|
u964416605
|
python
|
p02817
|
x, y = map(int,input().split())
print(y+x)
|
x, y = input().split()
print(y+x)
|
[
"call.remove",
"call.arguments.change"
] | 619,264
| 619,265
|
u680851063
|
python
|
p02817
|
x, y = map(int,input().split())
print(y+x)
|
x, y = input().split()
print(y+x)
|
[
"call.remove",
"call.arguments.change"
] | 619,264
| 619,266
|
u680851063
|
python
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.