#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
using namespace std;

int main()
{
    //freopen("acm.acm","r",stdin);
    int a;
    int b;
    int k;
    while(cin>>a>>b)
    {
        if(a > b)
            iter_swap(&a,&b);
        k = a;
        if(k == (int)( (double)(b-a)*((double)sqrt((long double)5) + 1.0)/2.0) )
            cout<<0<<endl;
        else
            cout<<1<<endl;
    }
}
/*
这是一个威佐夫博弈问题,只要a,b构成一个奇异阵先取的就一定输,否则就会赢
奇异阵的特点:b-a=k;k*(sqrt(5)+1)/2=a;

*/

 

关注我的公众号,当然,如果你对Java, Scala, Python等技术经验,以及编程日记,感兴趣的话。 

POJ 1067

技术网站地址: vmfor.com

相关文章:

  • 2022-12-23
  • 2021-10-01
  • 2022-12-23
  • 2021-08-12
  • 2022-12-23
  • 2021-08-04
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-08-15
  • 2021-06-14
  • 2021-08-19
  • 2022-02-09
  • 2021-08-09
相关资源
相似解决方案