結果

問題 No.598 オーバーフローファンタジー
ユーザー 37zigen37zigen
提出日時 2020-03-22 01:46:28
言語 Java21
(openjdk 21)
結果
AC  
実行時間 125 ms / 2,000 ms
コード長 625 bytes
コンパイル時間 2,100 ms
コンパイル使用メモリ 72,428 KB
実行使用メモリ 56,592 KB
最終ジャッジ日時 2023-08-25 20:01:20
合計ジャッジ時間 8,239 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
55,812 KB
testcase_01 AC 122 ms
56,004 KB
testcase_02 AC 121 ms
55,924 KB
testcase_03 AC 122 ms
56,056 KB
testcase_04 AC 124 ms
55,960 KB
testcase_05 AC 123 ms
55,924 KB
testcase_06 AC 122 ms
56,216 KB
testcase_07 AC 123 ms
56,308 KB
testcase_08 AC 121 ms
55,360 KB
testcase_09 AC 121 ms
55,848 KB
testcase_10 AC 122 ms
55,936 KB
testcase_11 AC 122 ms
56,072 KB
testcase_12 AC 120 ms
56,252 KB
testcase_13 AC 121 ms
55,704 KB
testcase_14 AC 122 ms
55,548 KB
testcase_15 AC 121 ms
56,444 KB
testcase_16 AC 121 ms
55,464 KB
testcase_17 AC 121 ms
55,856 KB
testcase_18 AC 121 ms
55,876 KB
testcase_19 AC 121 ms
56,112 KB
testcase_20 AC 120 ms
55,444 KB
testcase_21 AC 125 ms
55,716 KB
testcase_22 AC 121 ms
56,120 KB
testcase_23 AC 121 ms
56,592 KB
testcase_24 AC 122 ms
56,272 KB
testcase_25 AC 120 ms
56,004 KB
testcase_26 AC 121 ms
55,532 KB
testcase_27 AC 121 ms
56,020 KB
testcase_28 AC 120 ms
55,784 KB
testcase_29 AC 120 ms
56,324 KB
testcase_30 AC 122 ms
55,896 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.FileNotFoundException;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws FileNotFoundException {
		long t = System.currentTimeMillis();
		new Main().run();
		System.err.println(System.currentTimeMillis() - t);
	}
	
	void run() {
		Scanner sc = new Scanner(System.in);
		int N=sc.nextInt();
		long X=sc.nextLong();
		long A=sc.nextLong();
		long B=sc.nextLong();
		long ans=Math.min((X+A-1)/A,((1L<<N-1)-X+B-1)/B);
		System.out.println(ans);
	}


	static void tr(Object... objects) {
		System.out.println(Arrays.deepToString(objects));
	}

}
0