結果

問題 No.36 素数が嫌い!
ユーザー togari_takamototogari_takamoto
提出日時 2016-02-26 13:56:55
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 105 ms / 5,000 ms
コード長 752 bytes
コンパイル時間 2,352 ms
コンパイル使用メモリ 149,216 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-09 07:33:28
合計ジャッジ時間 3,810 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 49 ms
4,380 KB
testcase_01 AC 81 ms
4,380 KB
testcase_02 AC 1 ms
4,384 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 1 ms
4,384 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 2 ms
4,384 KB
testcase_10 AC 2 ms
4,384 KB
testcase_11 AC 35 ms
4,384 KB
testcase_12 AC 105 ms
4,384 KB
testcase_13 AC 104 ms
4,384 KB
testcase_14 AC 65 ms
4,380 KB
testcase_15 AC 2 ms
4,380 KB
testcase_16 AC 1 ms
4,384 KB
testcase_17 AC 1 ms
4,384 KB
testcase_18 AC 2 ms
4,384 KB
testcase_19 AC 41 ms
4,380 KB
testcase_20 AC 104 ms
4,384 KB
testcase_21 AC 80 ms
4,380 KB
testcase_22 AC 83 ms
4,384 KB
testcase_23 AC 50 ms
4,384 KB
testcase_24 AC 56 ms
4,384 KB
testcase_25 AC 55 ms
4,384 KB
testcase_26 AC 64 ms
4,384 KB
testcase_27 AC 90 ms
4,384 KB
testcase_28 AC 63 ms
4,380 KB
testcase_29 AC 101 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi  = vector<int>; using vb  = vector<bool>; using vd  = vector<double>; using vl  = vector<ll>;
using vvi = vector<vi>;  using vvb = vector<vb>;   using vvd = vector<vd>;     using vvl = vector<vl>;

pair<vl, vl> primeFactors(ll n){
    vl p,e;
    ll m = n;
    for(ll i = 2; i*i <= n; i++){
        if(m%i != 0) continue;
        int c = 0;
        while(m%i == 0) c++, m /= i;
        p.push_back(i); e.push_back(c);
    }
    if(m > 1){
        p.push_back(m); e.push_back(1);
    }
    return make_pair(p,e);
}

int main() {
	ll n; cin >> n;
	auto v = primeFactors(n);
	ll sum = 0; for (auto& i : v.second) sum += i;
	cout << (sum > 2 ? "YES" : "NO") << endl;
	return 0;
}
0