QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#879006 | #8959. Nasty Operations | kangkunma | WA | 12ms | 8960kb | Python3 | 511b | 2025-02-01 19:43:28 | 2025-02-01 19:43:29 |
Judging History
answer
def s(n,m,l,r):
o=sum(r[0:m-m%2]);x=0
f=o<0
for i in l:x^=i
if o%(n+1)<1:A=l
else:o=(-o)%(n+1)-(o<0);A=l[o+1::]+[x]+l[0:o]
if m%2<1:return A
if r[-1]%2<1:A=A[::-1]
D=[A[0]]
for i in range(n-1):D.append(A[i+1]^D[-1])
if r[-1]%2<1:D=D[::-1]
return D
from sys import stdin
for i in range(int(input())):
n,m=map(int,stdin.readline().split())
l=[*map(int,stdin.readline().split())]
r=[*map(int,stdin.readline().split())]
print(*s(n,m,l,r))
詳細信息
Test #1:
score: 0
Wrong Answer
time: 12ms
memory: 8960kb
input:
3 5 1 0 1 2 4 8 1 7 2 25 2 20 23 998 244 353 2 -2 9 9 9 9 8 2 4 4 3 5 3 2 -1 2 -1 2 -1 2 -1 2
output:
0 1 3 7 15 25 2 20 23 998 244 353 3 6 5 10 3 10 2 0 4
result:
wrong answer 13th numbers differ - expected: '4', found: '3'