結果

問題 No.36 素数が嫌い!
ユーザー recososorecososo
提出日時 2020-02-11 15:58:26
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 472 bytes
コンパイル時間 2,439 ms
コンパイル使用メモリ 173,540 KB
実行使用メモリ 6,548 KB
最終ジャッジ日時 2024-04-08 15:30:09
合計ジャッジ時間 4,326 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
    ll n;cin >> n;
    vector<ll> v;
    for(ll i=1;i*i<=n;i++){
        if(n%i==0){
            v.push_back(i);
            if(i*i!=n){
                v.push_back(n/i);
            }
        }
    }
    sort(v.begin(),v.end());
    for(int i=0;i<v.size()-1;i++){
        if(v[i+1]%v[i]!=0){
            cout << "YES" << endl;
            return 0;
        }
    }
    cout << "NO" << endl;
}
0