求调 wa 25
查看原帖
求调 wa 25
764344
zenght楼主2024/3/9 11:10
#include <cstdio>
using namespace std;

#define ull unsigned long long
const int NR = 1e6 + 10;
ull a[NR], s[NR];

int main()
{
	int n, top = 0;
	scanf("%d", &n);
	for (int i = 1; i <= n; i++) scanf("%llu", &a[i]);
	ull ans = 0;
	for (int i = 1; i <= n; i++)
	{
		while (top && a[s[top]] <= a[i]) ans ^= a[s[top--]];
		s[++top] = i; // 算自己
		ans ^= s[top];
		printf("%llu\n", ans);
	}
	return 0;
}

现在连 22 行代码都调不了了,有问题喊我

2024/3/9 11:10
加载中...