結果

問題 No.312 置換処理
ユーザー oxyshower
提出日時 2020-01-09 14:17:32
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 522 bytes
コンパイル時間 1,580 ms
コンパイル使用メモリ 173,104 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-11-23 03:51:35
合計ジャッジ時間 3,130 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 31 WA * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#ifdef LOCAL_DEBUG
  #include "LOCAL_DEBUG.hpp"
#endif
#define int long long

//因数分解
map<int,int> prime_factor(int n){
  map<int,int> mp; //{約数,個数}
  for(int i = 2; i*i <= n; i++){
    while(n%i == 0){
      mp[i]++;
      n /= i;
    }
  }
  if(n != 1) mp[n] = 1; //n=素数
  return mp;
}

signed main(){

  int n; cin >> n;
  auto mp = prime_factor(n);
  for(auto p : mp){
    if(p.first <= 2) continue;
    cout << p.first;
    return 0;
  }

  return 0;
}
0