結果

問題 No.478 一般門松列列
ユーザー ndifix
提出日時 2017-01-27 22:47:18
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 262 bytes
コンパイル時間 632 ms
コンパイル使用メモリ 56,128 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-12-23 16:34:49
合計ジャッジ時間 5,631 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 4 WA * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
int main(){
	int n, k;
	cin >> n >> k;
	int a[n]={};

	for(int i=k+1; i<n-2; i++){
		if(i%2==1) a[i]=a[i-1]-1;
		if(i%2==0) a[i]=a[i-1]+2;
	}
	for(int i=0; i<n-1; i++){
		cout << a[i] << " ";
	}
	cout << a[n-1] << endl;
}
0