∵都是最优操作

∴n*n=偶数时Bob赢,否则Alice赢

n*n的奇偶性等价于n的奇偶性。

 1 #include<cstdio>
 2 using namespace std;
 3 int n;
 4 int main()
 5 {
 6     while(1)
 7       {
 8           scanf("%d",&n);
 9           if(!n) break;
10           puts((n&1) ? "Bob" : "Alice");
11       }
12     return 0;
13 }

 

相关文章:

  • 2021-06-18
  • 2022-12-23
  • 2022-02-01
  • 2021-06-18
  • 2021-09-01
  • 2021-10-06
  • 2022-01-19
  • 2021-10-29
猜你喜欢
  • 2022-02-20
  • 2021-10-12
  • 2022-01-29
  • 2022-03-10
  • 2022-02-06
  • 2021-05-30
相关资源
相似解决方案