結果

問題 No.63 ポッキーゲーム
ユーザー oyafusooyafuso
提出日時 2019-03-11 18:05:28
言語 Java21
(openjdk 21)
結果
AC  
実行時間 367 ms / 5,000 ms
コード長 788 bytes
コンパイル時間 2,127 ms
コンパイル使用メモリ 72,048 KB
実行使用メモリ 57,640 KB
最終ジャッジ日時 2023-09-05 20:14:36
合計ジャッジ時間 6,508 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
55,584 KB
testcase_01 AC 120 ms
55,844 KB
testcase_02 AC 120 ms
55,648 KB
testcase_03 AC 120 ms
55,908 KB
testcase_04 AC 122 ms
55,560 KB
testcase_05 AC 122 ms
55,652 KB
testcase_06 AC 120 ms
56,364 KB
testcase_07 AC 123 ms
55,788 KB
testcase_08 AC 122 ms
57,640 KB
testcase_09 AC 126 ms
55,424 KB
testcase_10 AC 130 ms
55,692 KB
testcase_11 AC 367 ms
55,444 KB
testcase_12 AC 128 ms
55,772 KB
testcase_13 AC 358 ms
55,412 KB
testcase_14 AC 131 ms
55,876 KB
testcase_15 AC 127 ms
55,576 KB
testcase_16 AC 124 ms
55,720 KB
testcase_17 AC 347 ms
54,164 KB
testcase_18 AC 125 ms
55,772 KB
testcase_19 AC 156 ms
55,724 KB
testcase_20 AC 129 ms
55,748 KB
testcase_21 AC 135 ms
56,280 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

class Main {

	private static final String SPLIT_STR = " ";

	public static void main(String[] args) {
		// Scanner生成
		Scanner sc = new Scanner(System.in);
		// 入力設定
		String input = sc.nextLine();
		String[] split = input.split(SPLIT_STR);
		List<Integer> numList = new ArrayList<>(split.length);
		for (int i = 0; i < split.length; i++) {
			numList.add(Integer.parseInt(split[i]));
		}
		// Scannerクローズ
		sc.close();

		/* メイン処理開始 */
		// 変数初期化
		int result = 0;
		int L = numList.get(0);
		int K = numList.get(1);
		int remain = L;
		int count = 0;
		// 結果設定
		while ((L -= K * 2) > 0) {
			count++;
		}
		result = K * count;
		/* メイン処理終了 */

		// 結果出力
		System.out.println(result);
	}
}
0