HDOJ1527(Wythoff Game)

来源:互联网 发布:软件测试吉安 编辑:程序博客网 时间:2024/04/30 20:39

标准的Wythoff Gme

/*HDOJ1572作者:陈佳润2013-04-02*/#include<iostream>using namespace std;#include<math.h>int Wythoff(int a,int b){     int t;     if(a>b)     {          t=a;a=b;b=t;     }     double temp=(1+sqrt(5.0))/2;     if(a==int((b-a)*temp))          return 0;     else          return 1;}int main(){int a,b;while(scanf("%d%d",&a,&b)!=EOF){printf("%d\n",Wythoff(a,b));}return 0;}


原创粉丝点击