QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#73293 | #4389. Copy | poi | AC ✓ | 196ms | 4016kb | C++ | 1.2kb | 2023-01-23 15:12:33 | 2023-01-23 15:12:35 |
Judging History
answer
#include "iostream"
#include "cstring"
#include "cstdio"
#include "algorithm"
#include "queue"
#include "vector"
#include "queue"
#include "stack"
#include "ctime"
#include "set"
#include "map"
#include "cmath"
using namespace std;
#define fi first
#define se second
#define vi vector<int>
#define pb push_back
#define eb emplace_back
#define pii pair<int,int>
#define mp make_pair
#define rep( i , a , b ) for( int i = (a) , i##end = b ; i <= i##end ; ++ i )
#define per( i , a , b ) for( int i = (a) , i##end = b ; i >= i##end ; -- i )
#define mem( a ) memset( a , 0 , sizeof (a) )
#define all( x ) x.begin() , x.end()
//#define int long long
typedef long long ll;
const int MAXN = 2e5 + 10;
int n , q;
int A[MAXN];
void solve() {
cin >> n >> q;
rep( i , 1 , n ) scanf("%d",A + i);
int res = 0;
rep( i , 1 , q ) {
int op , l , r;
scanf("%d",&op);
if( op == 1 ) {
scanf("%d%d",&l,&r);
int len = r - l + 1;
per( i , n , r + 1 ) A[i] = A[i - len];
} else {
scanf("%d",&l);
res ^= A[l];
}
}
cout << res << endl;
}
signed main() {
// freopen("in","r",stdin);
// freopen("out","w",stdout);
int T;cin >> T;while( T-- ) solve();
// solve();
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 196ms
memory: 4016kb
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