P4136 谁能赢呢? 题解
Bc2_Ch1ckenPr1nce · · 题解
P4136 谁能赢呢? 题解
题目分析
我们可以发现,两人显然都用的是最优的策略,尽量走过所有的格子。那么,我们可以推出当
则题目可以变为 Bob,Alice。
code
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define qwq ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
const int N = -1;
signed main()
{
qwq;
int n;
while (cin >> n)
{
if (n == 0)
break;
if (n & 1)
cout << "Bob" << endl;
else
cout << "Alice" << endl;
}
return 0;
}