Codeforces 347C - Alice and Bob
来源:互联网 发布:ip与mac绑定有什么用 编辑:程序博客网 时间:2024/05/16 07:12
每一回合挑选集合中的两个数
游戏结束的时候最小的数就是这
游戏结束的时候的集合的大小就是结束时
这样就可以得出游戏进行的步数,然后就可以得到结果了
#include<bits/stdc++.h>using namespace std;const int maxn = 120;int arr[maxn];int main(){ int n; cin>>n; for(int i = 0;i<n;i++) cin>>arr[i]; int v = arr[0]; for(int i = 1;i<n;i++) v = __gcd(v,arr[i]); int siz = *max_element(arr,arr+n) / v - n; cout<<((siz&1)?"Alice":"Bob")<<endl; return 0;}
0 0
- CodeForces 347 C. Alice and Bob
- Codeforces 347C Alice and Bob
- CodeForces 347 C. Alice and Bob
- codeforces#347div2 C. Alice and Bob
- Codeforces 347C - Alice and Bob
- CodeForces 347C Alice and Bob
- CodeForces 347C Alice and Bob(博弈)
- codeforces 347 c Alice and Bob(博弈 && 数学)
- codeforces 6C - Alice, Bob and Chocolate
- Codeforces 6C. Alice, Bob and Chocolate
- CodeForces 6C - Alice, Bob and Chocolate
- CodeForces 6C Alice, Bob and Chocolate
- CodeForces 6C Alice, Bob and Chocolate
- Alice and Bob (CodeForces
- Alice and Bob CodeForces
- 【博弈】Alice and Bob CodeForces
- Alice, Bob and Chocolate CodeForces
- Codeforces Round #201 (Div. 2) C. Alice and Bob
- 【MDCC 2016】物联网开发专场:物联网落地实践探索
- angularJs使用$q服务进行同步请求数据,解决异步获取数据导致return返回为空的问题
- 木讷的程序员需要知道的事情(一)
- 百度地图的定位
- (iOS开发)AutoLayOut中等比例设置视图
- Codeforces 347C - Alice and Bob
- Android 的事件分发机制
- GridView获取后台数据实现多行多列选择,获取TextView文本内容
- Bootstrap 学习之(四) ------ 表单
- FLEX COMBOBOX 传值问题
- 【2016 泉市教科】plusplus - Pascal
- ARM WFI和WFE指令
- spring-07-Controller如何使用Session
- IP地址分类