結果

問題 No.1256 連続整数列
ユーザー milanis48663220milanis48663220
提出日時 2020-10-16 21:27:32
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 799 bytes
コンパイル時間 823 ms
コンパイル使用メモリ 89,920 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-28 06:52:53
合計ジャッジ時間 1,960 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <queue>
#include <set>
#include <map>

using namespace std;
typedef long long ll;

vector<int> fac(int n){
    vector<int> ans;
    for(int i = 2; i*i <= n; i++){
        while(n%i == 0){
            ans.push_back(i);
            n /= i;
        }
    }
    if(n != 1) ans.push_back(n);
    return ans;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << setprecision(10) << fixed;
    int a; cin >> a;
    auto v = fac(a);
    if(v.size() == 1){
        cout << "NO" << endl;
    }else{
        set<int> st;
        for(int i : v) st.insert(i);
        if(v[0] == 2 && st.size() == 1){
            cout << "NO" << endl;
        }else{
            cout << "YES" << endl;
        }
    }
}
0