結果
問題 |
No.36 素数が嫌い!
|
ユーザー |
![]() |
提出日時 | 2024-07-27 11:38:41 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 757 bytes |
コンパイル時間 | 2,039 ms |
コンパイル使用メモリ | 174,756 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-27 11:38:45 |
合計ジャッジ時間 | 3,636 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 24 WA * 2 |
ソースコード
#include<bits/stdc++.h> using namespace std; using ll = long long; #define rep(i,m,n) for(int i=m; i<n; ++i) #define repl(i,m,n) for(ll i=m; i<n; ++i) int main(){ ll N; cin >> N; map<ll, ll> prime_fact; for(ll i = 2; i*i <= N; ++i){ if(N % i != 0LL) continue; ll ex = 0LL; while(N % i == 0){ N /= i; ex++; } prime_fact[i] = ex; } if(N != 1LL) prime_fact[N] = 1LL; if(prime_fact.size() > 2){ cout << "YES" << endl; return 0; }else{ for(auto &p : prime_fact){ if(p.second > 1LL){ cout << "YES" << endl; return 0; } } cout << "NO" << endl; return 0; } }