結果

問題 No.36 素数が嫌い!
ユーザー ku_material_roku_material_ro
提出日時 2016-09-27 10:10:49
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 123 ms / 5,000 ms
コード長 537 bytes
コンパイル時間 397 ms
コンパイル使用メモリ 58,008 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-09 07:41:07
合計ジャッジ時間 3,016 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
4,376 KB
testcase_01 AC 96 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 41 ms
4,380 KB
testcase_12 AC 123 ms
4,376 KB
testcase_13 AC 122 ms
4,376 KB
testcase_14 AC 77 ms
4,380 KB
testcase_15 AC 1 ms
4,380 KB
testcase_16 AC 2 ms
4,380 KB
testcase_17 AC 1 ms
4,380 KB
testcase_18 AC 1 ms
4,380 KB
testcase_19 AC 49 ms
4,376 KB
testcase_20 AC 122 ms
4,376 KB
testcase_21 AC 93 ms
4,376 KB
testcase_22 AC 97 ms
4,384 KB
testcase_23 AC 58 ms
4,376 KB
testcase_24 AC 65 ms
4,376 KB
testcase_25 AC 64 ms
4,376 KB
testcase_26 AC 74 ms
4,376 KB
testcase_27 AC 106 ms
4,376 KB
testcase_28 AC 73 ms
4,376 KB
testcase_29 AC 118 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<string>
#include<math.h>
using namespace std;

/*int sosu(long long N){
	long long A;
	int J = 0;
	for (long long i1 = 2; i1 < N/2; i1++){
		A = (N / i1)*i1;
		if (A == N){
			J = 1;
			break;
		}
	}
	return J;

}*/

int main(){
	long long n;
	long long a;
	int cnt = 0;
	cin >> n;
	a = n;
	//int judge = 0;
	for (long long i = 2; i < sqrt(n); i++){
		while (a%i == 0){
			a /= i;
			cnt++;
		}
	}
	if (a != 1) cnt++;
	if (cnt >=3){
		cout << "YES" << endl;
	}
	else{
		cout << "NO" << endl;
	}

	return 0;
}
0