結果

問題 No.36 素数が嫌い!
ユーザー 古寺いろは
提出日時 2015-04-15 20:08:06
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 101 ms / 5,000 ms
コード長 326 bytes
コンパイル時間 1,537 ms
コンパイル使用メモリ 158,208 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-27 00:17:49
合計ジャッジ時間 2,706 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
using namespace std;

int isprime(long long a){
	int ans = 0;
	for (long long i = 2; i * i <= a; i++)
	{
		while (a%i == 0){
			a /= i;
			ans++;
		}
	}
	if (a != 1) ans++;
	return ans;
}

int main() {
	long long N;
	cin >> N;
	if (isprime(N) < 3) cout << "NO" << endl;
	else cout << "YES" << endl;
}
0