結果
問題 |
No.36 素数が嫌い!
|
ユーザー |
![]() |
提出日時 | 2020-06-13 21:43:08 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 559 bytes |
コンパイル時間 | 1,551 ms |
コンパイル使用メモリ | 167,040 KB |
実行使用メモリ | 10,012 KB |
最終ジャッジ日時 | 2024-06-25 22:27:17 |
合計ジャッジ時間 | 13,981 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 4 |
other | TLE * 1 -- * 25 |
ソースコード
#include <bits/stdc++.h> #define rep(i,n) for(int i=(0);i<(n);i++) using namespace std; typedef long long ll; template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; } template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; } int main(){ cin.tie(0); ios::sync_with_stdio(false); ll n; cin >> n; int cnt = 0; for(int i = 2; i * i < n; i++){ while(n % i == 0){ cnt++; n /= i; } } if(n > 1) cnt++; if(cnt > 2){ cout << "YES" << endl; }else{ cout << "NO" << endl; } }