結果
問題 | No.2610 Decreasing LCMs |
ユーザー |
![]() |
提出日時 | 2024-01-19 22:51:43 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 1,256 bytes |
コンパイル時間 | 1,037 ms |
コンパイル使用メモリ | 106,212 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-28 04:56:08 |
合計ジャッジ時間 | 1,937 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 22 |
ソースコード
#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';}