HDU 2177 —— 取(2堆)石子游戏

原题:http://acm.hdu.edu.cn/showproblem.php?pid=2177


#include
#include
using namespace std;
int a, b;
int main(){
    while(cin>>a>>b){
        if(a == 0 && b == 0)    break;
        double tmp = (sqrt(5)+1)/2.0;
        if(a > b)   swap(a, b);
        int k = b-a;
        int minn = k*tmp;
        if(minn == a){
            cout<<"0"<


你可能感兴趣的:(博弈)