結果

問題 No.414 衝動
ユーザー kpinkcatkpinkcat
提出日時 2023-12-12 05:10:17
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 27 ms / 1,000 ms
コード長 604 bytes
コンパイル時間 1,302 ms
コンパイル使用メモリ 108,744 KB
実行使用メモリ 11,364 KB
最終ジャッジ日時 2023-12-12 05:10:20
合計ジャッジ時間 2,496 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
9,944 KB
testcase_01 AC 1 ms
6,676 KB
testcase_02 AC 2 ms
6,676 KB
testcase_03 AC 27 ms
11,364 KB
testcase_04 AC 14 ms
11,364 KB
testcase_05 AC 25 ms
11,364 KB
testcase_06 AC 24 ms
11,364 KB
testcase_07 AC 2 ms
6,676 KB
testcase_08 AC 15 ms
8,008 KB
testcase_09 AC 25 ms
11,364 KB
testcase_10 AC 2 ms
6,676 KB
testcase_11 AC 2 ms
6,676 KB
testcase_12 AC 2 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<string>
#include<algorithm>
#include<cctype>
#include<set>
#include<bitset>
#include<math.h>
#include<map>
#include<queue>
#include<iomanip>
using namespace std;
using ll = long long;

int main()
{
    ll m, a;
    cin >> m;
    a = pow(m, 0.5);
    vector<ll> p(a+1, 1);
    p[0] = 0;
    p[1] = 0;
    for (int i = 2; i <= a; i++){
        if (p[i]) for (int j = i; j <= a; j += i) p[j] = 0;
    }
    for (int i = 2; i <= a; i++){
        if (!(m%i)) {
            cout << i << " " << m/i << endl;
            return 0;
        }
    }
    cout << 1 << " " << m << endl;
}
0