結果
問題 | No.594 壊れた宝物発見機 |
ユーザー | takeya_okino |
提出日時 | 2019-08-31 16:44:09 |
言語 | Java21 (openjdk 21) |
結果 |
RE
|
実行時間 | - |
コード長 | 1,920 bytes |
コンパイル時間 | 2,635 ms |
コンパイル使用メモリ | 79,768 KB |
実行使用メモリ | 73,084 KB |
平均クエリ数 | 169.60 |
最終ジャッジ日時 | 2024-07-16 18:06:49 |
合計ジャッジ時間 | 10,471 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | RE | - |
testcase_01 | RE | - |
testcase_02 | WA | - |
testcase_03 | WA | - |
testcase_04 | RE | - |
testcase_05 | RE | - |
testcase_06 | RE | - |
testcase_07 | RE | - |
testcase_08 | RE | - |
testcase_09 | RE | - |
testcase_10 | RE | - |
testcase_11 | RE | - |
testcase_12 | RE | - |
testcase_13 | RE | - |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | RE | - |
testcase_18 | RE | - |
testcase_19 | RE | - |
ソースコード
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int left = -100; int right = 101; int ans1 = -100; while(left + 1 < right) { int p1 = (2 * left + right) / 3; int p2 = (left + 2 * right) / 3; System.out.println("?" + " " + p1 + " " + 0 + " " + 0); int t1 = sc.nextInt(); System.out.flush(); System.out.println("?" + " " + p2 + " " + 0 + " " + 0); int t2 = sc.nextInt(); System.out.flush(); if(t1 >= t2) { ans1 = p1; if(left == p1) break; left = p1; } else { right = p2; ans1 = p2; } } left = -100; right = 101; int ans2 = -100; while(left + 1 < right) { int p1 = (2 * left + right) / 3; int p2 = (left + 2 * right) / 3; System.out.println("?" + " " + 0 + " " + p1 + " " + 0); int t1 = sc.nextInt(); System.out.flush(); System.out.println("?" + " " + 0 + " " + p2 + " " + 0); int t2 = sc.nextInt(); System.out.flush(); if(t1 >= t2) { ans1 = p1; if(left == p1) break; left = p1; } else { right = p2; ans1 = p2; } } left = -100; right = 101; int ans3 = -100; while(left + 1 < right) { int p1 = (2 * left + right) / 3; int p2 = (left + 2 * right) / 3; System.out.println("?" + " " + 0 + " " + 0 + " " + p1); int t1 = sc.nextInt(); System.out.flush(); System.out.println("?" + " " + 0 + " " + 0 + " " + p2); int t2 = sc.nextInt(); System.out.flush(); if(t1 >= t2) { ans1 = p1; if(left == p1) break; left = p1; } else { right = p2; ans1 = p2; } } System.out.println("!" + " " + ans1 + " " + ans2 + " " + ans3); System.out.flush(); System.exit(0); } }