51nod 1072 威佐夫游戏
2016-03-04 13:39
309 查看
简单的博弈论问题
#include <iostream> #include <cstdio> #include <cmath> using namespace std; int main() { int t; cin >> t; while (t--) { int a, b; cin >> a >> b; double t = (sqrt(5.0) + 1) / 2.0; if (a > b) { int tmp = b; b = a; a = tmp; } //std::cout <<int(1.618 * (b - a))<< std::endl; if (int(t* (b - a)) == a) printf("B\n"); else printf("A\n"); } return 0; }
相关文章推荐
- 【NOI 2014】起床困难综合征 拆位+贪心
- IE浏览器兼容问题
- CSS---在浏览器中双向居中
- 【SpringMVC】SpringMVC系列13之关于 mvc:annotation-driven
- iOS开发---计算两个日期的时间差
- 1.hibernate helloworld 常见exception
- div盒子模型(一图胜千言)
- c++ STL string类仿写
- Swift学习笔记————可选类型(Optional Type)
- 意念控制技术落地
- 正则化方法L1和L2
- java堆栈类解决括号匹配问题
- NSString 的常见方法
- java mysql 中文查询
- 校门外的树
- Hudson-ci/Using Hudson/Installing Hudson/Installing Hudson DEB
- 别人的故事
- java中==与equals()方法的区别与使用
- iOS-UICollectionViewController 介绍
- 【SpringMVC】SpringMVC系列12之数据类型转换、格式化、校验