結果
問題 | No.36 素数が嫌い! |
ユーザー |
|
提出日時 | 2018-02-03 22:28:56 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 112 ms / 5,000 ms |
コード長 | 428 bytes |
コンパイル時間 | 1,489 ms |
コンパイル使用メモリ | 165,700 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-27 01:17:02 |
合計ジャッジ時間 | 2,997 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 26 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define LL long long int main() { LL n, nn; cin >> n; nn = n; int count = 0; for (LL i = 2; i * i <= nn; i++) { while (n % i == 0) { n /= i; count++; if (count == 2 && n != 1) { cout << "YES" << endl; return 0; } } } cout << "NO" << endl; return 0; }