Godsend CodeForces
来源:互联网 发布:360软件卸载大师 编辑:程序博客网 时间:2024/06/07 23:45
简单博弈
只要有奇数存在,就是第一个赢
奇数个奇数的话:第一个人全取完就赢了
偶数个偶数的话:第一个人只要留下一个奇数取完其他的就赢了
#include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>#include <cmath>#include <set>#include <map>#include <stack>#include <queue>#include <ctype.h>#include <vector>#include <algorithm>#define in freopen("in.txt", "r", stdin)#define out freopen("out.txt", "w", stdout)// cout << " === " << endl;using namespace std;typedef long long ll;const int maxn = 1000000 + 7, INF = 0x7f7f7f7f, mod = 1e9+7;int T, n, k, v;int main() { int cnt = 0; scanf("%d", &n); for(int i = 0; i < n; ++i) { scanf("%d", &v); if(v % 2 == 1) cnt++; } if(cnt) puts("First"); else puts("Second"); return 0;}
阅读全文
1 0
- Godsend CodeForces
- Godsend CodeForces
- codeforces 841B Godsend
- Codeforces 841 B Godsend
- Codeforces 841B Godsend
- Codeforces-429-2-B Godsend
- Codeforces Round #429 (Div. 2):B. Godsend
- Codeforces Round #429 (Div. 2) | B. Godsend
- Codeforces Round #429 (Div. 2) 841B Godsend(思维)
- Codeforces Round #429(Div.2) B Godsend 博弈
- codeforces Div.2 #429 B.Godsend C. Leha and Function
- B. Godsend
- cf841A Godsend
- B. Godsend
- Codeforces841B Godsend
- 429B. Godsend
- CF Godsend(水)
- codefroces 841B Godsend
- 干货分享:oracle数据库基础知识精讲视频!
- 洛谷:P1046 陶陶摘苹果 题解
- MD5加密算法流程
- 街区最短路径问题
- 结构、联合、位字段
- Godsend CodeForces
- oracle学习笔记
- 安卓自动化之uiautomator(Python篇)三 Uiobject
- 悬浮上去有效果的照片墙
- java:String、StringBuffer与StringBuilder
- IOS开发
- 用python中的list实现用户管理系统(面向对象 CRUD)
- 调和级数(harmony)
- 读书笔记《Inside the C++ Object Model》:关于对象