結果

問題 No.36 素数が嫌い!
ユーザー DaYuanChiDaYuanChi
提出日時 2021-02-13 15:01:10
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 500 bytes
コンパイル時間 1,634 ms
コンパイル使用メモリ 170,020 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-27 23:30:28
合計ジャッジ時間 4,224 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main(){
  ll n;
  cin >> n;
  ll num = n;
  vector<pair<ll, int>>  P;
  for(ll i = 2; i*i <=n ;i++){
     int x = 0;
     while(num%i ==0){
           num  /=  i;
           x++;
    }
    if(x >=1) P.emplace_back(i, x);
  }
   if( num !=1) P.emplace_back(num, 1);
  int cnt = 1;
  for(auto x : P) cnt *= x.second+1;
  if(n==1||cnt==2||(cnt==4&&P.size()==2)) cout << "NO" << endl;
  else cout << "YES" << endl;
  return 0;
}
  
0