poj1067 取石子

来源:互联网 发布:unix网络编程卷2 pdf 编辑:程序博客网 时间:2024/05/23 20:37

//很古老的题,应该早就K掉的。博弈,边写边积累吧,没公式还真解不出来

#include<iostream>#include<cmath>using namespace std;int main(){  int a,b; while(cin>>a>>b){  if(a>b) swap(a,b);  intbei=b-a,t=(floor)(bei*(1+sqrt(5.0))/2.0);  if(a==t)cout<<"0"<<endl;  elsecout<<"1"<<endl; } return 0;}


 

0 0