http://www.lydsy.com/JudgeOnline/problem.php?id=1115
差分后变成阶梯博弈。

#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;

const int N = 1003;

int a[N], n, s;

int main() {
	int T; scanf("%d", &T);
	while (T--) {
		scanf("%d", &n);
		for (int i = 1; i <= n; ++i) scanf("%d", a + i);
		s = 0;
		for (int i = n; i >= 1; i -= 2) s ^= a[i] - a[i - 1];
		puts(s ? "TAK" : "NIE");
	}
	return 0;
}

相关文章:

  • 2021-09-24
  • 2021-06-03
  • 2021-07-03
  • 2021-11-03
  • 2021-11-28
  • 2022-02-09
  • 2021-10-07
  • 2021-10-22
猜你喜欢
  • 2022-01-11
  • 2021-06-02
  • 2021-08-16
  • 2021-11-05
  • 2021-10-10
  • 2021-11-27
  • 2022-12-23
相关资源
相似解决方案