hdu 1527(威佐夫博奕)
题意:容易理解。
分析:威佐夫博奕的模板题。
代码实现:
#include<stdio.h> #include<string.h> #include<math.h> int main() { int n,m,temp,k; while(scanf("%d%d",&n,&m)!=EOF) { if(n<m) { temp=n; n=m; m=temp; } k=n-m; n=(int)(k*(1+sqrt(5))/2.0); if(n==m) printf("0\n"); else printf("1\n"); } return 0; }
posted on 2014-05-15 17:07 后端bug开发工程师 阅读(1838) 评论(0) 编辑 收藏 举报