0
這是一個威佐夫博弈的裸題,我們就判斷下奇異局勢就好了,如果a = floor( ( b - a )*(1 + √5 ) / 2),那麼是奇異局勢
#include <iostream> #include <cmath> using namespace std; double mm=(double)sqrt(5.0); int main() { int T,n,m; // cout<<mm<<endl; while(cin>>n>>m) { if(n>m) swap(n,m); int tmp=(double)(m-n)*(1+mm)/2;\\這是有一個取證的問題
if(n==tmp) cout<<"0"<<endl; else cout<<"1"<<endl; } return 0; }