結果

問題 No.478 一般門松列列
ユーザー fal_rnd
提出日時 2017-01-27 22:39:37
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 426 bytes
コンパイル時間 3,663 ms
コンパイル使用メモリ 75,628 KB
実行使用メモリ 56,252 KB
最終ジャッジ日時 2024-12-23 16:24:39
合計ジャッジ時間 12,836 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 34
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicodercontest155;

import java.util.*;
public class C{
	static Scanner s = new Scanner(System.in);

	static int[] ar = {1,3,2,4};

	public static void main(String[] args) {
		int n=s.nextInt(),k=s.nextInt();
		int[] kadomatsu = new int[n];
		kadomatsu[0]=1;
		for(int i=1;i<n;i++) {
			kadomatsu[i]=ar[i%4];
			if(i>n-1-k)
				kadomatsu[i]=kadomatsu[i-1];
		}
		System.out.println(Arrays.toString(kadomatsu));
	}
}
0