結果

問題 No.63 ポッキーゲーム
ユーザー l1267976
提出日時 2017-03-15 23:23:15
言語 Java
(openjdk 23)
結果
AC  
実行時間 549 ms / 5,000 ms
コード長 435 bytes
コンパイル時間 3,652 ms
コンパイル使用メモリ 73,900 KB
実行使用メモリ 41,316 KB
最終ジャッジ日時 2024-12-24 05:25:03
合計ジャッジ時間 9,024 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

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