题意:Wythoff Game
思路:Wythoff Game
#include<iostream> #include<stdio.h> #include<math.h> using namespace std; int main(){ int a,b,t; double gr=(sqrt(5)+1)/2;//黄金比例 golden ratio double a2; while(~scanf("%d%d",&a,&b)){ if(a>b){ t=a; a=b; b=t; } a2=(b-a)*gr; if(a!=int(a2))printf("1\n"); else printf("0\n"); } return 0; }
时间: 2024-10-10 09:18:25