結果
| 問題 |
No.36 素数が嫌い!
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-08-13 03:08:57 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 740 bytes |
| コンパイル時間 | 2,335 ms |
| コンパイル使用メモリ | 196,904 KB |
| 最終ジャッジ日時 | 2025-01-30 22:06:55 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 24 WA * 2 |
ソースコード
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
vector<pair<long long, long long>> prime_factorize(long long N){
vector<pair<long long, long long>> res;
for(long long a = 2; a * a <= N; ++a){
if(N % a != 0) continue;
long long ex = 0;
while(N % a == 0) ++ex, N /= a;
res.push_back({a,ex});
}
if(N != 1) res.push_back({N,1});
return res;
}
int main(){
cin.tie(0);
ios::sync_with_stdio(0);
ll N; cin >> N;
ll cnt = 0;
for(ll i = 2; i * i <= N; i++) {
while(N % i == 0) cnt++, N /= i;
if(cnt >= 2){ cout << "YES" << endl; return 0; }
}
cout << "NO" << endl;
return 0;
}