結果

問題 No.36 素数が嫌い!
ユーザー ゆきのんゆきのん
提出日時 2020-03-14 01:55:15
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 109 ms / 5,000 ms
コード長 1,093 bytes
コンパイル時間 1,719 ms
コンパイル使用メモリ 171,640 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-15 10:46:32
合計ジャッジ時間 4,216 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 51 ms
4,376 KB
testcase_01 AC 85 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 2 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,376 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 37 ms
4,376 KB
testcase_12 AC 109 ms
4,376 KB
testcase_13 AC 109 ms
4,380 KB
testcase_14 AC 68 ms
4,380 KB
testcase_15 AC 1 ms
4,376 KB
testcase_16 AC 2 ms
4,380 KB
testcase_17 AC 2 ms
4,376 KB
testcase_18 AC 1 ms
4,380 KB
testcase_19 AC 44 ms
4,380 KB
testcase_20 AC 109 ms
4,380 KB
testcase_21 AC 83 ms
4,380 KB
testcase_22 AC 86 ms
4,376 KB
testcase_23 AC 52 ms
4,376 KB
testcase_24 AC 59 ms
4,376 KB
testcase_25 AC 57 ms
4,376 KB
testcase_26 AC 67 ms
4,380 KB
testcase_27 AC 94 ms
4,380 KB
testcase_28 AC 65 ms
4,380 KB
testcase_29 AC 105 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long LL;
typedef pair<int,int> P;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<typename T> T gcd(T a,T b){return b?gcd(b,a%b):a;}
const LL mod=1000000007;
const LL LINF=1LL<<62;
const int INF=1<<30;
int dx[]={1,0,-1,0,1,-1,1,-1};
int dy[]={0,1,0,-1,1,-1,-1,1};

vector<LL> divi(LL K){
    vector<LL> v;
    for(LL i=1;i*i<=K;i++){
        if(K%i) continue;
        v.pb(i);
        v.pb(K/i);
    }
    sort(ALL(v));
    v.erase(unique(ALL(v)),v.end());
    return v;
}

int main(){
    LL n;cin >> n;
    auto p = divi(n);
    if(p.size() <= 3){
        puts("NO");
    }
    else if(p.size() == 4){
        if(p[1] * p[1] == p[2]) puts("YES");
        else puts("NO");
    }
    else puts("YES");
    return 0;
}
0