結果
| 問題 |
No.36 素数が嫌い!
|
| コンテスト | |
| ユーザー |
togari_takamoto
|
| 提出日時 | 2016-02-26 13:55:55 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 752 bytes |
| コンパイル時間 | 1,313 ms |
| コンパイル使用メモリ | 164,928 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-22 13:56:34 |
| 合計ジャッジ時間 | 3,675 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 17 WA * 9 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>; using vb = vector<bool>; using vd = vector<double>; using vl = vector<ll>;
using vvi = vector<vi>; using vvb = vector<vb>; using vvd = vector<vd>; using vvl = vector<vl>;
pair<vl, vl> primeFactors(ll n){
vl p,e;
ll m = n;
for(ll i = 2; i*i <= n; i++){
if(m%i != 0) continue;
int c = 0;
while(m%i == 0) c++, m /= i;
p.push_back(i); e.push_back(c);
}
if(m > 1){
p.push_back(m); e.push_back(1);
}
return make_pair(p,e);
}
int main() {
ll n; cin >> n;
auto v = primeFactors(n);
ll sum = 0; for (auto& i : v.second) sum += i;
cout << (sum > 1 ? "YES" : "NO") << endl;
return 0;
}
togari_takamoto