题解 | 小红和小紫的取素因子游戏

小红和小紫的取素因子游戏

https://www.nowcoder.com/practice/6146f391a69547c4804fe8d0330f1745

#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
using ld = long double;
using PII=pair<ll,ll>;
using PIII=pair<int,pair<int,int>>;
const ld ESP = 1e-10;
const ld PI = acosl(-1);
const int N=1e5+10;
const int M=2e5+10;
// const int mod = 1000000007;
const int mod = 998244353;
//随机化
random_device rd;
mt19937 gen(rd());
uniform_int_distribution<> dis(1, 1000000000);
// cout<<fixed<<setprecision(10);

void solve(){
    int x;
    cin>>x;
    int cnt=0;
    for(int i=2;i*i<=x;i++){
        while(x%i==0){
            cnt++;
            x/=i;
        }
    }if(x!=1)cnt++;
    if(cnt&1)cout<<"kou"<<'\n';
    else{
        cout<<"yukari"<<'\n';
    }
    
    
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int _=1;
    cin>>_;
    while(_--){
        solve();
    }
    return 0;
}

全部评论

相关推荐

牛客77743221...:做一段时间,公司出钱送你去缅甸和泰国旅游
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务