結果

問題 No.63 ポッキーゲーム
ユーザー jonki324jonki324
提出日時 2018-06-04 11:27:00
言語 Java21
(openjdk 21)
結果
AC  
実行時間 361 ms / 5,000 ms
コード長 441 bytes
コンパイル時間 2,090 ms
コンパイル使用メモリ 71,912 KB
実行使用メモリ 56,228 KB
最終ジャッジ日時 2023-09-12 22:04:13
合計ジャッジ時間 7,172 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,932 KB
testcase_01 AC 123 ms
56,228 KB
testcase_02 AC 124 ms
55,840 KB
testcase_03 AC 124 ms
55,572 KB
testcase_04 AC 124 ms
55,868 KB
testcase_05 AC 123 ms
55,568 KB
testcase_06 AC 123 ms
55,832 KB
testcase_07 AC 125 ms
55,744 KB
testcase_08 AC 123 ms
56,064 KB
testcase_09 AC 123 ms
55,828 KB
testcase_10 AC 127 ms
56,140 KB
testcase_11 AC 358 ms
55,668 KB
testcase_12 AC 131 ms
55,968 KB
testcase_13 AC 361 ms
55,688 KB
testcase_14 AC 130 ms
55,904 KB
testcase_15 AC 131 ms
56,072 KB
testcase_16 AC 126 ms
55,976 KB
testcase_17 AC 345 ms
56,036 KB
testcase_18 AC 125 ms
55,984 KB
testcase_19 AC 157 ms
55,568 KB
testcase_20 AC 128 ms
55,820 KB
testcase_21 AC 135 ms
56,148 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int l = scan.nextInt();
        int k = scan.nextInt();
        int c = 0;
        while (true) {
            l -= 2 * k;
            if (l <= 0) {
                break;
            } else {
                c++;
            }
        }
        System.out.println(c * k);
        scan.close();
    }
}
0