結果

問題 No.63 ポッキーゲーム
ユーザー Hiroaki KonoHiroaki Kono
提出日時 2017-10-26 22:27:29
言語 Java21
(openjdk 21)
結果
AC  
実行時間 122 ms / 5,000 ms
コード長 400 bytes
コンパイル時間 3,209 ms
コンパイル使用メモリ 72,420 KB
実行使用メモリ 57,832 KB
最終ジャッジ日時 2023-08-25 19:44:40
合計ジャッジ時間 6,918 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
57,832 KB
testcase_01 AC 121 ms
55,920 KB
testcase_02 AC 120 ms
55,872 KB
testcase_03 AC 120 ms
55,704 KB
testcase_04 AC 120 ms
55,684 KB
testcase_05 AC 119 ms
55,680 KB
testcase_06 AC 120 ms
56,344 KB
testcase_07 AC 118 ms
55,504 KB
testcase_08 AC 119 ms
55,640 KB
testcase_09 AC 118 ms
56,548 KB
testcase_10 AC 120 ms
55,972 KB
testcase_11 AC 119 ms
55,956 KB
testcase_12 AC 120 ms
55,912 KB
testcase_13 AC 121 ms
55,808 KB
testcase_14 AC 122 ms
55,888 KB
testcase_15 AC 120 ms
55,668 KB
testcase_16 AC 120 ms
56,008 KB
testcase_17 AC 120 ms
55,660 KB
testcase_18 AC 120 ms
55,652 KB
testcase_19 AC 121 ms
55,804 KB
testcase_20 AC 117 ms
56,256 KB
testcase_21 AC 120 ms
54,400 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class No63 {

    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int pocky = s.nextInt();
        int bite = s.nextInt();
        int eachBite = bite * 2;
        int biteTime = pocky / eachBite;
        if (pocky % eachBite == 0) {
            biteTime--;
        }
        System.out.println(biteTime * bite);
    }
}
0