結果

問題 No.63 ポッキーゲーム
ユーザー S1hoS1ho
提出日時 2017-02-20 16:04:48
言語 Java21
(openjdk 21)
結果
AC  
実行時間 360 ms / 5,000 ms
コード長 508 bytes
コンパイル時間 3,071 ms
コンパイル使用メモリ 72,732 KB
実行使用メモリ 56,604 KB
最終ジャッジ日時 2023-08-25 19:21:45
合計ジャッジ時間 7,591 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
55,636 KB
testcase_01 AC 121 ms
55,840 KB
testcase_02 AC 122 ms
56,020 KB
testcase_03 AC 123 ms
55,636 KB
testcase_04 AC 123 ms
56,076 KB
testcase_05 AC 120 ms
56,016 KB
testcase_06 AC 122 ms
55,444 KB
testcase_07 AC 123 ms
55,684 KB
testcase_08 AC 122 ms
55,648 KB
testcase_09 AC 125 ms
55,692 KB
testcase_10 AC 127 ms
56,200 KB
testcase_11 AC 359 ms
55,892 KB
testcase_12 AC 131 ms
55,896 KB
testcase_13 AC 360 ms
55,828 KB
testcase_14 AC 129 ms
55,824 KB
testcase_15 AC 129 ms
55,600 KB
testcase_16 AC 124 ms
55,720 KB
testcase_17 AC 345 ms
55,744 KB
testcase_18 AC 126 ms
55,596 KB
testcase_19 AC 156 ms
55,952 KB
testcase_20 AC 129 ms
55,644 KB
testcase_21 AC 134 ms
56,604 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class PokkyGame {

    public static void main(String[] args) {
        
        Scanner scanner = new Scanner(System.in);
        
        int l = scanner.nextInt();
        int k = scanner.nextInt();
        
        //一回で減る長さ
        int eat = k * 2;
        
        int count = 0;
        
        while((l -= eat) > 0){
            
            count++;
            
            
        }
        
        System.out.println(count * k);
        
    }
}
0