結果
問題 | No.2962 Sum Bomb Bomber |
ユーザー | tenten |
提出日時 | 2024-11-18 16:08:43 |
言語 | Java21 (openjdk 21) |
結果 |
AC
|
実行時間 | 260 ms / 2,000 ms |
コード長 | 2,351 bytes |
コンパイル時間 | 3,092 ms |
コンパイル使用メモリ | 78,976 KB |
実行使用メモリ | 57,664 KB |
平均クエリ数 | 189.09 |
最終ジャッジ日時 | 2024-11-18 16:09:09 |
合計ジャッジ時間 | 22,271 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 212 ms
57,332 KB |
testcase_01 | AC | 226 ms
57,152 KB |
testcase_02 | AC | 244 ms
57,324 KB |
testcase_03 | AC | 223 ms
57,176 KB |
testcase_04 | AC | 237 ms
56,816 KB |
testcase_05 | AC | 242 ms
57,076 KB |
testcase_06 | AC | 214 ms
57,392 KB |
testcase_07 | AC | 260 ms
57,368 KB |
testcase_08 | AC | 226 ms
57,308 KB |
testcase_09 | AC | 226 ms
56,952 KB |
testcase_10 | AC | 226 ms
55,540 KB |
testcase_11 | AC | 233 ms
56,308 KB |
testcase_12 | AC | 253 ms
56,832 KB |
testcase_13 | AC | 219 ms
57,284 KB |
testcase_14 | AC | 222 ms
56,920 KB |
testcase_15 | AC | 216 ms
57,152 KB |
testcase_16 | AC | 251 ms
56,832 KB |
testcase_17 | AC | 227 ms
57,024 KB |
testcase_18 | AC | 235 ms
56,784 KB |
testcase_19 | AC | 225 ms
57,360 KB |
testcase_20 | AC | 227 ms
57,348 KB |
testcase_21 | AC | 243 ms
57,440 KB |
testcase_22 | AC | 221 ms
57,056 KB |
testcase_23 | AC | 227 ms
57,216 KB |
testcase_24 | AC | 230 ms
56,832 KB |
testcase_25 | AC | 218 ms
57,396 KB |
testcase_26 | AC | 228 ms
56,956 KB |
testcase_27 | AC | 224 ms
57,448 KB |
testcase_28 | AC | 222 ms
56,424 KB |
testcase_29 | AC | 225 ms
57,004 KB |
testcase_30 | AC | 248 ms
57,052 KB |
testcase_31 | AC | 213 ms
57,496 KB |
testcase_32 | AC | 229 ms
57,180 KB |
testcase_33 | AC | 237 ms
56,692 KB |
testcase_34 | AC | 223 ms
57,068 KB |
testcase_35 | AC | 221 ms
56,952 KB |
testcase_36 | AC | 225 ms
56,572 KB |
testcase_37 | AC | 229 ms
57,496 KB |
testcase_38 | AC | 233 ms
57,256 KB |
testcase_39 | AC | 240 ms
57,204 KB |
testcase_40 | AC | 235 ms
57,204 KB |
testcase_41 | AC | 220 ms
56,564 KB |
testcase_42 | AC | 228 ms
57,144 KB |
testcase_43 | AC | 216 ms
57,592 KB |
testcase_44 | AC | 225 ms
56,948 KB |
testcase_45 | AC | 228 ms
57,156 KB |
testcase_46 | AC | 224 ms
57,356 KB |
testcase_47 | AC | 225 ms
57,388 KB |
testcase_48 | AC | 234 ms
57,092 KB |
testcase_49 | AC | 220 ms
57,144 KB |
testcase_50 | AC | 219 ms
57,188 KB |
testcase_51 | AC | 213 ms
57,020 KB |
testcase_52 | AC | 233 ms
57,268 KB |
testcase_53 | AC | 208 ms
57,408 KB |
testcase_54 | AC | 209 ms
57,192 KB |
testcase_55 | AC | 223 ms
56,856 KB |
testcase_56 | AC | 217 ms
57,024 KB |
testcase_57 | AC | 234 ms
57,008 KB |
testcase_58 | AC | 230 ms
56,952 KB |
testcase_59 | AC | 227 ms
57,000 KB |
testcase_60 | AC | 221 ms
57,236 KB |
testcase_61 | AC | 221 ms
57,076 KB |
testcase_62 | AC | 224 ms
57,664 KB |
testcase_63 | AC | 224 ms
57,348 KB |
testcase_64 | AC | 222 ms
56,800 KB |
ソースコード
import java.io.*; import java.util.*; import java.util.function.*; import java.util.stream.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(); int n = sc.nextInt(); int x = getValue(true, sc); int y = getValue(false, sc); System.out.println("2 " + x + " " + y); System.out.flush(); } static int getValue(boolean isX, Scanner sc) { int left = -100000000; int right = 100000000; while (right - left > 2) { int m1 = (left * 2 + right) / 3; int m2 = (left + right * 2) / 3; System.out.println(getQuery(m1, isX)); System.out.flush(); long r1 = sc.nextLong(); System.out.println(getQuery(m2, isX)); System.out.flush(); long r2 = sc.nextLong(); if (r1 < r2) { right = m2; } else { left = m1; } } int ans = 0; long min = Long.MAX_VALUE; for (int i = left; i <= right; i++) { System.out.println(getQuery(i, isX)); System.out.flush(); long r = sc.nextLong(); if (min > r) { min = r; ans = i; } } return ans; } static String getQuery(int value, boolean isX) { if (isX) { return "1 " + value + " 0"; } else { return "1 0 " + value; } } } class Scanner { BufferedReader br; StringTokenizer st = new StringTokenizer(""); public Scanner() { try { br = new BufferedReader(new InputStreamReader(System.in)); } catch (Exception e) { } } public int nextInt() { return Integer.parseInt(next()); } public long nextLong() { return Long.parseLong(next()); } public double nextDouble() { return Double.parseDouble(next()); } public String next() { try { while (!st.hasMoreTokens()) { st = new StringTokenizer(br.readLine()); } } catch (Exception e) { e.printStackTrace(); } finally { return st.nextToken(); } } }