QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#361957#8508. DiviDueloucup-team2443#WA 8ms69364kbC++201.2kb2024-03-23 13:43:312024-03-23 13:43:31

Judging History

你现在查看的是最新测评结果

  • [2024-03-23 13:43:31]
  • 评测
  • 测评结果:WA
  • 用时:8ms
  • 内存:69364kb
  • [2024-03-23 13:43:31]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=1919810;
ll n,m,k;
int a[N],b[N];
int cnt[N];

ll ans;
string s[N];

int dp[N][3];//选了前i个 现在有j个连续辅音

map<char,int> mp;

stack<int> st1,st2;

int tf[N];
vector<int> v;

int gao(string s){
    int sum=0;
    for(int i=0;i<s.size();i++){
        int t=s[i]-'0';
        sum=sum*10+t;
    }
    return sum;
}

bool isprime(ll x){
    if(x==2) return true;
    for(ll i=2;i<=x/i;i++){
        if(x%i==0) return false;
    }
    return true;
}

void __(){
    cin>>n;
    ll t=sqrt(n);
    if(t*t==n){
        puts("N");
        return;
    }
    int cnt=0;
    vector<int> v;
    for(ll i=1;i<=n/i;i++){
        if(n%i==0){
            v.push_back(i);
            cnt++;
            if(i!=n/i){
                v.push_back(n/i);
                cnt++;
            }
        }
    }
    sort(v.begin(),v.end());
    ll gg=v.back();
    for(int i=v.size()-3;i>=0;i-=2){
        gg=gcd(gg,v[i]);
    }
    if(gg!=1) puts("Y");
    else puts("N");
}

int main()
{
    
    
    int _=1;
    // cin>>_;
    while(_--){
        __();
    }
}
//NYYYNNNNNYN

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 6ms
memory: 69364kb

input:

10

output:

Y

result:

ok "Y"

Test #2:

score: 0
Accepted
time: 8ms
memory: 67048kb

input:

9

output:

N

result:

ok "N"

Test #3:

score: 0
Accepted
time: 8ms
memory: 67092kb

input:

1

output:

N

result:

ok "N"

Test #4:

score: -100
Wrong Answer
time: 8ms
memory: 69168kb

input:

549755813888

output:

N

result:

wrong answer 1st words differ - expected: 'Y', found: 'N'