結果

問題 No.8023 素数判定するだけ
ユーザー tada721
提出日時 2021-03-12 18:35:11
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 237 bytes
コンパイル時間 512 ms
コンパイル使用メモリ 63,488 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-14 08:01:32
合計ジャッジ時間 5,222 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
using namespace std;
int main(){
	int n;
	cin>>n;
	bool t=true;
	int k=t;
	bool ans=false;
	if(n==k)ans=true;
	for(int i=k+k;i<n;i++){
		if(i!=n&&!(n%i))ans=true;
	}
	if(ans)cout<<"NO"<<endl;
	else cout<<"YES"<<endl;
}
0