#include <iostream> #include <stdio.h> #include <string.h> #include <algorithm> #include <set> using namespace std; int main() { int a,b; while(scanf("%d%d",&a,&b)&&(a+b)){ if(a<b) swap(a, b); int flag = 1; while(1){ if(a == b || a >= 2*b) break; else{ a = a - b; swap(a,b); flag = !flag; } } if(flag) printf("Stan wins\n"); else printf("Ollie wins\n"); } return 0; }
HDU(1525)Euclid's Game
最新推荐文章于 2021-04-15 23:11:54 发布