結果

問題 No.36 素数が嫌い!
ユーザー Naco
提出日時 2019-10-11 16:18:48
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 100 ms / 5,000 ms
コード長 362 bytes
コンパイル時間 1,732 ms
コンパイル使用メモリ 165,704 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-24 19:57:00
合計ジャッジ時間 2,866 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int isprime(long long a){
    int ans=0;
    for(long long i=2;i*i<=a;i++){
        while(a%i==0){
            a/=i;
            ans++;
        }
    }
    if(a!=1) ans++;
    return ans;
}

int main(){
    long long N; cin >> N;
    if(isprime(N)<3){
        cout << "NO" << endl;
    }else cout << "YES" << endl;
}
0