【洛谷2252&HDU1527】取石子游戏(博弈论)
2024-10-12 10:55:07
题面
题解
裸的威佐夫博弈
#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;
}
最新文章
- 启动App的Intent
- oracle xmltype导入并解析Excel数据 (五)中间表数据入库
- js html 一些技巧
- Creating Apps With Material Design —— Creating Lists and Cards
- 【Visual Studio2010】创建XAML分析插件
- 欧拉计划之Largest palindrome product
- commons-beanutils使用
- jQuery基础---Ajax基础教程(二)
- centos7图形配置 firewall-config
- Ubuntu16.04下搭建LAMP环境
- MySQL存储过程中实现执行动态SQL语句
- [小明打联盟][斜率/单调队列 优化dp][背包]
- HTTP之请求消息Request
- Educational Codeforces Round 58 (Rated for Div. 2) D 树形dp + 数学
- Robot framework--内置库xml学习(一)
- Codeforces Beta Round #42 (Div. 2)
- 利用VS2017跨平台远程调试aspnetcore应用
- spring--boot @Valid的使用
- Beta 冲刺 (3/7)
- MT【132】倒序相加因式分解
热门文章
- iOS上手指点击波纹效果的实现
- 爬虫——scrapy框架
- 【Python3练习题 019】 有一分数序列:2/1,3/2,5/3,8/5,13/8,21/13...求出这个数列的前20项之和。
- myecplise ssh项目配置上遇到的问题
- 便捷的ajax请求
- ios不触发事件也能播放音频
- Java Integer 与 int 深刻理解
- [转帖]前端-chromeF12 谷歌开发者工具详解 Console篇
- Linux 下面 Sqlserver 2017 的简单安装
- Day 4-2 time &; datetime模块