結果

問題 No.36 素数が嫌い!
ユーザー DaYuanChi
提出日時 2021-02-13 15:01:10
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 500 bytes
コンパイル時間 1,581 ms
コンパイル使用メモリ 172,424 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-20 17:51:38
合計ジャッジ時間 4,105 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 24 WA * 2
権限があれば一括ダウンロードができます

ソースコード

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