結果

問題 No.36 素数が嫌い!
ユーザー kroton
提出日時 2014-10-08 00:37:13
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 100 ms / 5,000 ms
コード長 325 bytes
コンパイル時間 411 ms
コンパイル使用メモリ 55,132 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-27 00:11:24
合計ジャッジ時間 1,781 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;

typedef long long ll;
int main(){
	ll N;
	cin >> N;

	int cnt = 0;
	for(ll p=2;p*p<=N;p++){
		while(N % p == 0){
			++cnt;
			N /= p;
		}
	}
	if(N != 1)++cnt;

	--cnt;
	if(cnt >= 2){
		cout << "YES" << endl;
	} else {
		cout << "NO" << endl;
	}

	return 0;
}
0