結果
問題 |
No.36 素数が嫌い!
|
ユーザー |
|
提出日時 | 2016-04-19 18:02:46 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 95 ms / 5,000 ms |
コード長 | 418 bytes |
コンパイル時間 | 566 ms |
コンパイル使用メモリ | 59,208 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-27 00:44:37 |
合計ジャッジ時間 | 2,037 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 26 |
ソースコード
#include <iostream> #include <cmath> using namespace std; int pf(unsigned long long x) { int r = 1; int lm = (unsigned long long)sqrt(x); for ( unsigned long long i = 2; i <= lm; ) { if ( x % i == 0 ) { r++; x = x / i; lm = (unsigned long long)sqrt(x); } else { i++; } } return r; } int main() { unsigned long long n; cin >> n; cout << (pf(n) >= 3 ? "YES" : "NO") << endl; return 0; }