完啦,WA啦!!!
查看原帖
完啦,WA啦!!!
1360231
朱梓涵2012楼主2024/11/30 23:04
#include<iostream>
#include<string.h>
#include <vector>
using namespace std;
long long n, q, l, r,ans = 1; 
int a[1000001],b[1000001];
int main() {
	memset(b,1,sizeof(b));
	cin >> n >> q;
	for (int i = 1; i <= n; i++) {
		cin >> a[i];
		b[i] = b[i-1] * a[i];
	}
	for (int i = 1; i <= q; i++) {
		cin >> l >> r;
		ans=(b[r] - b[l-1]) ^ ans;
	}
	cout << ans;
	return 0;
}
2024/11/30 23:04
加载中...