結果

問題 No.36 素数が嫌い!
ユーザー kuisiba
提出日時 2016-10-17 13:10:33
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 102 ms / 5,000 ms
コード長 401 bytes
コンパイル時間 450 ms
コンパイル使用メモリ 54,360 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-27 00:49:59
合計ジャッジ時間 1,704 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cstdint>

using namespace std;

int main() {

  ios::sync_with_stdio(false);
  cin.tie(0);

  int64_t n;
  cin >> n;
  if (n <= 7) {
    cout << "NO" << endl;
    return 0;
  }
  int count = 0;
  for (int64_t i = 2; i * i <= n; i++) {
    while (n % i == 0) {
      n /= i;
      count++;
    }
  }
  if (n != 1) count++;
  cout << (count >= 3 ? "YES" : "NO") << endl;
}
0