結果

問題 No.36 素数が嫌い!
ユーザー 小指が強い人
提出日時 2016-01-01 13:01:28
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 379 bytes
コンパイル時間 415 ms
コンパイル使用メモリ 58,204 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-19 09:07:47
合計ジャッジ時間 1,418 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 17 WA * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <math.h>
using namespace std;

int main(void)
{
    long long n;
    cin >> n;
    if(n == 1) {
        cout << "NO" << endl;
        exit(0);
    }
    long long sh = sqrt(n);
    for(int i = 2; i <= sh; i++) {
        if(n % i == 0) {
            cout << "YES" << endl;
            exit(0);
        }
    }
    cout << "NO" << endl;
    return 0;
}
0