結果
| 問題 | 
                            No.36 素数が嫌い!
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2017-02-12 21:02:53 | 
| 言語 | C++11(廃止可能性あり)  (gcc 13.3.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 677 bytes | 
| コンパイル時間 | 713 ms | 
| コンパイル使用メモリ | 74,188 KB | 
| 実行使用メモリ | 6,820 KB | 
| 最終ジャッジ日時 | 2024-12-29 16:57:33 | 
| 合計ジャッジ時間 | 1,656 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 4 | 
| other | AC * 16 WA * 10 | 
ソースコード
#include <iostream>
#include <sstream>
#include <vector>
#include <array>
#include <string>
#include <algorithm>
#include <map>
#include <cmath>
using namespace std;
#define REP(i,first,last) for (int i=first;i<last;++i)
#define MAX(x,y) (x > y ? x : y)
#define MIN(x,y) (x < y ? x : y)
int N;
vector<int> factor(int n){
  vector<int> res;
  int num = 2;
  int sqrt_n = sqrt(n);
  while (n > 1) {
    while (n % num == 0) {
      n /= num;
      res.push_back(num);
    }
    ++num;
    if (num > sqrt_n) break;
  }
  if (n != 1) res.push_back(n);
  return res;
}
int main(){
  cin >> N;
  vector<int> res = factor(N);
  cout << (res.size() > 2 ? "YES" : "NO") << endl;
}