結果

問題 No.1058 素敵な数
ユーザー sawfishsawfish
提出日時 2022-10-24 11:37:07
言語 C++17(clang)
(17.0.6 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 605 bytes
コンパイル時間 2,447 ms
コンパイル使用メモリ 91,520 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-15 11:27:29
合計ジャッジ時間 3,318 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;
using LL = long long;
using ULL = unsigned long long;

LL P[]{
        100003,
        100019,
        100043,
        100049,
        100057,
        100069,
        100103,
        100109,
        100129,
        100151,
        100153,
};

int main() {
    int N;
    cin >> N;

    vector<LL> ans;
    ans.push_back(1);

    for (int i = 0; i < 11; i++) {
        for (int j = i; j < 11; j++) {
            ans.push_back(P[i] * P[j]);
        }
    }

    sort(ans.begin(), ans.end());

    cout << ans[N - 1] << endl;
}
0