結果
問題 | No.598 オーバーフローファンタジー |
ユーザー |
![]() |
提出日時 | 2018-09-26 15:00:06 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 440 bytes |
コンパイル時間 | 2,636 ms |
コンパイル使用メモリ | 77,624 KB |
実行使用メモリ | 54,320 KB |
最終ジャッジ日時 | 2024-10-10 20:33:32 |
合計ジャッジ時間 | 7,683 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 27 WA * 1 |
ソースコード
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); } }