結果

問題 No.36 素数が嫌い!
ユーザー metasequo
提出日時 2015-05-30 22:12:52
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 283 bytes
コンパイル時間 437 ms
コンパイル使用メモリ 59,036 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-07-06 12:47:52
合計ジャッジ時間 1,610 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 19 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <math.h>
#define ULL unsigned long long
using namespace std;
int main(){
	ULL n;
	bool ans = true;
	cin >> n;
	if(n != 1){
		for(ULL i=2; i<sqrt(n); i++){
			if(n % i == 0){
				ans = false;
				break;
			}
		}
	}
	cout << (ans ? "NO" : "YES") << endl;
}
0