結果

問題 No.598 オーバーフローファンタジー
ユーザー 夕叢霧香(ゆうむらきりか)夕叢霧香(ゆうむらきりか)
提出日時 2017-11-24 22:28:41
言語 Java21
(openjdk 21)
結果
AC  
実行時間 122 ms / 2,000 ms
コード長 366 bytes
コンパイル時間 1,804 ms
コンパイル使用メモリ 72,008 KB
実行使用メモリ 56,360 KB
最終ジャッジ日時 2023-08-26 22:22:22
合計ジャッジ時間 6,738 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
55,608 KB
testcase_01 AC 116 ms
55,908 KB
testcase_02 AC 116 ms
55,356 KB
testcase_03 AC 115 ms
56,016 KB
testcase_04 AC 116 ms
55,648 KB
testcase_05 AC 121 ms
55,816 KB
testcase_06 AC 119 ms
55,556 KB
testcase_07 AC 116 ms
55,764 KB
testcase_08 AC 118 ms
55,348 KB
testcase_09 AC 119 ms
56,228 KB
testcase_10 AC 121 ms
55,808 KB
testcase_11 AC 119 ms
56,092 KB
testcase_12 AC 118 ms
55,984 KB
testcase_13 AC 119 ms
55,892 KB
testcase_14 AC 117 ms
55,988 KB
testcase_15 AC 122 ms
55,760 KB
testcase_16 AC 116 ms
55,852 KB
testcase_17 AC 116 ms
55,776 KB
testcase_18 AC 115 ms
56,360 KB
testcase_19 AC 116 ms
55,744 KB
testcase_20 AC 116 ms
55,644 KB
testcase_21 AC 118 ms
55,584 KB
testcase_22 AC 120 ms
55,700 KB
testcase_23 AC 121 ms
55,596 KB
testcase_24 AC 118 ms
56,024 KB
testcase_25 AC 119 ms
55,980 KB
testcase_26 AC 118 ms
56,040 KB
testcase_27 AC 121 ms
55,520 KB
testcase_28 AC 120 ms
56,212 KB
testcase_29 AC 120 ms
55,988 KB
testcase_30 AC 117 ms
55,860 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n=scan.nextInt();
        long x=scan.nextLong();
        long a=scan.nextLong();
        long b=scan.nextLong();
        long mi=(x+a-1)/a;
        mi=Math.min(mi,((1L<<(n-1))-x+b-1)/b);
        System.out.println(mi);
    }
}
0