結果

問題 No.598 オーバーフローファンタジー
ユーザー htensaihtensai
提出日時 2019-11-14 17:45:01
言語 Java21
(openjdk 21)
結果
AC  
実行時間 137 ms / 2,000 ms
コード長 362 bytes
コンパイル時間 2,150 ms
コンパイル使用メモリ 74,420 KB
実行使用メモリ 57,612 KB
最終ジャッジ日時 2023-10-21 20:00:54
合計ジャッジ時間 7,840 ms
ジャッジサーバーID
(参考情報)
judge12 / judge9
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 134 ms
57,392 KB
testcase_01 AC 134 ms
57,328 KB
testcase_02 AC 134 ms
57,420 KB
testcase_03 AC 134 ms
57,500 KB
testcase_04 AC 132 ms
57,352 KB
testcase_05 AC 132 ms
57,024 KB
testcase_06 AC 131 ms
57,288 KB
testcase_07 AC 133 ms
57,444 KB
testcase_08 AC 133 ms
57,348 KB
testcase_09 AC 135 ms
57,144 KB
testcase_10 AC 133 ms
57,568 KB
testcase_11 AC 135 ms
57,424 KB
testcase_12 AC 133 ms
57,320 KB
testcase_13 AC 132 ms
57,416 KB
testcase_14 AC 133 ms
57,356 KB
testcase_15 AC 135 ms
57,348 KB
testcase_16 AC 133 ms
57,336 KB
testcase_17 AC 134 ms
57,328 KB
testcase_18 AC 134 ms
57,380 KB
testcase_19 AC 130 ms
57,484 KB
testcase_20 AC 132 ms
57,384 KB
testcase_21 AC 133 ms
55,300 KB
testcase_22 AC 137 ms
57,496 KB
testcase_23 AC 135 ms
57,392 KB
testcase_24 AC 134 ms
57,372 KB
testcase_25 AC 133 ms
57,360 KB
testcase_26 AC 133 ms
57,600 KB
testcase_27 AC 134 ms
57,612 KB
testcase_28 AC 132 ms
57,328 KB
testcase_29 AC 132 ms
55,396 KB
testcase_30 AC 134 ms
57,372 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

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