結果

問題 No.63 ポッキーゲーム
ユーザー ryosuke0825ryosuke0825
提出日時 2018-04-08 15:04:56
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 362 bytes
コンパイル時間 3,271 ms
コンパイル使用メモリ 72,680 KB
実行使用メモリ 56,504 KB
最終ジャッジ日時 2023-09-09 03:10:14
合計ジャッジ時間 7,110 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
56,264 KB
testcase_01 AC 119 ms
56,032 KB
testcase_02 WA -
testcase_03 AC 122 ms
55,860 KB
testcase_04 AC 119 ms
53,908 KB
testcase_05 AC 121 ms
56,504 KB
testcase_06 AC 119 ms
55,808 KB
testcase_07 AC 123 ms
55,800 KB
testcase_08 AC 121 ms
55,708 KB
testcase_09 AC 125 ms
56,000 KB
testcase_10 AC 124 ms
55,692 KB
testcase_11 AC 125 ms
55,976 KB
testcase_12 AC 122 ms
55,924 KB
testcase_13 AC 122 ms
56,100 KB
testcase_14 AC 121 ms
55,964 KB
testcase_15 AC 121 ms
55,476 KB
testcase_16 AC 121 ms
55,988 KB
testcase_17 AC 120 ms
55,912 KB
testcase_18 AC 120 ms
55,696 KB
testcase_19 AC 121 ms
56,104 KB
testcase_20 AC 120 ms
55,708 KB
testcase_21 AC 121 ms
55,720 KB
権限があれば一括ダウンロードができます

ソースコード

diff #


import java.util.Scanner;

public class No63 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int L = sc.nextInt();
		int K = sc.nextInt();

		if (L / 2 <= K) {
			System.out.println(0);
		} else if (L % (K * 2) == 0) {
			System.out.println((L / K / 2 - 1) * K);
		} else {
			System.out.println(L / K / 2 * K);
		}
	}

}
0