結果

問題 No.2609 Decreasing GCDs
ユーザー t98slider
提出日時 2024-01-21 11:58:14
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 434 bytes
コンパイル時間 1,492 ms
コンパイル使用メモリ 167,440 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-09-28 06:13:44
合計ジャッジ時間 6,787 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other WA * 16 TLE * 1 -- * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    vector<int> ans(n);
    for(int i = 0; i < n; i++){
        ans[i] = 1 << (n - 1 - i);
        ans[i] *= i + 1;
    }
    ans[0] /= 2;
    for(int i = 0; i < n; i++){
        while(i >= 1 && ans[i - 1] > ans[i]) ans[i] *= i & 1 ? 2 : 3;
        cout << ans[i] << (i + 1 == n ? '\n' : ' ');
    }
}
0