結果

問題 No.36 素数が嫌い!
ユーザー DialBird
提出日時 2016-11-28 19:35:39
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
TLE  
実行時間 -
コード長 370 bytes
コンパイル時間 762 ms
コンパイル使用メモリ 53,592 KB
実行使用メモリ 16,968 KB
最終ジャッジ日時 2024-11-27 12:44:41
合計ジャッジ時間 111,221 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 9 TLE * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>

using namespace std;

bool check(int n){
  int i = 2;
  int count = 0;
  while (n != 1) {
    if (n % i == 0) {
      count++;
      if (count == 3) return true;
      n /= i;
    } else {
      i++;
    }
  }
  return false;
}

int main(){
  int n;
  cin >> n;
  if (check(n)) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
}
0