QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#57633#4389. Copyqinjianbin#WA 142ms42424kbC++17854b2022-10-22 16:13:462022-10-22 16:13:49

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-10-22 16:13:49]
  • 评测
  • 测评结果:WA
  • 用时:142ms
  • 内存:42424kb
  • [2022-10-22 16:13:46]
  • 提交

answer

#include <bits/stdc++.h>
#include <ext/rope>
#define rep(i, a, b) for(int i = (a); i < (b); i++)
#define _for(i, a, b) for(int i = (a); i <= (b); i++)
using namespace std;
using namespace __gnu_cxx;

int n, q;

int main()
{
	int T; scanf("%d", &T);
	while(T--)
	{
		scanf("%d%d", &n, &q);
		rope<int> a;
		a.push_back(0);

		_for(i, 1, n)
		{
			int x; scanf("%d", &x);
			a.push_back(x);
		}

		int ans = 0;
		while(q--)
		{
		//	for(int x: a) printf("%d ", x); puts("");

			int op; scanf("%d", &op);
			if(op == 1)
			{
				int l, r;
				scanf("%d%d", &l, &r);
				a = a.substr(a.begin(), a.end() - 1) +
					a.substr(a.begin() + l, a.begin() + r + 1) + 
					a.substr(a.end() - 1, a.end());
			}
			else
			{
				int x; scanf("%d", &x);
				ans ^= a[x];
			}
		}
		printf("%d\n", ans);
	}

	return 0;
}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 142ms
memory: 42424kb

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:

0
788824404

result:

wrong answer 1st lines differ - expected: '28631531', found: '0'