結果

問題 No.63 ポッキーゲーム
ユーザー kuramubonnkuramubonn
提出日時 2023-02-01 21:38:59
言語 Java21
(openjdk 21)
結果
AC  
実行時間 128 ms / 5,000 ms
コード長 287 bytes
コンパイル時間 1,991 ms
コンパイル使用メモリ 71,848 KB
実行使用メモリ 56,324 KB
最終ジャッジ日時 2023-09-14 07:24:32
合計ジャッジ時間 6,293 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
55,792 KB
testcase_01 AC 124 ms
55,920 KB
testcase_02 AC 127 ms
55,448 KB
testcase_03 AC 124 ms
55,672 KB
testcase_04 AC 126 ms
55,620 KB
testcase_05 AC 125 ms
55,864 KB
testcase_06 AC 125 ms
55,692 KB
testcase_07 AC 124 ms
56,116 KB
testcase_08 AC 122 ms
56,112 KB
testcase_09 AC 124 ms
56,080 KB
testcase_10 AC 126 ms
55,740 KB
testcase_11 AC 124 ms
54,080 KB
testcase_12 AC 125 ms
55,444 KB
testcase_13 AC 125 ms
56,324 KB
testcase_14 AC 126 ms
53,644 KB
testcase_15 AC 125 ms
55,888 KB
testcase_16 AC 124 ms
55,804 KB
testcase_17 AC 125 ms
55,808 KB
testcase_18 AC 125 ms
55,972 KB
testcase_19 AC 127 ms
55,864 KB
testcase_20 AC 127 ms
55,768 KB
testcase_21 AC 128 ms
55,800 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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