結果

問題 No.598 オーバーフローファンタジー
ユーザー uafr_csuafr_cs
提出日時 2017-11-24 22:24:24
言語 Java21
(openjdk 21)
結果
AC  
実行時間 121 ms / 2,000 ms
コード長 616 bytes
コンパイル時間 2,043 ms
コンパイル使用メモリ 71,976 KB
実行使用メモリ 56,412 KB
最終ジャッジ日時 2023-08-26 22:20:16
合計ジャッジ時間 6,909 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 116 ms
55,880 KB
testcase_01 AC 116 ms
55,564 KB
testcase_02 AC 117 ms
55,772 KB
testcase_03 AC 121 ms
55,376 KB
testcase_04 AC 118 ms
56,076 KB
testcase_05 AC 117 ms
56,092 KB
testcase_06 AC 116 ms
55,600 KB
testcase_07 AC 116 ms
55,904 KB
testcase_08 AC 118 ms
55,620 KB
testcase_09 AC 117 ms
55,740 KB
testcase_10 AC 117 ms
55,476 KB
testcase_11 AC 116 ms
55,480 KB
testcase_12 AC 118 ms
56,356 KB
testcase_13 AC 116 ms
55,964 KB
testcase_14 AC 115 ms
55,772 KB
testcase_15 AC 117 ms
55,488 KB
testcase_16 AC 117 ms
55,348 KB
testcase_17 AC 117 ms
55,696 KB
testcase_18 AC 117 ms
55,336 KB
testcase_19 AC 117 ms
55,804 KB
testcase_20 AC 118 ms
55,592 KB
testcase_21 AC 117 ms
55,820 KB
testcase_22 AC 119 ms
55,972 KB
testcase_23 AC 117 ms
56,412 KB
testcase_24 AC 118 ms
55,928 KB
testcase_25 AC 118 ms
55,548 KB
testcase_26 AC 117 ms
55,636 KB
testcase_27 AC 118 ms
56,116 KB
testcase_28 AC 119 ms
55,868 KB
testcase_29 AC 118 ms
55,864 KB
testcase_30 AC 117 ms
55,620 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Arrays;
import java.util.LinkedList;
import java.util.Scanner;

public class Main {
	
	public static long MOD = 1000000007;
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		final long N = sc.nextInt();
		
		final long X = sc.nextLong();
		final long A = sc.nextLong();
		final long B = sc.nextLong();
		
		
		final long A_time = (X + A - 1) / A;
		final long B_time = (((1l << (N - 1)) - X) + B - 1) / B;
		
		//System.out.println((1 << (N - 1)) + " " + X);
		//System.out.println(A_time + " " + B_time);
		
		System.out.println(Math.min(A_time, B_time));
	}
}
0