题解 | #小红和小紫的取素因子游戏#
小红和小紫的取素因子游戏
https://www.nowcoder.com/practice/6146f391a69547c4804fe8d0330f1745
#include <iostream> using namespace std; const int N = 1e5+10; int decompose(int x){ int count = 0; int cnt = x; for(int i = 2 ;i*i<=x;i++) while(x%i == 0) count++,x/=i; if(x>1) count++; return count; } int main() { int t; cin>>t; while(t--){ int x; cin>>x; int ans = decompose(x); if(ans % 2 == 0){ cout<<"yukari"<<endl; }else{ cout<<"kou"<<endl; } } return 0; } // 64 位输出请用 printf("%lld") // 跟博弈论没有半毛钱关系
判断质因子是奇数个还是偶数个