結果

問題 No.36 素数が嫌い!
ユーザー hitoyozakehitoyozake
提出日時 2018-11-24 13:11:38
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 809 bytes
コンパイル時間 538 ms
コンパイル使用メモリ 65,712 KB
実行使用メモリ 5,272 KB
最終ジャッジ日時 2023-08-26 04:51:53
合計ジャッジ時間 2,889 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

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));
    int counter = 0;
    for( i64 i = 2; i <= goal; ++i){
        if(n%i==0)
        {
            ++counter;
            if(counter>=3)
            {
                flag = true;
                break;
            }
            std::cout << "i: " << i << std::endl;
            n /= i;
            //i = 2;
            //std::cout << n << std::endl;
        }
    }

    if(n!=1)
        ++counter;

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

    return 0;
}
0