結果

問題 No.598 オーバーフローファンタジー
ユーザー Mcpu3Mcpu3
提出日時 2018-09-02 13:25:47
言語 Java21
(openjdk 21)
結果
AC  
実行時間 141 ms / 2,000 ms
コード長 355 bytes
コンパイル時間 2,749 ms
コンパイル使用メモリ 74,136 KB
実行使用メモリ 57,672 KB
最終ジャッジ日時 2023-10-25 07:26:04
合計ジャッジ時間 8,178 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 137 ms
57,220 KB
testcase_01 AC 135 ms
57,216 KB
testcase_02 AC 136 ms
57,200 KB
testcase_03 AC 138 ms
57,548 KB
testcase_04 AC 138 ms
57,548 KB
testcase_05 AC 141 ms
57,180 KB
testcase_06 AC 134 ms
57,216 KB
testcase_07 AC 137 ms
57,240 KB
testcase_08 AC 135 ms
57,500 KB
testcase_09 AC 140 ms
57,580 KB
testcase_10 AC 137 ms
57,668 KB
testcase_11 AC 133 ms
57,444 KB
testcase_12 AC 137 ms
57,672 KB
testcase_13 AC 137 ms
57,512 KB
testcase_14 AC 140 ms
57,448 KB
testcase_15 AC 139 ms
57,256 KB
testcase_16 AC 135 ms
57,448 KB
testcase_17 AC 135 ms
57,464 KB
testcase_18 AC 135 ms
57,484 KB
testcase_19 AC 133 ms
57,476 KB
testcase_20 AC 139 ms
57,448 KB
testcase_21 AC 138 ms
57,480 KB
testcase_22 AC 135 ms
57,432 KB
testcase_23 AC 139 ms
57,476 KB
testcase_24 AC 133 ms
57,460 KB
testcase_25 AC 135 ms
57,180 KB
testcase_26 AC 137 ms
57,580 KB
testcase_27 AC 136 ms
57,224 KB
testcase_28 AC 136 ms
57,508 KB
testcase_29 AC 136 ms
57,504 KB
testcase_30 AC 137 ms
57,496 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class Main{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		long n=sc.nextLong(),x=sc.nextLong(),a=sc.nextLong(),b=sc.nextLong();
		sc.close();
		if((x+a-1)/a>((long)Math.pow(2, n-1)-1-x+b)/b) System.out.print(((long)Math.pow(2, n-1)-1-x+b)/b);
		else System.out.print((x+a-1)/a);
	}
}
0