結果

問題 No.478 一般門松列列
ユーザー tanzakutanzaku
提出日時 2017-01-27 22:29:30
言語 Java21
(openjdk 21)
結果
AC  
実行時間 349 ms / 2,000 ms
コード長 811 bytes
コンパイル時間 5,449 ms
コンパイル使用メモリ 76,884 KB
実行使用メモリ 64,952 KB
最終ジャッジ日時 2023-08-25 04:00:51
合計ジャッジ時間 14,654 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 134 ms
55,608 KB
testcase_01 AC 138 ms
56,268 KB
testcase_02 AC 137 ms
55,600 KB
testcase_03 AC 138 ms
55,884 KB
testcase_04 AC 134 ms
56,380 KB
testcase_05 AC 138 ms
55,756 KB
testcase_06 AC 136 ms
46,552 KB
testcase_07 AC 133 ms
39,964 KB
testcase_08 AC 134 ms
39,804 KB
testcase_09 AC 134 ms
40,212 KB
testcase_10 AC 136 ms
39,956 KB
testcase_11 AC 349 ms
48,308 KB
testcase_12 AC 345 ms
48,436 KB
testcase_13 AC 346 ms
64,880 KB
testcase_14 AC 345 ms
64,952 KB
testcase_15 AC 335 ms
54,540 KB
testcase_16 AC 277 ms
44,868 KB
testcase_17 AC 328 ms
48,112 KB
testcase_18 AC 293 ms
46,068 KB
testcase_19 AC 341 ms
48,544 KB
testcase_20 AC 319 ms
48,484 KB
testcase_21 AC 299 ms
47,020 KB
testcase_22 AC 282 ms
45,312 KB
testcase_23 AC 288 ms
44,204 KB
testcase_24 AC 296 ms
46,680 KB
testcase_25 AC 318 ms
48,108 KB
testcase_26 AC 191 ms
40,056 KB
testcase_27 AC 206 ms
40,368 KB
testcase_28 AC 194 ms
40,344 KB
testcase_29 AC 194 ms
39,892 KB
testcase_30 AC 283 ms
45,500 KB
testcase_31 AC 269 ms
43,912 KB
testcase_32 AC 266 ms
44,768 KB
testcase_33 AC 267 ms
44,304 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

public class _478 {
	public static void main(String[] args) throws IOException {
		new _478().solve();
	}

	void solve() throws IOException {
		try (final Scanner in = new Scanner(System.in)) {
			int n = in.nextInt();
			int k = in.nextInt();
			int m = n - k - 2;
			System.out.print("0 10000000");
			int last = 10000000;
			for (int i = 0; i < m; i++) {
				int v = i % 2 == 0 ? (i+1) : 10000000-i;
				last = v;
				System.out.print(" " + v);
			}
			for (int i = m + 2; i < n; i++) {
				System.out.print(" " + last);
			}
			System.out.println();
		}
	}
	
	// for debug
	static void dump(Object... o) {
		System.err.println(Arrays.deepToString(o));
	}
}
0