結果

問題 No.598 オーバーフローファンタジー
ユーザー YamaKasaYamaKasa
提出日時 2018-09-26 15:00:06
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 440 bytes
コンパイル時間 2,246 ms
コンパイル使用メモリ 74,264 KB
実行使用メモリ 41,664 KB
最終ジャッジ日時 2024-04-19 03:56:37
合計ジャッジ時間 7,930 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 139 ms
41,560 KB
testcase_01 AC 137 ms
41,320 KB
testcase_02 AC 140 ms
41,292 KB
testcase_03 AC 141 ms
41,664 KB
testcase_04 AC 141 ms
41,188 KB
testcase_05 AC 137 ms
41,240 KB
testcase_06 AC 138 ms
41,444 KB
testcase_07 AC 140 ms
41,200 KB
testcase_08 AC 136 ms
41,576 KB
testcase_09 AC 140 ms
41,200 KB
testcase_10 AC 141 ms
41,444 KB
testcase_11 AC 140 ms
41,344 KB
testcase_12 AC 140 ms
41,424 KB
testcase_13 AC 140 ms
41,244 KB
testcase_14 AC 119 ms
40,336 KB
testcase_15 AC 131 ms
41,456 KB
testcase_16 AC 130 ms
41,396 KB
testcase_17 AC 129 ms
41,180 KB
testcase_18 AC 127 ms
41,236 KB
testcase_19 AC 127 ms
41,240 KB
testcase_20 AC 119 ms
40,672 KB
testcase_21 AC 112 ms
40,032 KB
testcase_22 AC 117 ms
41,372 KB
testcase_23 WA -
testcase_24 AC 114 ms
40,336 KB
testcase_25 AC 124 ms
41,452 KB
testcase_26 AC 121 ms
41,400 KB
testcase_27 AC 126 ms
41,280 KB
testcase_28 AC 107 ms
40,056 KB
testcase_29 AC 121 ms
41,112 KB
testcase_30 AC 117 ms
41,288 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();
		int max = (int)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