結果
問題 | No.36 素数が嫌い! |
ユーザー |
![]() |
提出日時 | 2016-02-11 10:50:30 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 100 ms / 5,000 ms |
コード長 | 559 bytes |
コンパイル時間 | 1,504 ms |
コンパイル使用メモリ | 159,700 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-27 00:41:25 |
合計ジャッジ時間 | 2,543 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 26 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int (i) = 0 ; (i) < (int)(n) ; (i)++) #define REP(i,a,b) for(int (i) = a ; (int)(i) <= (int)(b) ; (i)++) #define all(n) (n).begin(),(n).end() typedef vector<int> Vi; typedef vector<Vi> VVi; typedef pair<long long,long long> Pii; typedef vector<Pii> VPii; int main(){ long long N; cin >> N; int c = 0; for(long long i = 2 ; i*i <= N ; i++){ while( N % i == 0 ){ N /= i; c++; } } if( N != 1 ) c++; if( c >= 3 ){ cout << "YES" << endl; }else{ cout << "NO" << endl; } }