結果

問題 No.36 素数が嫌い!
ユーザー kuisiba
提出日時 2016-10-17 12:27:02
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 401 bytes
コンパイル時間 490 ms
コンパイル使用メモリ 55,520 KB
実行使用メモリ 9,892 KB
最終ジャッジ日時 2024-11-22 12:58:16
合計ジャッジ時間 13,647 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 15 WA * 9 TLE * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cstdint>

using namespace std;

int main() {

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

  int64_t n;
  cin >> n;
  bool sosuu;
  if (n == 1) {
    cout << "NO" << endl;
    return 0;
  }
  for (int i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      sosuu = false;
      break;
    } else {
      sosuu = true;
    }
  }
  cout << (sosuu ? "NO" : "YES") << endl;
}
0