結果

問題 No.478 一般門松列列
ユーザー fal_rndfal_rnd
提出日時 2017-01-27 22:41:11
言語 Java19
(openjdk 21)
結果
AC  
実行時間 198 ms / 2,000 ms
コード長 475 bytes
コンパイル時間 4,437 ms
コンパイル使用メモリ 75,596 KB
実行使用メモリ 59,728 KB
最終ジャッジ日時 2023-08-25 04:15:00
合計ジャッジ時間 11,117 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
55,776 KB
testcase_01 AC 120 ms
55,716 KB
testcase_02 AC 120 ms
55,508 KB
testcase_03 AC 122 ms
53,700 KB
testcase_04 AC 120 ms
55,740 KB
testcase_05 AC 123 ms
56,160 KB
testcase_06 AC 121 ms
55,652 KB
testcase_07 AC 120 ms
56,224 KB
testcase_08 AC 120 ms
55,836 KB
testcase_09 AC 119 ms
55,908 KB
testcase_10 AC 123 ms
55,872 KB
testcase_11 AC 197 ms
59,400 KB
testcase_12 AC 192 ms
59,620 KB
testcase_13 AC 192 ms
59,496 KB
testcase_14 AC 198 ms
58,964 KB
testcase_15 AC 194 ms
59,128 KB
testcase_16 AC 170 ms
57,012 KB
testcase_17 AC 193 ms
59,728 KB
testcase_18 AC 181 ms
59,052 KB
testcase_19 AC 196 ms
59,660 KB
testcase_20 AC 192 ms
59,044 KB
testcase_21 AC 188 ms
59,156 KB
testcase_22 AC 181 ms
58,640 KB
testcase_23 AC 177 ms
58,748 KB
testcase_24 AC 187 ms
59,392 KB
testcase_25 AC 196 ms
59,308 KB
testcase_26 AC 168 ms
54,732 KB
testcase_27 AC 171 ms
56,716 KB
testcase_28 AC 165 ms
56,872 KB
testcase_29 AC 164 ms
56,936 KB
testcase_30 AC 182 ms
59,192 KB
testcase_31 AC 176 ms
58,820 KB
testcase_32 AC 173 ms
56,860 KB
testcase_33 AC 176 ms
56,692 KB
権限があれば一括ダウンロードができます

ソースコード

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).replaceAll("[\\[\\] ]", "").replaceAll(",", " "));
	}
}
0