結果

問題 No.63 ポッキーゲーム
ユーザー YukimotoPGYukimotoPG
提出日時 2019-02-14 23:18:39
言語 Java21
(openjdk 21)
結果
AC  
実行時間 126 ms / 5,000 ms
コード長 294 bytes
コンパイル時間 3,495 ms
コンパイル使用メモリ 71,428 KB
実行使用メモリ 56,184 KB
最終ジャッジ日時 2023-10-11 12:47:47
合計ジャッジ時間 6,368 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
55,868 KB
testcase_01 AC 122 ms
55,640 KB
testcase_02 AC 121 ms
55,740 KB
testcase_03 AC 123 ms
55,700 KB
testcase_04 AC 122 ms
55,276 KB
testcase_05 AC 121 ms
55,880 KB
testcase_06 AC 120 ms
55,708 KB
testcase_07 AC 120 ms
56,000 KB
testcase_08 AC 120 ms
56,004 KB
testcase_09 AC 120 ms
56,012 KB
testcase_10 AC 121 ms
55,688 KB
testcase_11 AC 126 ms
56,004 KB
testcase_12 AC 121 ms
53,440 KB
testcase_13 AC 123 ms
55,704 KB
testcase_14 AC 119 ms
56,072 KB
testcase_15 AC 120 ms
56,184 KB
testcase_16 AC 121 ms
55,676 KB
testcase_17 AC 120 ms
55,584 KB
testcase_18 AC 121 ms
56,080 KB
testcase_19 AC 121 ms
56,124 KB
testcase_20 AC 124 ms
56,068 KB
testcase_21 AC 120 ms
55,664 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		
		int l = sc.nextInt(); int k = sc.nextInt();
		if (l%(2*k) == 0) {
			System.out.println((l/(2*k)-1)*k);
		}
		else {
			System.out.println(l/(2*k)*k);
		}
		
		
		
	}
}
0