QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#73293#4389. CopypoiAC ✓196ms4016kbC++1.2kb2023-01-23 15:12:332023-01-23 15:12:35

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-01-23 15:12:35]
  • 评测
  • 测评结果:AC
  • 用时:196ms
  • 内存:4016kb
  • [2023-01-23 15:12:33]
  • 提交

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();
}

詳細信息

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