結果

問題 No.63 ポッキーゲーム
ユーザー face4face4
提出日時 2018-04-10 11:24:41
言語 Java21
(openjdk 21)
結果
AC  
実行時間 43 ms / 5,000 ms
コード長 622 bytes
コンパイル時間 2,211 ms
コンパイル使用メモリ 71,496 KB
実行使用メモリ 49,640 KB
最終ジャッジ日時 2023-09-09 03:45:26
合計ジャッジ時間 4,094 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
49,516 KB
testcase_01 AC 43 ms
49,508 KB
testcase_02 AC 42 ms
47,728 KB
testcase_03 AC 42 ms
49,560 KB
testcase_04 AC 42 ms
49,340 KB
testcase_05 AC 43 ms
49,640 KB
testcase_06 AC 40 ms
49,212 KB
testcase_07 AC 41 ms
49,388 KB
testcase_08 AC 42 ms
49,240 KB
testcase_09 AC 42 ms
49,364 KB
testcase_10 AC 41 ms
49,236 KB
testcase_11 AC 42 ms
49,492 KB
testcase_12 AC 41 ms
49,224 KB
testcase_13 AC 42 ms
49,456 KB
testcase_14 AC 42 ms
49,484 KB
testcase_15 AC 42 ms
49,396 KB
testcase_16 AC 41 ms
49,224 KB
testcase_17 AC 43 ms
47,732 KB
testcase_18 AC 42 ms
49,256 KB
testcase_19 AC 41 ms
49,364 KB
testcase_20 AC 41 ms
49,404 KB
testcase_21 AC 42 ms
49,296 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;

class Main{
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] input = br.readLine().split(" ");
        int l = Integer.parseInt(input[0]);
        int k = Integer.parseInt(input[1]);
        /*
        int ans = 0;  
        while(l > 2*k){ 
            ans += k;
            l -= 2*k;
        }
        */
        int ans = l / (2*k) * k;
        if(l%(2*k) == 0) ans -= k;
        System.out.println(ans);
    }
}
0