結果

問題 No.1058 素敵な数
ユーザー rokahikou1rokahikou1
提出日時 2020-07-31 03:40:10
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 929 bytes
コンパイル時間 829 ms
コンパイル使用メモリ 94,120 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-18 17:01:10
合計ジャッジ時間 1,573 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <algorithm>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for(int(i) = 0; (i) < (n); (i)++)
#define FOR(i, m, n) for(int(i) = (m); (i) < (n); (i)++)
#define All(v) (v).begin(), (v).end()
#define pb push_back
#define MP(a, b) make_pair((a), (b))
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
const int INF = 1 << 30;
const ll LINF = 1LL << 60;
const int MOD = 1e9 + 7;

int main() {
    int N;
    cin >> N;
    N--;
    vector<int> res;
    res.pb(1);
    vector<ll> ps = {100003, 100019, 100043, 100049, 100057};
    for(int i = 0; i < ps.size(); i++) {
        res.pb(ps[i] * ps[i]);
        if(i + 1 < ps.size())
            res.pb(ps[i] * ps[i + 1]);
    }
    cout << res[N] << endl;
    return 0;
}
0