QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#362078#8508. DiviDueloucup-team2443#TL 6ms69140kbC++201.5kb2024-03-23 14:03:552024-03-23 14:03:56

Judging History

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

  • [2024-03-23 14:03:56]
  • 评测
  • 测评结果:TL
  • 用时:6ms
  • 内存:69140kb
  • [2024-03-23 14:03:55]
  • 提交

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<ll> v;



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());
    if(v.size()==2){
        puts("Y");
        return;
    }
    if(v.size()%2){
        puts("N");
        return;
    }
    // if(v.size()<3){
    //     while(1){
            
    //     }
    // }
    ll cnt1=0,cnt2=0;
    for(int i=1;i<v.size();i++){
        if(v[i]%v[1]==0) cnt1++;
        if(v[i]%v[2]==0) cnt2++;
        if(v[1]<=0){
            while(1){
                
            }
        }
        if(v[2]<=0){
            while(1){
                
            }
        }
    }
    if(cnt1==v.size()-1){
        puts("Y");
        return;
    }
    if(cnt1==v.size()-2&&cnt2==v.size()-2){
        puts("Y");
        return;
    }
    puts("N");
}

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

詳細信息

Test #1:

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

input:

10

output:

Y

result:

ok "Y"

Test #2:

score: 0
Accepted
time: 4ms
memory: 67060kb

input:

9

output:

N

result:

ok "N"

Test #3:

score: 0
Accepted
time: 3ms
memory: 67128kb

input:

1

output:

N

result:

ok "N"

Test #4:

score: -100
Time Limit Exceeded

input:

549755813888

output:


result: