結果

問題 No.36 素数が嫌い!
ユーザー hitoyozakehitoyozake
提出日時 2018-11-24 12:48:06
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 601 bytes
コンパイル時間 999 ms
コンパイル使用メモリ 86,112 KB
実行使用メモリ 4,388 KB
最終ジャッジ日時 2023-08-26 04:50:58
合計ジャッジ時間 2,548 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 59 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,380 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 2 ms
4,380 KB
testcase_11 AC 34 ms
4,380 KB
testcase_12 AC 97 ms
4,376 KB
testcase_13 AC 97 ms
4,376 KB
testcase_14 WA -
testcase_15 AC 2 ms
4,380 KB
testcase_16 AC 1 ms
4,376 KB
testcase_17 AC 2 ms
4,380 KB
testcase_18 AC 1 ms
4,384 KB
testcase_19 AC 1 ms
4,380 KB
testcase_20 AC 11 ms
4,376 KB
testcase_21 AC 2 ms
4,380 KB
testcase_22 AC 1 ms
4,376 KB
testcase_23 AC 1 ms
4,380 KB
testcase_24 AC 19 ms
4,380 KB
testcase_25 WA -
testcase_26 AC 60 ms
4,380 KB
testcase_27 AC 84 ms
4,376 KB
testcase_28 AC 60 ms
4,376 KB
testcase_29 AC 101 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 auto goal = std::sqrt(n);
    int counter = 0;
    for( int i = 2; i <= goal; ++i){
        if(n%i==0)
        {
            ++counter;
            if(counter>=3)
            {
                flag = true;
                break;
            }
        }
    }


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

    return 0;
}
0