結果

問題 No.598 オーバーフローファンタジー
ユーザー GrenacheGrenache
提出日時 2017-11-24 22:32:43
言語 Java21
(openjdk 21)
結果
AC  
実行時間 130 ms / 2,000 ms
コード長 707 bytes
コンパイル時間 3,711 ms
コンパイル使用メモリ 71,688 KB
実行使用メモリ 56,220 KB
最終ジャッジ日時 2023-08-26 22:23:22
合計ジャッジ時間 8,722 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,372 KB
testcase_01 AC 130 ms
55,904 KB
testcase_02 AC 127 ms
55,960 KB
testcase_03 AC 122 ms
55,648 KB
testcase_04 AC 117 ms
56,052 KB
testcase_05 AC 126 ms
55,980 KB
testcase_06 AC 128 ms
55,632 KB
testcase_07 AC 129 ms
55,828 KB
testcase_08 AC 128 ms
55,752 KB
testcase_09 AC 126 ms
55,812 KB
testcase_10 AC 115 ms
56,016 KB
testcase_11 AC 117 ms
55,724 KB
testcase_12 AC 116 ms
55,988 KB
testcase_13 AC 116 ms
55,972 KB
testcase_14 AC 123 ms
55,620 KB
testcase_15 AC 118 ms
55,988 KB
testcase_16 AC 116 ms
55,808 KB
testcase_17 AC 118 ms
55,688 KB
testcase_18 AC 116 ms
55,900 KB
testcase_19 AC 117 ms
56,036 KB
testcase_20 AC 115 ms
56,052 KB
testcase_21 AC 119 ms
55,904 KB
testcase_22 AC 115 ms
55,684 KB
testcase_23 AC 119 ms
55,992 KB
testcase_24 AC 119 ms
55,768 KB
testcase_25 AC 120 ms
55,960 KB
testcase_26 AC 120 ms
55,880 KB
testcase_27 AC 116 ms
56,036 KB
testcase_28 AC 120 ms
55,640 KB
testcase_29 AC 118 ms
56,140 KB
testcase_30 AC 118 ms
56,220 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;


public class Main_yukicoder598 {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		int n = sc.nextInt();
		long x = sc.nextLong();
		long a = sc.nextLong();
		long b = sc.nextLong();

		long min = (x + a - 1) / a;

		long tmp = 0x1L << (n - 1);
		min = Math.min(min, (tmp - x + b - 1) / b);

		pr.println(min);
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);

		solve();

		pr.close();
		sc.close();
	}

	private static class Printer extends PrintWriter {
		Printer(PrintStream out) {
			super(out);
		}
	}
}
0