結果

問題 No.36 素数が嫌い!
ユーザー kongarishisyamo
提出日時 2016-02-27 22:37:29
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 250 bytes
コンパイル時間 663 ms
コンパイル使用メモリ 58,936 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-24 11:51:37
合計ジャッジ時間 1,743 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 16 WA * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<cmath>

using namespace std;

int main(){

	long long N;

	cin>>N;

	double hani=sqrt((double)N);
	bool f=true;

	for(int i=2;i<hani;i++){
		if(N%2==0) f=false;
	}

	if(f||N==1) cout<<"NO"<<endl;
	else cout<<"YES"<<endl;
}
0