結果

問題 No.598 オーバーフローファンタジー
ユーザー GrenacheGrenache
提出日時 2017-11-24 22:27:31
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 706 bytes
コンパイル時間 6,099 ms
コンパイル使用メモリ 75,432 KB
実行使用メモリ 41,488 KB
最終ジャッジ日時 2024-05-05 11:02:34
合計ジャッジ時間 8,740 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 101 ms
40,264 KB
testcase_01 AC 109 ms
41,108 KB
testcase_02 AC 104 ms
40,220 KB
testcase_03 AC 103 ms
40,176 KB
testcase_04 AC 114 ms
41,068 KB
testcase_05 AC 114 ms
41,324 KB
testcase_06 AC 114 ms
41,488 KB
testcase_07 AC 113 ms
40,324 KB
testcase_08 AC 112 ms
41,484 KB
testcase_09 AC 113 ms
41,068 KB
testcase_10 AC 112 ms
41,144 KB
testcase_11 AC 112 ms
41,152 KB
testcase_12 AC 111 ms
39,888 KB
testcase_13 WA -
testcase_14 AC 118 ms
40,476 KB
testcase_15 AC 112 ms
41,260 KB
testcase_16 AC 132 ms
41,252 KB
testcase_17 AC 114 ms
39,936 KB
testcase_18 AC 113 ms
41,280 KB
testcase_19 AC 98 ms
39,936 KB
testcase_20 AC 109 ms
40,140 KB
testcase_21 AC 116 ms
41,276 KB
testcase_22 AC 107 ms
40,904 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 125 ms
41,276 KB
testcase_26 AC 120 ms
41,072 KB
testcase_27 AC 115 ms
41,232 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
権限があれば一括ダウンロードができます

ソースコード

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 = 0x1 << (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