結果

問題 No.598 オーバーフローファンタジー
ユーザー tenten
提出日時 2020-09-06 16:26:10
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 346 bytes
コンパイル時間 2,253 ms
コンパイル使用メモリ 74,976 KB
実行使用メモリ 41,736 KB
最終ジャッジ日時 2024-11-29 07:16:09
合計ジャッジ時間 7,891 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 24 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

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