結果

問題 No.36 素数が嫌い!
ユーザー tokizo
提出日時 2019-05-07 01:32:11
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 434 bytes
コンパイル時間 1,549 ms
コンパイル使用メモリ 165,704 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-28 16:49:05
合計ジャッジ時間 2,457 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 15 WA * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);

    int n, cnt = 0;
    cin >> n;

    int h = n;
    for(int i = 2; i <= sqrt(n); i++){
        while(h % i == 0){
            h /= i;
            cnt++;
            if(cnt >= 2){
                cout << "YES" << endl;
                return 0;
            }
        }
    }

    cout << "NO" << endl;

    return 0;
}
0