結果
問題 | No.2227 King Kraken's Attack |
ユーザー | tenten |
提出日時 | 2023-07-26 16:18:22 |
言語 | Java21 (openjdk 21) |
結果 |
WA
|
実行時間 | - |
コード長 | 2,129 bytes |
コンパイル時間 | 2,495 ms |
コンパイル使用メモリ | 91,376 KB |
実行使用メモリ | 38,368 KB |
最終ジャッジ日時 | 2024-10-03 03:19:05 |
合計ジャッジ時間 | 6,960 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 51 ms
37,104 KB |
testcase_01 | AC | 50 ms
36,832 KB |
testcase_02 | WA | - |
testcase_03 | AC | 55 ms
37,164 KB |
testcase_04 | AC | 51 ms
37,236 KB |
testcase_05 | AC | 51 ms
37,196 KB |
testcase_06 | AC | 54 ms
36,916 KB |
testcase_07 | AC | 52 ms
37,136 KB |
testcase_08 | AC | 53 ms
37,232 KB |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | AC | 52 ms
37,104 KB |
testcase_12 | AC | 50 ms
37,312 KB |
testcase_13 | AC | 52 ms
36,932 KB |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | AC | 66 ms
38,368 KB |
testcase_20 | AC | 70 ms
37,944 KB |
testcase_21 | AC | 84 ms
38,212 KB |
testcase_22 | AC | 65 ms
38,096 KB |
testcase_23 | AC | 63 ms
37,700 KB |
testcase_24 | AC | 92 ms
38,228 KB |
testcase_25 | WA | - |
testcase_26 | WA | - |
testcase_27 | WA | - |
testcase_28 | AC | 73 ms
38,352 KB |
testcase_29 | AC | 68 ms
37,936 KB |
testcase_30 | AC | 91 ms
37,736 KB |
testcase_31 | AC | 70 ms
37,916 KB |
testcase_32 | AC | 67 ms
37,976 KB |
testcase_33 | AC | 66 ms
37,724 KB |
testcase_34 | AC | 67 ms
37,452 KB |
testcase_35 | AC | 66 ms
37,664 KB |
testcase_36 | AC | 64 ms
37,912 KB |
testcase_37 | AC | 49 ms
37,108 KB |
testcase_38 | AC | 49 ms
37,188 KB |
testcase_39 | AC | 50 ms
36,824 KB |
testcase_40 | AC | 50 ms
37,056 KB |
testcase_41 | AC | 50 ms
37,280 KB |
testcase_42 | AC | 50 ms
37,204 KB |
testcase_43 | AC | 51 ms
37,236 KB |
testcase_44 | AC | 50 ms
37,228 KB |
testcase_45 | AC | 53 ms
37,204 KB |
ソースコード
import java.io.*; import java.util.*; import java.util.stream.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(); int h = sc.nextInt(); int w = sc.nextInt(); int la = sc.nextInt(); int lb = sc.nextInt(); long ka = sc.nextLong(); long kb = sc.nextLong(); int left = 0; int right = 1000000; while (right - left > 1) { int m = (left + right) / 2; boolean enable = false; for (long a = 0; a <= m && !enable; a++) { long b = m - a; enable = (Math.max(0, h - a * la) * w + Math.max(0, w - b * lb) * h <= ka * a + kb * b); } if (enable) { right = m; } else { left = m; } } System.out.println(right); } } class Utilities { static String arrayToLineString(Object[] arr) { return Arrays.stream(arr).map(x -> x.toString()).collect(Collectors.joining("\n")); } static String arrayToLineString(int[] arr) { return String.join("\n", Arrays.stream(arr).mapToObj(String::valueOf).toArray(String[]::new)); } } class Scanner { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(""); StringBuilder sb = new StringBuilder(); public Scanner() throws Exception { } public int nextInt() throws Exception { return Integer.parseInt(next()); } public long nextLong() throws Exception { return Long.parseLong(next()); } public double nextDouble() throws Exception { return Double.parseDouble(next()); } public int[] nextIntArray() throws Exception { return Stream.of(br.readLine().split(" ")).mapToInt(Integer::parseInt).toArray(); } public String next() throws Exception { while (!st.hasMoreTokens()) { st = new StringTokenizer(br.readLine()); } return st.nextToken(); } }