poj 2348 Euclid's Game (博弈局面分析)
来源:互联网 发布:直播软件收入排行榜 编辑:程序博客网 时间:2024/05/22 23:15
核心就是局面的分析。
- 必败态,必胜态的寻找分析
- 相互转换。
- 递推实现。
#include <iostream>class solve{private: int a, b; bool ans;public: bool dfs(int a, int b) { if (a > b) std::swap(a, b); if (a == 0) return false; if (b % a == 0) return true; if (b - a < a) return !dfs(b - a, a); return true; } void run() { while (true) { std::cin >> a >> b; if (!a && !b) return; std::cout << (dfs(a, b) ? "Stan wins" : "Ollie wins") << std::endl; } }}ac;int main(){ ac.run(); return 0;}
0 0
- poj 2348 Euclid's Game (博弈局面分析)
- POj-2348-Euclid's Game-博弈
- POJ 2348 Euclid's Game(博弈)
- POJ 2348 Euclid's Game【博弈】
- POJ 2348 Euclid's Game (博弈)
- 【POJ 2348】Euclid's Game 【简单博弈】
- 【POJ 2348 Euclid's Game】 + 博弈
- 【POJ 2348 Euclid's Game】+ 博弈
- POJ 2348 Euclid's Game <博弈>
- POJ 2348 Euclid's Game(博弈)
- POJ 2348 Euclid's Game (博弈找规律 )
- POJ 2348 Euclid's Game( 总结规律+组合博弈 )
- Euclid's Game---博弈
- hdu 1525 || poj 2348 Euclid's Game(博弈找规律)
- HDU 1525&&POJ 2348 Euclid's Game 规律博弈(难)
- POJ 2348/HDU 1525-Euclid's Game辗转相除法(博弈)
- poj 2348 Euclid's Game
- POJ-2348-Euclid's Game
- POJ2932:Coneolog
- Elasticsearch入门CRUD(新增、查询、修改、删除)
- [汇编]8086指令系统---算术指令(二)
- codeforces 689D (二分 RMQ)
- aspect term extraction——最近两篇结合依存树和CRF的文章
- poj 2348 Euclid's Game (博弈局面分析)
- 第二天-HTML5之CSS3特效
- Ajax_数据格式_HTML(01)
- sublime text3 中无法输入中文的问题
- memcache 介绍及原理
- Notification的使用
- 【计算机视觉】计算机视觉领域资料收集
- [汇编]8086指令系统---算术指令(一)
- 【慢速学数据结构】树的遍历