結果
問題 | No.36 素数が嫌い! |
ユーザー |
![]() |
提出日時 | 2021-02-13 15:02:39 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 99 ms / 5,000 ms |
コード長 | 508 bytes |
コンパイル時間 | 1,476 ms |
コンパイル使用メモリ | 170,632 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-20 17:53:27 |
合計ジャッジ時間 | 3,562 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 26 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; int main(){ ll n; cin >> n; ll num = n; vector<pair<ll, int>> P; for(ll i = 2; i*i <=n ;i++){ int x = 0; while(num%i ==0){ num /= i; x++; } if(x >=1) P.emplace_back(i, x); } if( num !=1) P.emplace_back(num, 1); int cnt = 1; for(auto x : P) cnt *= x.second+1; if(n==1||cnt==2||cnt==3||(cnt==4&&P.size()==2)) cout << "NO" << endl; else cout << "YES" << endl; return 0; }