結果

問題 No.2610 Decreasing LCMs
コンテスト
ユーザー 蜜蜂
提出日時 2021-04-05 17:46:35
言語 C++14
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 805 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,601 ms
コンパイル使用メモリ 245,840 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-04-14 13:58:17
合計ジャッジ時間 4,015 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;

#include <atcoder/all>
using namespace atcoder;

using ll = long long;
using ld = long double;

using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vld = vector<ld>;
using vvld = vector<vld>;

#define fi first
#define se second
#define pb push_back
#define all(a) a.begin(),a.end()
#define rep(i,start,end) for(ll i=start;i<(ll)(end);i++)
#define per(i,start,end) for(ll i=start;i>=(ll)(end);i--)

vll ans(int n){
  if(n==3){
    return {3,4,8};
  }

  vll res(n),v=ans(n-1);
  res[0]=v[0]*2-1;
  rep(i,1,n){
    res[i]=v[i-1]*2;
  }

  return res;
}

int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);

  int n;
  cin>>n;

  vll r=ans(n);
  rep(i,0,n){
    cout<<r[i]<<" ";
  }
  cout<<endl;
}
0