北大ACM1067——取石子游戏
2015-09-17 16:38
295 查看
杭电1527的代码通不过。
AC的代码:
AC的代码:
#include <iostream> #include <cmath> #include <algorithm> using namespace std; int main() { int a, b; double k = (sqrt(5.0) + 1.0) / 2.0; while(cin >> a >> b) { if(a > b) swap(a, b); int j = b - a; int i = floor(j * k); if(i == a) cout << 0 << endl; else cout << 1 << endl; } return 0; }
相关文章推荐
- 【译】StackOverflow——Java 中的 finally 代码块是否总会被执行?
- 新域名和老域名对网站SEO的影响
- Java多线程中start()和run()的区别
- 备份脚本二
- js之计时器
- TPS和QPS
- python2.7使用ansible
- python2.7使用ansible
- python2.7使用ansible
- 开源C/C++网络库比较 http://blog.csdn.net/langeldep/article/details/6976120
- JS获取客户端IP地址并显示地址方法汇总
- MySQL Join算法与调优白皮书(一)
- hdu 1596 find the safest road (dijkstra)
- boost::function 和boost::bind
- python2.7使用ansible
- 既使用maven编译,又使用lib下的Jar包
- 时间字符串
- mysql远程连接 Host * is not allowed to connect to this MySQL server
- 使用myeclipse web browser 中文显示乱码
- Android手表商场项目总结