結果

問題 No.36 素数が嫌い!
ユーザー hitoyozakehitoyozake
提出日時 2018-11-24 12:53:31
言語 C++17(clang)
(17.0.6 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 610 bytes
コンパイル時間 5,893 ms
コンパイル使用メモリ 94,140 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-20 11:30:56
合計ジャッジ時間 5,717 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 3 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 WA -
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 35 ms
4,376 KB
testcase_12 AC 103 ms
4,376 KB
testcase_13 AC 104 ms
4,380 KB
testcase_14 WA -
testcase_15 AC 2 ms
4,380 KB
testcase_16 AC 1 ms
4,380 KB
testcase_17 AC 2 ms
4,376 KB
testcase_18 AC 2 ms
4,376 KB
testcase_19 AC 1 ms
4,376 KB
testcase_20 AC 5 ms
4,376 KB
testcase_21 AC 2 ms
4,376 KB
testcase_22 AC 2 ms
4,380 KB
testcase_23 AC 2 ms
4,380 KB
testcase_24 AC 16 ms
4,380 KB
testcase_25 AC 1 ms
4,376 KB
testcase_26 AC 64 ms
4,380 KB
testcase_27 AC 88 ms
4,376 KB
testcase_28 AC 61 ms
4,376 KB
testcase_29 AC 101 ms
4,376 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;
            }

        }
    }


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

    return 0;
}
0