結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 207 ms
42,412 KB
testcase_01 AC 194 ms
42,352 KB
testcase_02 AC 214 ms
42,424 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 219 ms
42,472 KB
testcase_06 WA -
testcase_07 AC 228 ms
42,444 KB
testcase_08 AC 193 ms
42,572 KB
testcase_09 AC 188 ms
42,368 KB
testcase_10 AC 194 ms
42,352 KB
testcase_11 AC 225 ms
42,452 KB
testcase_12 AC 231 ms
42,476 KB
testcase_13 WA -
testcase_14 AC 193 ms
42,436 KB
testcase_15 AC 194 ms
42,436 KB
testcase_16 AC 215 ms
42,404 KB
testcase_17 AC 231 ms
42,392 KB
testcase_18 AC 189 ms
42,360 KB
testcase_19 AC 188 ms
42,476 KB
testcase_20 AC 191 ms
42,588 KB
testcase_21 AC 211 ms
42,404 KB
testcase_22 AC 206 ms
42,468 KB
testcase_23 AC 183 ms
42,360 KB
testcase_24 AC 190 ms
42,460 KB
testcase_25 AC 190 ms
42,364 KB
testcase_26 AC 207 ms
42,436 KB
testcase_27 AC 225 ms
42,364 KB
testcase_28 AC 219 ms
42,456 KB
testcase_29 AC 220 ms
42,404 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 >= 2 ) { ans = true; break; }
    }
    
    cout << ( ans ? "YES" : "NO" ) << endl;
    
    
    return 0;
}
0