数学专项game_theory:UVa 12293
来源:互联网 发布:网络本科是什么意思 编辑:程序博客网 时间:2024/05/22 03:27
无脑的打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 12293
- 数学专项game_theory:UVa 11892
- 数学专项game_theory:UVa 11927
- 数学专项counting:UVa 11038
- 数学专项counting:UVa 10883
- 数学专项counting:UVa 10079
- 数学专项counting:UVa 10081
- 数学专项number_theory:UVa 10515
- 数学专项number_theory:UVa 10622
- 数学专项number_theory:UVa 10127
- 数学专项number_theory:UVa 10090
- 数学专项number_theory:UVa 10539
- 数学专项number_theory:UVa 11105
- 数学专项number_theory:UVa 11490
- 数学专项number_theory:UVa 11728
- 数学专项counting:UVa 580
- 数学专项counting:UVa 417
- 数学专项number_theory:UVa 10692
- 快速计算整数的二进制表示法中1的个数(编程珠玑9章课后习题7)
- LeetCode —— Longest Consecutive Sequence
- jdk 环境变量配置(需要手动配置,按照jdk之后不自动配置!)
- Android 左右侧滑组件
- Java网络编程
- 数学专项game_theory:UVa 12293
- mysql 性能监控 实用工具
- UML之类间关系
- 在宿舍带着老想玩游戏 怎么破
- 实验四:交换机VLAN划分实验
- SAP HANA 集合操作 UNION/Union all/INTERSECT/EXCEPT (SAP HANA Set Operations)
- 究竟什么决定你有多牛X
- 2020年互联网如何赚钱:设备碎片化并不怕
- Binary Tree Level Order Traversal