- 232's solution
-
P232's Solution
- @ 2026-3-15 15:55:46
写出程序计算所有 种状态是必胜态还是必败态。列出表格,观察图形性质,可得:
| 答案 | ||
|---|---|---|
| Sleeping Alligator | ||
| Sleeping Iguana | ||
| Sleeping Alligator | ||
| Sleeping Iguana | ||
| Sleeping Alligator | ||
| Sleeping Iguana | ||
| Sleeping Alligator | ||
| Sleeping Iguana | ||
| Sleeping Alligator | ||
| Sleeping Iguana | ||
| Sleeping Alligator | ||
| Sleeping Iguana | ||
#include <bits/stdc++.h>
using namespace std;
const string names[2] =
{
"Sleeping Iguana",
"Sleeping Alligator"
};
const int results[3][6] =
{
{1, 0, 0, 1, 1, 1},
{0, 1, 0, 1, 0, 0},
{1, 0, 1, 0, 0, 0}
};
int main()
{
freopen("savings.in", "r", stdin);
freopen("savings.out", "w", stdout);
int T, n, m;
cin >> T;
while (cin >> n >> m) cout << names[results[n % 3][m % 6]] << endl;
return 0;
}