結果

問題 No.598 オーバーフローファンタジー
ユーザー 夕叢霧香(ゆうむらきりか)
提出日時 2017-11-24 22:28:41
言語 Java
(openjdk 23)
結果
AC  
実行時間 142 ms / 2,000 ms
コード長 366 bytes
コンパイル時間 2,622 ms
コンパイル使用メモリ 74,064 KB
実行使用メモリ 41,704 KB
最終ジャッジ日時 2024-12-26 01:36:01
合計ジャッジ時間 6,852 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

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