結果
問題 |
No.36 素数が嫌い!
|
ユーザー |
|
提出日時 | 2018-03-20 17:34:27 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 51 ms / 5,000 ms |
コード長 | 466 bytes |
コンパイル時間 | 1,785 ms |
コンパイル使用メモリ | 167,076 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-27 01:20:13 |
合計ジャッジ時間 | 2,741 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 26 |
ソースコード
#include <bits/stdc++.h> using namespace std; int Count( const long long N ) { long long i; long long X; int iCnt; X = N; iCnt = 0; while( X > 0 && X % 2 == 0 ) { iCnt++; X /= 2; } for( i = 3; i * i <= X; i += 2 ) { while( X > 0 && X % i == 0 ) { iCnt++; X /= i; } } if( X > 1 ) iCnt++; return iCnt; } int main() { long long N; cin >> N; if( Count( N ) > 2 ) cout << "YES" << endl; else cout << "NO" << endl; return 0; }