結果

問題 No.36 素数が嫌い!
ユーザー atn112323atn112323
提出日時 2016-05-08 08:52:53
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 478 bytes
コンパイル時間 433 ms
コンパイル使用メモリ 54,444 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-15 13:46:49
合計ジャッジ時間 1,611 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>

using namespace std;

long long N;

int main() {
	cin >> N;
	for (long long d = 2; d * d <= N; d++) {
		int cnt = 0;
		while (N % d == 0) {
			cnt++;
			N /= d;
		}
		if (cnt > 0) {
			if (cnt > 2) {
				cout << "YES" << endl;
			} else if (cnt == 2) {
				if (N > 1) {
					cout << "YES" << endl;
				} else {
					cout << "NO" << endl;
				}
			} else if (cnt == 1) {
				cout << "YES" << endl;
			}
			return 0;
		}
	}
	cout << "NO" << endl;
	return 0;
}
0