結果

問題 No.598 オーバーフローファンタジー
ユーザー YamaKasaYamaKasa
提出日時 2018-09-26 15:03:35
言語 Java21
(openjdk 21)
結果
AC  
実行時間 135 ms / 2,000 ms
コード長 442 bytes
コンパイル時間 2,060 ms
コンパイル使用メモリ 74,080 KB
実行使用メモリ 54,540 KB
最終ジャッジ日時 2024-04-19 04:07:04
合計ジャッジ時間 7,090 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 115 ms
52,844 KB
testcase_01 AC 127 ms
54,000 KB
testcase_02 AC 124 ms
54,132 KB
testcase_03 AC 126 ms
54,292 KB
testcase_04 AC 128 ms
54,356 KB
testcase_05 AC 131 ms
54,060 KB
testcase_06 AC 132 ms
54,540 KB
testcase_07 AC 131 ms
53,992 KB
testcase_08 AC 135 ms
53,952 KB
testcase_09 AC 131 ms
53,992 KB
testcase_10 AC 131 ms
54,104 KB
testcase_11 AC 133 ms
54,236 KB
testcase_12 AC 131 ms
53,952 KB
testcase_13 AC 127 ms
54,296 KB
testcase_14 AC 126 ms
54,348 KB
testcase_15 AC 133 ms
53,888 KB
testcase_16 AC 128 ms
54,072 KB
testcase_17 AC 128 ms
54,308 KB
testcase_18 AC 128 ms
54,188 KB
testcase_19 AC 128 ms
54,264 KB
testcase_20 AC 129 ms
54,460 KB
testcase_21 AC 126 ms
53,860 KB
testcase_22 AC 127 ms
53,852 KB
testcase_23 AC 127 ms
54,420 KB
testcase_24 AC 126 ms
54,292 KB
testcase_25 AC 129 ms
54,252 KB
testcase_26 AC 128 ms
53,832 KB
testcase_27 AC 129 ms
54,332 KB
testcase_28 AC 129 ms
54,140 KB
testcase_29 AC 134 ms
54,308 KB
testcase_30 AC 129 ms
54,148 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		int X = scan.nextInt();
		int A = scan.nextInt();
		int B = scan.nextInt();
		scan.close();
		long max = (long)Math.pow(2, N - 1);
		int t1 = (int)Math.ceil((double)X / A);
		int t2 = (int)Math.ceil(((double)max - X) / B);
		int ans = Math.min(t1, t2);
		System.out.println(ans);
	}
}
0