結果

問題 No.478 一般門松列列
ユーザー hotpepsihotpepsi
提出日時 2017-06-02 22:31:54
言語 C++11
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 280 bytes
コンパイル時間 550 ms
コンパイル使用メモリ 54,964 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-21 22:30:54
合計ジャッジ時間 5,941 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 4 WA * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>

using namespace std;

int main(int argc, char *argv[]) {
	int n, k, s = 1;
	cin >> n >> k;
	for (int i = 0; i < k; ++i) {
		cout << " " << s;
		++s;
	}
	for (int i = k; i < n; ++i) {
		cout << " " << s;
		s += (i % 2) ? 1 : -1;
	}
	cout << endl;
	return 0;
}
0