题面

HDU1527 取石子游戏

洛谷2252 取石子游戏

题解

裸的威佐夫博弈

#include<iostream>
#include<cmath>
using namespace std;
const double phi=(sqrt(5)+1)/2;
int a,b;
int main()
{
ios::sync_with_stdio(false);
while(cin>>a>>b)
{
if(a>b)swap(a,b);
int A=abs(a-b)*phi;
if(A==a)cout<<0<<endl;
else cout<<1<<endl;
}
return 0;
}

最新文章

  1. 启动App的Intent
  2. oracle xmltype导入并解析Excel数据 (五)中间表数据入库
  3. js html 一些技巧
  4. Creating Apps With Material Design —— Creating Lists and Cards
  5. 【Visual Studio2010】创建XAML分析插件
  6. 欧拉计划之Largest palindrome product
  7. commons-beanutils使用
  8. jQuery基础---Ajax基础教程(二)
  9. centos7图形配置 firewall-config
  10. Ubuntu16.04下搭建LAMP环境
  11. MySQL存储过程中实现执行动态SQL语句
  12. [小明打联盟][斜率/单调队列 优化dp][背包]
  13. HTTP之请求消息Request
  14. Educational Codeforces Round 58 (Rated for Div. 2) D 树形dp + 数学
  15. Robot framework--内置库xml学习(一)
  16. Codeforces Beta Round #42 (Div. 2)
  17. 利用VS2017跨平台远程调试aspnetcore应用
  18. spring--boot @Valid的使用
  19. Beta 冲刺 (3/7)
  20. MT【132】倒序相加因式分解

热门文章

  1. iOS上手指点击波纹效果的实现
  2. 爬虫——scrapy框架
  3. 【Python3练习题 019】 有一分数序列:2/1,3/2,5/3,8/5,13/8,21/13...求出这个数列的前20项之和。
  4. myecplise ssh项目配置上遇到的问题
  5. 便捷的ajax请求
  6. ios不触发事件也能播放音频
  7. Java Integer 与 int 深刻理解
  8. [转帖]前端-chromeF12 谷歌开发者工具详解 Console篇
  9. Linux 下面 Sqlserver 2017 的简单安装
  10. Day 4-2 time &amp; datetime模块