結果

問題 No.63 ポッキーゲーム
ユーザー gomagoma
提出日時 2017-09-23 13:56:15
言語 Java21
(openjdk 21)
結果
AC  
実行時間 363 ms / 5,000 ms
コード長 306 bytes
コンパイル時間 1,909 ms
コンパイル使用メモリ 72,232 KB
実行使用メモリ 58,032 KB
最終ジャッジ日時 2023-08-25 19:43:30
合計ジャッジ時間 6,688 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
55,704 KB
testcase_01 AC 120 ms
55,384 KB
testcase_02 AC 121 ms
55,940 KB
testcase_03 AC 120 ms
55,424 KB
testcase_04 AC 122 ms
56,152 KB
testcase_05 AC 119 ms
55,744 KB
testcase_06 AC 122 ms
55,672 KB
testcase_07 AC 123 ms
55,604 KB
testcase_08 AC 124 ms
55,436 KB
testcase_09 AC 126 ms
55,500 KB
testcase_10 AC 131 ms
55,772 KB
testcase_11 AC 363 ms
55,932 KB
testcase_12 AC 133 ms
55,816 KB
testcase_13 AC 363 ms
58,032 KB
testcase_14 AC 130 ms
55,844 KB
testcase_15 AC 130 ms
55,680 KB
testcase_16 AC 128 ms
55,784 KB
testcase_17 AC 347 ms
55,760 KB
testcase_18 AC 128 ms
55,548 KB
testcase_19 AC 157 ms
55,536 KB
testcase_20 AC 128 ms
55,544 KB
testcase_21 AC 136 ms
56,212 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int l = sc.nextInt();
		int k = sc.nextInt();
		int count = 0, ans = 0;
		while (l > 2 * k) {
			l -= 2 * k;
			count++;
		}
		ans = count * k;
		System.out.println(ans);
	}
}
0