結果

問題 No.63 ポッキーゲーム
ユーザー haru66nylonharu66nylon
提出日時 2019-02-27 22:37:41
言語 Java21
(openjdk 21)
結果
AC  
実行時間 364 ms / 5,000 ms
コード長 378 bytes
コンパイル時間 3,329 ms
コンパイル使用メモリ 72,288 KB
実行使用メモリ 58,096 KB
最終ジャッジ日時 2023-09-05 09:28:42
合計ジャッジ時間 6,916 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
56,064 KB
testcase_01 AC 126 ms
55,740 KB
testcase_02 AC 125 ms
55,828 KB
testcase_03 AC 125 ms
55,468 KB
testcase_04 AC 123 ms
55,944 KB
testcase_05 AC 127 ms
55,472 KB
testcase_06 AC 127 ms
56,016 KB
testcase_07 AC 126 ms
55,500 KB
testcase_08 AC 126 ms
56,096 KB
testcase_09 AC 130 ms
56,104 KB
testcase_10 AC 129 ms
55,888 KB
testcase_11 AC 361 ms
55,888 KB
testcase_12 AC 133 ms
56,236 KB
testcase_13 AC 364 ms
55,504 KB
testcase_14 AC 133 ms
55,772 KB
testcase_15 AC 131 ms
56,056 KB
testcase_16 AC 128 ms
58,096 KB
testcase_17 AC 347 ms
55,628 KB
testcase_18 AC 127 ms
55,632 KB
testcase_19 AC 159 ms
56,120 KB
testcase_20 AC 131 ms
55,468 KB
testcase_21 AC 137 ms
55,516 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;
        
        while(l > (2 * k)){
            l = l - k * 2;
            count++;
        }
        
        System.out.println(k * count);
    }
}
0