SP18150 题解

本题是比较水的橙题,首先最初始的情况,如果 $n =1$ 很明显是 K 获胜。

当 $n=2$ 时,S 先拿因子 $1$ 还剩下 $1$,回到了第一种情况,因此 S 获胜。

当 $n=3$ 时,S 先拿因子 $1$ 还剩下 $2$ ,回到了第二种情况,因此 K 获胜。

以此类推,如果 $n$ 是奇数则 S 获胜,$n$ 是偶数则 K 获胜。

#include<bits/stdc++.h>
using namespace std;
int main(){
    int t;
    cin>>t;
    while(t--){
        int x;
        cin>>x;
        if(x%2==0) cout<<"Thankyou Shaktiman"<<endl;
        else cout<<"Sorry Shaktiman"<<endl;
    }
    return 0;
}
posted @ 2024-01-14 10:55  very_easy  阅读(6)  评论(0)    收藏  举报  来源