結果

問題 No.478 一般門松列列
ユーザー newlife171128
提出日時 2018-01-07 11:09:24
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 648 bytes
コンパイル時間 708 ms
コンパイル使用メモリ 74,408 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-12-23 09:55:02
合計ジャッジ時間 4,446 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 12 WA * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <string>
#include <sstream>
#include <cmath>
#include <stack>
#include <cctype>
#include <stdio.h>

using namespace std;

int a[22000];

int main() {

  int n=0,k=0;
  cin>>n>>k;

  if(n-k-2 !=0){

  a[0] =1;
  a[1] =3;
  a[2] =2;
  }else {
	  for(int i=0; i<n; i++){
		  cout<<a[i]<<endl;
	  }
	  return 0;
}
  int i;
  for( i=1; i<=n-2-k;i++){
	  a[i+2] = a[i]+1;
  }
  /*cout<<i;*/
  for(int j=0; j<k; j++){
	  if(j%2 ==0){
	  a[j] = 30000;
	  }else {
		a[j] = 0;
	}
	/*  cout<<a[n-2];*/
  }

  for(int i=0; i<n; i++){
	  cout<<a[i]<<endl;
  }


	return 0;
}
0