結果

問題 No.2610 Decreasing LCMs
ユーザー 👑 hitonanodehitonanode
提出日時 2024-01-19 22:51:43
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 1,256 bytes
コンパイル時間 1,030 ms
コンパイル使用メモリ 106,884 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-01-19 22:51:45
合計ジャッジ時間 2,356 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,676 KB
testcase_01 AC 2 ms
6,676 KB
testcase_02 AC 1 ms
6,676 KB
testcase_03 AC 1 ms
6,676 KB
testcase_04 AC 2 ms
6,676 KB
testcase_05 AC 2 ms
6,676 KB
testcase_06 AC 2 ms
6,676 KB
testcase_07 AC 2 ms
6,676 KB
testcase_08 AC 1 ms
6,676 KB
testcase_09 AC 2 ms
6,676 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
testcase_13 AC 1 ms
6,676 KB
testcase_14 AC 2 ms
6,676 KB
testcase_15 AC 2 ms
6,676 KB
testcase_16 AC 2 ms
6,676 KB
testcase_17 AC 2 ms
6,676 KB
testcase_18 AC 2 ms
6,676 KB
testcase_19 AC 2 ms
6,676 KB
testcase_20 AC 2 ms
6,676 KB
testcase_21 AC 1 ms
6,676 KB
testcase_22 AC 1 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <algorithm>
#include <iostream>
#include <numeric>
#include <vector>
using namespace std;
#define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i##_end_;i++)
#define REP(i, n) FOR(i,0,n)


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

    // const int B = N;
    // int last_p = 5;
    // vector<int> ps{1,3,7,17,37,79,163,331,673,1361,2729,5471,10949,21911,43853,87719,175447,350899,701819,1403641,2807303,5614657,11229331,22458671,44917381};
    vector<int> ps{5,7,11,17,29,43,67,101,151,227,347,521,787,1181,1777,2671,4007,6011,9029,13553,20333,30509,45763,68659,103001};
    // vector<int> ps;
    // ps.push_back(last_p);
    // REP(_, N - 1) {
    //     // int next_p = sieve.primes.at(argub(sieve.primes, last_p * 2));
    //     int next_p = sieve.primes.at(arglb(sieve.primes, int(last_p * 1.5)));
    //     dbg(next_p);
    //     ps.push_back(next_p);
    //     // dbg(next_p);
    //     // ret.push_back(next_p << (B - 1 - _));
    //     last_p = next_p;
    // }

    reverse(ps.begin(), ps.end());
    vector<long long> ret(N);
    REP(i, N) ret.at(i) = (ps.at(i) << (i));
    vector<long long> ls;
    REP(i, N - 1) ls.push_back(std::lcm(ret.at(i), ret.at(i + 1)));
    REP(i, N) cout << ret.at(i) << ' ';
    cout << '\n';
}
0