首页 > 其他 > 详细

hdu 1527

时间:2015-06-19 10:39:09      阅读:224      评论:0      收藏:0      [点我收藏+]

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1527
hint:威佐夫博弈
基本类似于模板

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
using namespace std;
const double k=(sqrt(5.0)-1.0)/2.0;//常数

int main()
{
    int a,b;
    while(cin>>a>>b)
    {
        if(a>b)
            swap(a,b);
        int m=a*k;
        if(a!=(int)(m*(1+k)));
        m++;
        if(a + m == b)
            puts("0");
        else
            puts("1");
    }
    return 0;
}

hdu 1527

原文:http://blog.csdn.net/qingshui23/article/details/46553369

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!