QOJ.ac

QOJ

ID提交记录ID题目HackerOwner结果提交时间测评时间
#845#570208#9299. ABC Conjectureship2077rotcar07Success!2024-09-19 19:40:042024-09-19 19:40:04

詳細信息

Extra Test:

Wrong Answer
time: 0ms
memory: 3596kb

input:

1
1000810199515523

output:

no

result:

wrong answer expected YES, found NO [1st token]

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#570208#9299. ABC Conjecturerotcar07#WA 1ms3752kbC++20469b2024-09-17 14:40:422024-10-14 07:37:33

answer

#include<bits/stdc++.h>
using namespace std;

int main(){
    int t;cin>>t;
    while(t--){
        long long c;cin>>c;
        bool f=0;
        for(int i=2;i<=1e4+5;i++){
            if(c%i==0){
                if(c%(i*i)==0) f=1;
                else c/=i;
            }
        }
        if(!f&&c>1){
            int w=sqrtl(c);
            // cout<<c<<' '<<w<<'\n';
            if(w*1ll*w==c) f=1;
        }
        puts(f?"yes":"no");
    }
}