結果

問題 No.36 素数が嫌い!
ユーザー kongarishisyamokongarishisyamo
提出日時 2016-02-27 22:37:29
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 250 bytes
コンパイル時間 519 ms
コンパイル使用メモリ 59,800 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-24 18:40:15
合計ジャッジ時間 1,654 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 5 ms
4,348 KB
testcase_01 WA -
testcase_02 AC 1 ms
4,348 KB
testcase_03 WA -
testcase_04 AC 1 ms
4,348 KB
testcase_05 WA -
testcase_06 AC 1 ms
4,348 KB
testcase_07 AC 1 ms
4,348 KB
testcase_08 AC 1 ms
4,348 KB
testcase_09 AC 1 ms
4,348 KB
testcase_10 WA -
testcase_11 AC 4 ms
4,348 KB
testcase_12 AC 9 ms
4,348 KB
testcase_13 AC 8 ms
4,348 KB
testcase_14 WA -
testcase_15 AC 1 ms
4,348 KB
testcase_16 AC 1 ms
4,348 KB
testcase_17 AC 1 ms
4,348 KB
testcase_18 AC 1 ms
4,348 KB
testcase_19 AC 4 ms
4,348 KB
testcase_20 WA -
testcase_21 AC 7 ms
4,348 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 6 ms
4,348 KB
testcase_27 AC 8 ms
4,348 KB
testcase_28 AC 6 ms
4,348 KB
testcase_29 AC 8 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

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