結果

問題 No.809 かけ算
ユーザー DenteDente
提出日時 2019-09-10 21:29:57
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 643 bytes
コンパイル時間 1,584 ms
コンパイル使用メモリ 170,872 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-15 13:10:49
合計ジャッジ時間 2,686 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 WA -
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define REP(i,a) for(int i = 0; i < (a); i++)
#define ALL(a) (a).begin(),(a).end()
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1e9;
const int MOD = 1e9 + 7;

map<long long,int> prime_factor(long long n){
    map<long long,int> mp;
    for(long long i = 2; i * i <= n; i++){
        while(n % i == 0){
            mp[i]++;
            n /= i;
        }
    }
    if(n != 1) mp[n]++;
    return mp;
}

signed main(){
    ll c;
    cin >> c;
    map<ll, int> mp = prime_factor(c);
    for(auto i : mp){
        cout << i.first << " " << c / i.first << endl;
        break;
    }
}
0