logo AlgoBeat OnlineJudge
登录 注册

Official Editorial

作者: 035966_L3  ·  发布于 2026-06-14 22:29:59  ·  最后修改于 2026-06-15 21:46:09
已通过
审核员:AlgoBeat 官方账号 · 2026-06-15 21:46:09

https://scg3.piaoztsdy.cn/p/232

写出程序计算所有 种状态是必胜态还是必败态。列出表格,观察图形性质,可得:

答案
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;
}

暂无评论

登录 后即可评论。