結果

問題 No.478 一般門松列列
ユーザー firiexpfiriexp
提出日時 2019-03-28 18:25:57
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 4 ms / 2,000 ms
コード長 668 bytes
コンパイル時間 807 ms
コンパイル使用メモリ 91,556 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-15 19:06:02
合計ジャッジ時間 2,378 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 34
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <limits>
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>

static const int MOD = 1000000007;
using ll = int64_t;
using u32 = uint32_t;
using namespace std;

template<class T> constexpr T INF = ::numeric_limits<T>::max()/32*15+208;

int main() {
    int n, k;
    cin >> n >> k;
    vector<int> v(n);
    for (int i = 0; i < n-k; ++i) v[i] = ((i&1) == 0 ? i/2+3 : i/2+1);
    for (int i = n-k; i < n; ++i) v[i] = (((n-k-1)&1) == 0 ? (n-k-1)/2+3 : (n-k-1)/2+1);
    for (int i = 0; i < n; ++i) {
        cout << v[i] << "\n";
    }
    return 0;
}
0