結果

問題 No.8023 素数判定するだけ
ユーザー e869120
提出日時 2017-03-31 23:47:31
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 226 bytes
コンパイル時間 493 ms
コンパイル使用メモリ 62,848 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-07 06:34:47
合計ジャッジ時間 3,826 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
using namespace std;
int n, i;
int main() {
	cin >> n; int p = n; p--; if (!p)cout << "NO" << endl;
	else {
		i++; i++;
		while ((n%i))i++;
		if (i == n)cout << "YES" << endl; else cout << "NO" << endl;
	}
}
0