結果

問題 No.36 素数が嫌い!
ユーザー masa
提出日時 2015-01-30 17:05:44
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 102 ms / 5,000 ms
コード長 419 bytes
コンパイル時間 431 ms
コンパイル使用メモリ 59,224 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-27 00:14:42
合計ジャッジ時間 1,701 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <utility>

using namespace std;

int main() {
	long long n;

	cin >> n;
	int count = 0;
	for (long long i = 2; i * i <= n; ) {
		if (n % i == 0) {
			count++;
			n /= i;
			if (count >= 3) {
				break;
			}
		} else {
			i++;
		}
	}
	if (count < 3 && n > 1) {
		count++;
	}
	cout << (count >= 3 ? "YES" : "NO") << endl;
	return 0;
}
0