QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#340608 | #4389. Copy | crsfaa# | AC ✓ | 172ms | 4128kb | C++14 | 736b | 2024-02-29 10:41:35 | 2024-02-29 10:41:36 |
Judging History
answer
#include<bits/stdc++.h>
#define Yukinoshita namespace
#define Yukino std
using Yukinoshita Yukino;
int read()
{
int s=0,w=1;
char ch=getchar();
while(ch<'0'||ch>'9') w=ch=='-'?-1:1,ch=getchar();
while(ch>='0'&&ch<='9') s=s*10+ch-'0',ch=getchar();
return s*w;
}
const int mxn=1e5+5;
int a[mxn];
int main()
{
int T=read();
while(T--)
{
int n=read(),m=read(),sum=0,i,j;
for(i=1;i<=n;i++)
a[i]=read();
// print(rt),cout<<endl;
while(m--)
{
int opt=read(),l=read();
if(opt==1)
{
int r=read(),len=r-l+1;
for(i=n-len;i>=l;i--)
a[i+len]=a[i];
// for(i=1;i<=n;i++)
// cout<<a[i]<<' ';
// cout<<endl;
}
else sum^=a[l];
}
printf("%d\n",sum);
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 172ms
memory: 4128kb
input:
2 5 10 14138491 23289232 33892225 43531245 54436322 1 1 4 2 2 2 3 2 4 2 5 1 2 4 2 2 2 3 2 4 2 5 99990 99990 493133979 94198606 751145654 147404311 601524088 744747426 561746143 212260573 241231749 810352224 81276441 382492450 18779020 317505899 880615584 654793240 417574821 822313301 140569958 69317...
output:
28631531 787379207
result:
ok 2 lines