好吧我能说这道题我是猜过去的么= =,看到只有一个数x,x=2时alice赢,就猜奇数bob赢,偶数alice赢,然后就稀里糊涂过了= =
后来找了http://www.haogongju.net/art/1875425才懂,把这个问题看成用2*1木板覆盖的问题= =真是蒟蒻
CODE:
#include<cstdio>
#include<iostream>
#include<cstring>
#include<algorithm>
using
namespace
std;
int
main(){
for
(;;){
int
x;
scanf
(
"%d"
,&x);
if
(x==0)
return
0;
if
(x&1)
printf
(
"Bob\n"
);
else
printf
(
"Alice\n"
);
}
}
|