結果

問題 No.36 素数が嫌い!
ユーザー tetsuzuki1115tetsuzuki1115
提出日時 2018-01-08 00:33:48
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 971 bytes
コンパイル時間 917 ms
コンパイル使用メモリ 73,212 KB
実行使用メモリ 42,696 KB
最終ジャッジ日時 2023-08-24 23:47:04
合計ジャッジ時間 8,110 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 203 ms
42,348 KB
testcase_02 AC 199 ms
42,680 KB
testcase_03 AC 206 ms
42,356 KB
testcase_04 AC 206 ms
42,368 KB
testcase_05 AC 205 ms
42,432 KB
testcase_06 AC 216 ms
42,412 KB
testcase_07 AC 206 ms
42,348 KB
testcase_08 AC 180 ms
42,432 KB
testcase_09 AC 199 ms
42,680 KB
testcase_10 AC 200 ms
42,572 KB
testcase_11 AC 200 ms
42,352 KB
testcase_12 AC 213 ms
42,572 KB
testcase_13 AC 205 ms
42,352 KB
testcase_14 AC 181 ms
42,328 KB
testcase_15 AC 178 ms
42,472 KB
testcase_16 AC 203 ms
42,328 KB
testcase_17 AC 199 ms
42,476 KB
testcase_18 AC 184 ms
42,496 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 216 ms
42,572 KB
testcase_25 WA -
testcase_26 AC 233 ms
42,356 KB
testcase_27 AC 219 ms
42,500 KB
testcase_28 AC 208 ms
42,436 KB
testcase_29 AC 206 ms
42,528 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <math.h>
#include <cmath>
#include <limits.h>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <functional>
#include <stdio.h>
using namespace std;

long long MOD = 1000000007;


    int p[10000001] = {0};
    

int main() {
    
    long long N;
    cin >> N;
    
    for ( int i = 2; i <= 10000000; i++ ) {
        if ( !p[i] ) {
            long long j = i*2;
            while ( j <= 10000000 ) {
                p[j] = 1;
                j += i;
            }
        }
    }
    
    bool ans = false;
    int a = 0;
    for ( int i = 2; i <= 10000000; i++ ) {
        if ( !p[i] && (N%i) == 0 ) {
            long long n = N;
            while ( !(n%i) ) {
                n /= i;
                a++;
            }
        }
        if ( a >= 3 ) { ans = true; break; }
    }
    
    cout << ( ans ? "YES" : "NO" ) << endl;
    
    
    return 0;
}
0