Learned the ladder game that I have not seen before:
Ladder game is n steps, there are a number of stones on the steps, each time you can choose any pile down a layer to move any (stone to 1 layers below can not move), can not operate the people lose.
This can be converted to a Nim game, that is, the odd number of step stones of the different or and. Proving similar, a 0 state can only go to a non-0 state, and not a 0 state must have a method transfer to the 0 state.
You can do this by knowing this. Considering the difference of adjacent stones, when taking a heap of rock, the decrease of the difference between I and i-1 equals the increase of the difference between i+1 and I, and the difference is always guaranteed to be nonnegative.
This is converted into a ladder game model.
#include <cstdio>
#include <algorithm>
using namespace std;
const int maxn=2005;
int _TEST,N,A[MAXN];
int main () {
freopen ("bzoj1115.in", "R", stdin);
Freopen ("Bzoj1115.out", "w", stdout);
scanf ("%d", &_test);
while (_test--) {
scanf ("%d", &n);
for (int i=1;i<=n;i++) scanf ("%d", &a[i]);
int ans=0;
for (int i=n;i>=1;i-=2) ans^= (a[i]-a[i-1]);
if (ans) printf ("tak\n"); else printf ("nie\n");
}