結果

問題 No.478 一般門松列列
ユーザー Mayimg
提出日時 2019-01-29 03:08:21
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 4 ms / 2,000 ms
コード長 421 bytes
コンパイル時間 1,550 ms
コンパイル使用メモリ 168,248 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-07 18:22:57
合計ジャッジ時間 2,946 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 34
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n, k;
	cin >> n >> k;
	vector<int> a(n);
	int b[4] = {0, 2, 1, 3};
	for (int i = 0; i <= k; i++) {
		a[i] = 1;
	}
	for (int i = k + 1; i < n; i++) {
		a[i] = b[(i - k - 1) % 4];
	}
	for (int i = 0; i < n; i++) {
		if (i > 0) cout << " ";
		cout << a[i];
	}
	cout << '\n';
	return 0;
}
0