POJ - 1067 取石子游戏

https://vjudge.net/problem/POJ-1067

#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
int ttt;
int main()
{
    
    
	int a,b;
	while(cin>>a>>b)
	{
    
    
		if(a>b)
			swap(a,b);
		double x=(int)((b-a)*(sqrt(5)+1)/2);
		if(a==x)
			cout<<"0\n";
		else
			cout<<"1\n";
	}
	return 0;
}

猜你喜欢

转载自blog.csdn.net/weixin_52341477/article/details/120105060