标签:lin namespace name https class str space include com
威佐夫博弈结论:若石子数为\(a,b(a<b)\),当且仅当\((y-x)*\frac{(\sqrt{5}+1)}{2}=x\)的时候先手必败
证明
//minamoto
#include<iostream>
#include<cmath>
using namespace std;
const double phi=(sqrt(5)+1)/2;
int main(){
int a,b;
while(cin>>a>>b){
if(a>b)swap(a,b);
int A=(b-a)*phi;
cout<<(A==a?0:1)<<endl;
}return 0;
}
标签:lin namespace name https class str space include com
原文地址:https://www.cnblogs.com/bztMinamoto/p/10055438.html