数学专项game_theory:UVa 12293
2013-04-17 22:17
323 查看
无脑的打SG函数表找规律……不难发现当n为2^k-1时,SG函数为0,为先手必败,输出Bob;否则输出Alice。
#include <iostream> #include <cstdio> using namespace std; int n; int main() { freopen("in.txt","r",stdin); while(cin>>n) { if(!n) break; n++; int flag=1; while(n>1) { if(n%2==0) n/=2; else { flag=0; break; } } if(!flag) cout<<"Alice"<<endl; else cout<<"Bob"<<endl; } return 0; }
相关文章推荐
- 数学专项game_theory:UVa 11892
- 数学专项game_theory:UVa 11927
- 数学专项number_theory:UVa 10368
- 数学专项number_theory:UVa 10090
- 数学专项number_theory:UVa 756
- 数学专项number_theory:UVa 11768
- 数学专项number_theory:UVa 10236
- 数学专项number_theory:UVa 10622
- 数学专项number_theory:UVa 10692
- 数学专项number_theory:UVa 10127
- 数学专项number_theory:UVa 11728
- 数学专项number_theory:UVa 10951
- 数学专项number_theory:UVa 718
- 数学专项number_theory:UVa 10515
- 数学专项number_theory:UVa 10539
- 数学专项number_theory:UVa 11105
- 数学专项number_theory:UVa 294
- 数学专项number_theory:UVa 10162
- 数学专项number_theory:LA 2955
- 数学专项counting:UVa 11529