Sakurako and Kosuke
题面翻译
题目描述
Sakurako 和 Kosuke 在数轴上用一个点玩游戏。这个点初始在数轴原点。二人轮流操作,Sakurako 先。
在第 i i i 次移动,玩家将这个点向某个方向移动 2 × i − 1 2 \times i - 1 2×i−1 个单位长度。Sakurako 向负方向移动点,而 Kosuke 向正方向。
设该点坐标为 x x x。
所以游戏开始后就会发生:
- Sakurako 将点沿负方向移动 1 1 1 个单位长度,此时 x = − 1 x = -1 x=−1;
- Kosuke 将点沿正方向移动 3 3 3 个单位长度,此时 x = 2 x = 2 x=2;
- Sakurako 将点沿负方向移动 5 5 5 个单位长度,此时 x = − 3 x = -3 x=−3;
- ⋅ ⋅ ⋅ \cdot \cdot \cdot ⋅⋅⋅
直到 ∣ x ∣ > n |x| > n ∣x∣>n 时,他们才会停下。可以证明游戏一定会结束的。
定义赢家是在游戏结束前最后一个移动点的人。
你的任务是找到赢家。
输入格式
第一行一个正整数 t t t( 1 ≤ t ≤ 100 1 \le t \le 100 1≤t≤100),表示 Sakurako 和 Kosuke 玩游戏的次数。
接下来的 t t t 行,每行一个正整数 n n n( 1 ≤ n ≤ 100 1 \le n \le 100 1≤n≤100),含义见上。
输出格式
总共 t t t 行,每行输出每次游戏的赢家。
题目描述
Sakurako and Kosuke decided to play some games with a dot on a coordinate line. The dot is currently located in position $ x=0 $ . They will be taking turns, and Sakurako will be the one to start.
On the $ i $ -th move, the current player will move the dot in some direction by $ 2\cdot i-1 $ units. Sakurako will always be moving the dot in the negative direction, whereas Kosuke will always move it in the positive direction.
In other words, the following will happen:
- Sakurako will change the position of the dot by $ -1 $ , $ x = -1 $ now
- Kosuke will change the position of the dot by $ 3 $ , $ x = 2 $ now
- Sakurako will change the position of the dot by $ -5 $ , $ x = -3 $ now
- $ \cdots $
They will keep on playing while the absolute value of the coordinate of the dot does not exceed $ n $ . More formally, the game continues while $ -n\le x\le n $ . It can be proven that the game will always end.
Your task is to determine who will be the one who makes the last turn.
输入格式
The first line contains one integer $ t $ ( $ 1\le t\le 100 $ ) — the number of games that Sakurako and Kosuke played.
Each game is described by one number $ n $ ( $ 1 \le n\le 100 $ ) — the number that defines the condition when the game ends.
输出格式
For each of the $ t $ games, output a line with the result of that game. If Sakurako makes the last turn, output “Sakurako” (without quotes); else output “Kosuke”.
样例 #1
样例输入 #1
4
1
6
3
98
样例输出 #1
Kosuke
Sakurako
Kosuke
Sakurako
code
#include<iostream>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<vector>
#include<map>
#include<cassert>
#define int long long
using namespace std;
const int N = 2e5+10,INF=0x3f3f3f3f,mod=1e9+7;
typedef pair<int,int> PII;
int T;
int a[N];
int b[N];
void solve(){
int n;
cin>>n;
if(n&1) cout<<"Kosuke"<<endl;
else cout<<"Sakurako"<<endl;
}
signed main(){
cin>>T;
while(T--){
solve();
}
return 0;
}
标签:will,le,Kosuke,Sakurako,100,dot
From: https://blog.csdn.net/2303_79062963/article/details/143250051