結果

問題 No.478 一般門松列列
ユーザー suibaka_ku
提出日時 2017-03-20 20:30:53
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 387 bytes
コンパイル時間 546 ms
コンパイル使用メモリ 68,636 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-07-05 03:32:28
合計ジャッジ時間 6,383 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 4 WA * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
using namespace std;

int main() {
    int n, k;
    cin >> n >> k;
    vector<int> res(n);
    res[0] = 0;
    for(int i=1; i<n; ++i) {
        if(k-- > 0) {
            res[i] = res[i-1];
        } else {
            res[i] = (res[i-1]+1)%2;
        }
    }
    for(int i=0; i<n; ++i) {
        cout << res[i] << " \n"[i == n-1] << flush;
    }
}
0