QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#95800 | #4389. Copy | 3360550356 | AC ✓ | 485ms | 4180kb | C++14 | 1.5kb | 2023-04-11 22:11:32 | 2023-04-11 22:11:33 |
Judging History
answer
#include <bits/stdc++.h>
#define endl '\n'
#define int long long
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> PII;
const int N = 2e5+10;
const int M = 2e6 + 10;
const int mod = 998244353;
const int INF=1e9;
const double PI=acos(-1);
const double eps=1e-10;
int a[N];
void solve(){
int n,q;
cin>>n>>q;
for(int i = 1; i <= n; i++)cin>>a[i];
int ans = 0;
while(q--){
int op; cin>>op;
if(op==1){
int l, r; cin>>l>>r;
int len = r-l+1;
for(int i = n; i >= r+1; i--)a[i] = a[i-len];
}else{
int x; cin>>x;
ans ^= a[x];
}
}
cout<<ans<<endl;
}
signed main() {
int T=1;
cin>>T;
while(T--) {
solve();
}
}
/**
* ┏┓ ┏┓+ +
* ┏┛┻━━━┛┻┓ + +
* ┃ ┃
* ┃ ━ ┃ ++ + + +
* ████━████+
* ◥██◤ ◥██◤ +
* ┃ ┻ ┃
* ┃ ┃ + +
* ┗━┓ ┏━┛
* ┃ ┃ + + + +Code is far away from
* ┃ ┃ + bug with the animarr protecting
* ┃ ┗━━━┓ 神兽保佑,代码无bug
* ┃ ┣┓
* ┃ ┏┛
* ┗┓┓┏━┳┓┏┛ + + + +
* ┃┫┫ ┃┫┫
* ┗┻┛ ┗┻┛+ + + +
*/
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 485ms
memory: 4180kb
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