标签:
题目:
Description
Input
Output
Sample Input
2 1 8 4 4 7
Sample Output
0 1 0
分析:
威佐夫博弈
思路:
对于一个状态(a,b)
1 #include<cstdio> 2 #include<cmath> 3 int main() 4 { 5 int a,b,k; 6 double eqs=(1+sqrt(5.0))/2.0; 7 while(scanf("%d%d",&a,&b)!=EOF) 8 { 9 int t; 10 if(a>b) 11 { 12 t=a; 13 a=b; 14 b=t; 15 } 16 k=b-a; 17 if(int(k*eqs)==a) 18 printf("0\n"); 19 else 20 printf("1\n"); 21 } 22 return 0; 23 }
标签:
原文地址:http://www.cnblogs.com/forwin/p/4890425.html