結果

問題 No.63 ポッキーゲーム
ユーザー l1267976l1267976
提出日時 2017-03-15 23:23:15
言語 Java21
(openjdk 21)
結果
AC  
実行時間 361 ms / 5,000 ms
コード長 435 bytes
コンパイル時間 2,987 ms
コンパイル使用メモリ 73,124 KB
実行使用メモリ 56,068 KB
最終ジャッジ日時 2023-08-25 19:23:10
合計ジャッジ時間 7,493 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
55,980 KB
testcase_01 AC 120 ms
56,024 KB
testcase_02 AC 120 ms
55,840 KB
testcase_03 AC 119 ms
55,396 KB
testcase_04 AC 118 ms
55,672 KB
testcase_05 AC 119 ms
55,688 KB
testcase_06 AC 119 ms
55,860 KB
testcase_07 AC 121 ms
55,984 KB
testcase_08 AC 119 ms
55,908 KB
testcase_09 AC 122 ms
55,716 KB
testcase_10 AC 125 ms
56,068 KB
testcase_11 AC 358 ms
55,520 KB
testcase_12 AC 126 ms
55,692 KB
testcase_13 AC 361 ms
55,432 KB
testcase_14 AC 126 ms
53,864 KB
testcase_15 AC 126 ms
55,668 KB
testcase_16 AC 124 ms
55,732 KB
testcase_17 AC 344 ms
56,016 KB
testcase_18 AC 124 ms
55,936 KB
testcase_19 AC 154 ms
55,664 KB
testcase_20 AC 126 ms
55,772 KB
testcase_21 AC 133 ms
55,804 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();

        int remain = l;
        int cnt = 0;

        while (remain > 0) {
            remain -= 2 * k;
            cnt++;
        }

        int result = k * (cnt - 1);
        System.out.println(result);

        sc.close();
    }

}
0