結果

問題 No.598 オーバーフローファンタジー
ユーザー Pump0129Pump0129
提出日時 2018-11-28 01:07:40
言語 Java21
(openjdk 21)
結果
AC  
実行時間 148 ms / 2,000 ms
コード長 807 bytes
コンパイル時間 2,111 ms
コンパイル使用メモリ 71,976 KB
実行使用メモリ 56,068 KB
最終ジャッジ日時 2023-09-07 04:05:04
合計ジャッジ時間 8,138 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
55,600 KB
testcase_01 AC 125 ms
55,756 KB
testcase_02 AC 125 ms
55,752 KB
testcase_03 AC 126 ms
55,776 KB
testcase_04 AC 127 ms
55,696 KB
testcase_05 AC 123 ms
56,004 KB
testcase_06 AC 124 ms
55,816 KB
testcase_07 AC 124 ms
55,780 KB
testcase_08 AC 124 ms
55,604 KB
testcase_09 AC 125 ms
55,888 KB
testcase_10 AC 124 ms
55,880 KB
testcase_11 AC 127 ms
55,860 KB
testcase_12 AC 124 ms
55,568 KB
testcase_13 AC 125 ms
55,988 KB
testcase_14 AC 125 ms
56,068 KB
testcase_15 AC 125 ms
55,600 KB
testcase_16 AC 124 ms
55,760 KB
testcase_17 AC 126 ms
55,860 KB
testcase_18 AC 148 ms
55,756 KB
testcase_19 AC 123 ms
55,992 KB
testcase_20 AC 123 ms
55,664 KB
testcase_21 AC 125 ms
55,928 KB
testcase_22 AC 123 ms
55,888 KB
testcase_23 AC 126 ms
56,000 KB
testcase_24 AC 123 ms
56,008 KB
testcase_25 AC 122 ms
55,460 KB
testcase_26 AC 122 ms
55,708 KB
testcase_27 AC 123 ms
55,936 KB
testcase_28 AC 124 ms
55,760 KB
testcase_29 AC 124 ms
55,880 KB
testcase_30 AC 124 ms
56,040 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package net.ipipip0129.yukicoder.no598;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        long bit_len = Long.parseLong(scan.nextLine());
        long enemy_hp = Long.parseLong(scan.nextLine());
        long attack_point = Long.parseLong(scan.nextLine());
        long heal_point = Long.parseLong(scan.nextLine());

        long overflow_point = (long) (Math.pow(2,bit_len - 1) - enemy_hp);

        long attack_cnt = enemy_hp / attack_point;
        if (enemy_hp % attack_point != 0) attack_cnt += 1;

        long heal_cnt = overflow_point / heal_point;
        if (overflow_point % heal_point != 0) heal_cnt += 1;

        System.out.println(Math.min(attack_cnt, heal_cnt));
    }
}
0