結果

問題 No.36 素数が嫌い!
ユーザー satanic
提出日時 2016-03-14 03:19:29
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 417 bytes
コンパイル時間 553 ms
コンパイル使用メモリ 61,292 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-25 11:54:00
合計ジャッジ時間 1,901 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 19 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <cmath>

int main() {
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);

	long long int n;
	bool already_devided = false;

	std::cin >> n;
	for (int i = 2; i < std::sqrt(n); ++i) {
		if (n%i == 0) {
			if (already_devided) {
				std::cout << "YES\n";
				return 0;
			}
			else {
				already_devided = true;
				i = 1;
			}
		}
	}

	std::cout << "NO\n";

	return 0;
}
0