QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#879006#8959. Nasty OperationskangkunmaWA 12ms8960kbPython3511b2025-02-01 19:43:282025-02-01 19:43:29

Judging History

This is the latest submission verdict.

  • [2025-02-01 19:43:29]
  • Judged
  • Verdict: WA
  • Time: 12ms
  • Memory: 8960kb
  • [2025-02-01 19:43:28]
  • Submitted

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'