結果

問題 No.36 素数が嫌い!
ユーザー 西尾西尾
提出日時 2018-03-20 17:29:16
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 476 bytes
コンパイル時間 1,716 ms
コンパイル使用メモリ 165,112 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-06 14:02:39
合計ジャッジ時間 3,671 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 40 ms
4,380 KB
testcase_02 AC 2 ms
4,384 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 1 ms
4,384 KB
testcase_10 WA -
testcase_11 AC 18 ms
4,380 KB
testcase_12 AC 51 ms
4,380 KB
testcase_13 AC 50 ms
4,376 KB
testcase_14 AC 32 ms
4,384 KB
testcase_15 AC 2 ms
4,380 KB
testcase_16 AC 2 ms
4,380 KB
testcase_17 AC 1 ms
4,376 KB
testcase_18 AC 1 ms
4,380 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 28 ms
4,380 KB
testcase_25 WA -
testcase_26 AC 32 ms
4,380 KB
testcase_27 AC 44 ms
4,380 KB
testcase_28 AC 31 ms
4,380 KB
testcase_29 AC 49 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int Count( const long long N )
{
long long i;
long long X;
int R;
int iCnt;

	R = (int) sqrt( (double) N );
	X = N;

	iCnt = 0;
	while( X > 0 && X % 2 == 0 )
	{
		iCnt++;
		X /= 2;
	}

	for( i = 3; i <= R; i += 2 )
	{
		while( X > 0 && X % i == 0 )
		{
			iCnt++;
			X /= i;
		}
	}

	return iCnt;
}

int main()
{
long long N;

	cin >> N;

	if( Count( N ) > 2 )
		cout << "YES" << endl;
	else
		cout << "NO" << endl;

	return 0;
}
0