水题,nim博弈
#include<iostream> #include<algorithm> #include<cstdio> using namespace std; int main() { int T;scanf("%d", &T); for (int tcase = 1;tcase <= T;++tcase) { int ans = 0;int N;scanf("%d", &N); for (int i = 1, a, b;i <= N;++i) { scanf("%d %d", &a, &b); ans ^= (b - a - 1); }ans > 0 ? printf("Case %d: Alice\n", tcase) : printf("Case %d: Bob\n", tcase); } }