题解 | 小红和小紫的取素因子游戏#牛客春招刷题训练营#

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

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

#include <bits/stdc++.h>
using namespace std;
#define int long long
const int N = 2e5 + 5;
int __t = 1, n;
void solve() {
    cin >> n;
    int sum = 0;
    for (int i = 2; i * i <= n; i++) {
        while (n % i == 0) {
            sum++;
            n /= i;
        }
    }
    if (n > 1)
        sum++;
    cout << (sum % 2 ? "kou\n" : "yukari\n");
    return;
}
int32_t main() {
#ifdef ONLINE_JUDGE
    ios::sync_with_stdio(false);
    cin.tie(0);
#endif
    cin >> __t;
    while (__t--)
        solve();
    return 0;
}


全部评论

相关推荐

双尔:反手回一个很抱歉,经过慎重考虑,您与我的预期暂不匹配,感谢您的投递
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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