結果

問題 No.36 素数が嫌い!
ユーザー hitoyozakehitoyozake
提出日時 2018-11-24 12:56:10
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 648 bytes
コンパイル時間 586 ms
コンパイル使用メモリ 66,512 KB
実行使用メモリ 4,388 KB
最終ジャッジ日時 2023-08-26 04:51:27
合計ジャッジ時間 2,295 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 3 ms
4,380 KB
testcase_02 AC 1 ms
4,384 KB
testcase_03 WA -
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 33 ms
4,380 KB
testcase_12 AC 91 ms
4,376 KB
testcase_13 WA -
testcase_14 AC 2 ms
4,376 KB
testcase_15 AC 1 ms
4,380 KB
testcase_16 AC 1 ms
4,380 KB
testcase_17 AC 2 ms
4,380 KB
testcase_18 AC 1 ms
4,380 KB
testcase_19 AC 1 ms
4,380 KB
testcase_20 AC 5 ms
4,384 KB
testcase_21 AC 2 ms
4,384 KB
testcase_22 AC 2 ms
4,380 KB
testcase_23 AC 1 ms
4,380 KB
testcase_24 AC 15 ms
4,380 KB
testcase_25 AC 1 ms
4,376 KB
testcase_26 AC 59 ms
4,380 KB
testcase_27 AC 82 ms
4,380 KB
testcase_28 AC 57 ms
4,376 KB
testcase_29 AC 93 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <map>
#include <cmath>
using i64 = long long;

int main()
{

    i64 n = 0;
    std::cin >> n;
    bool flag = false;
    const i64 max = 100000000000000;

    const i64 goal = i64(std::sqrt(n) + 1);
    int counter = 0;
    for( i64 i = 2; i <= goal; ++i){
        if(n%i==0)
        {
            ++counter;
            if(counter>=2)
            {
                flag = true;
                break;
            }
            n /= i;
            i = 2;
        }
    }


    if(flag==false)
        std::cout << "NO" << std::endl;
    else
        std::cout << "YES" << std::endl;

    return 0;
}
0