标签:read break include bre stdout c++ 博弈 lse 没有
#include<bits/stdc++.h>//Forever_chen
#define RT register
using namespace std;
template<class t> inline t read(t &x){
char c=getchar();bool f=0;x=0;
while(!isdigit(c)) f|=c==‘-‘,c=getchar();
while(isdigit(c))x=(x<<1)+(x<<3)+(c^48),c=getchar();
if(f)x=-x;return x;
}
template<class t>inline void write(t x){
if(x<0)putchar(‘-‘),write(-x);
else{if(x>9)write(x/10);putchar(‘0‘+x%10);}
}
template<class t>inline void writeln(t x){
write(x);putchar(‘\n‘);
return;
}
template<class t>inline void write_blank(t x){
write(x);putchar(‘ ‘);
return;
}
int c,n,m,pd;
int main(){
//freopen(".in","r",stdin);
//freopen(".out","w",stdout);
read(c);;
while(c--){
read(m);
read(n);
pd=0;
if(m<n){
swap(m,n);
}
if(n==m){
cout<<"Stan wins"<<endl;
continue;
}
while(m<n*2){
m-=n;
pd++;
if(m<n){
swap(m,n);
}
if(m>n*2){
break;
}
}
if(pd&1)cout<<"Ollie wins"<<endl;
else cout<<"Stan wins"<<endl;
}
//system("pause");
return 0;
}
标签:read break include bre stdout c++ 博弈 lse 没有
原文地址:https://www.cnblogs.com/Forever-chen/p/12838781.html