結果

問題 No.594 壊れた宝物発見機
ユーザー Kutimoti_TKutimoti_T
提出日時 2018-06-04 19:52:41
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,401 bytes
コンパイル時間 1,134 ms
コンパイル使用メモリ 146,024 KB
実行使用メモリ 24,552 KB
平均クエリ数 199.00
最終ジャッジ日時 2023-09-23 16:04:41
合計ジャッジ時間 4,837 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 114 ms
23,400 KB
testcase_16 WA -
testcase_17 AC 114 ms
23,676 KB
testcase_18 WA -
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
#define rep(i,s,e) for(int (i) = (s);(i) <= (e);(i)++)

int main(){
  int X,Y,Z;
  int x0 = -100;
  int x3 = 100;
  for(int i = 0;i < 33;i++){
    int x1 = (x0 * 2 + x3 * 1) / (1 + 2);
    int x2 = (x0 * 1 + x3 * 2) / (1 + 2);
    cout << "? " << x1 << " " << 0 << " " << 0 << endl;
    i64 f1 = 0;
    i64 f2 = 0;
    cin >> f1;
    cout << "? " << x2 << " " << 0 << " " << 0 << endl;
    cin >> f2;
    if(f1 >= f2){
      x0 = x1;
    }
    else{
      x3 = x2;
    }
  }
  X = x0;
  x0 = -100;
  x3 = 100;
  for(int i = 0;i < 33;i++){
    int x1 = (x0 * 2 + x3 * 1) / (1 + 2);
    int x2 = (x0 * 1 + x3 * 2) / (1 + 2);
    cout << "? " << 0 << " " << x1 << " " << 0 << endl;
    i64 f1 = 0;
    i64 f2 = 0;
    cin >> f1;
    cout << "? " << 0 << " " << x2 << " " << 0 << endl;
    cin >> f2;
    if(f1 >= f2){
      x0 = x1;
    }
    else{
      x3 = x2;
    }
  }
  Y = x0;
  x0 = -100;
  x3 = 100;
  for(int i = 0;i < 33;i++){
    int x1 = (x0 * 2 + x3 * 1) / (1 + 2);
    int x2 = (x0 * 1 + x3 * 2) / (1 + 2);
    cout << "? " << 0 << " " << 0 << " " << x1 << endl;
    i64 f1 = 0;
    i64 f2 = 0;
    cin >> f1;
    cout << "? " << 0 << " " << 0 << " " << x2 << endl;
    cin >> f2;
    if(f1 >= f2){
      x0 = x1;
    }
    else{
      x3 = x2;
    }
  }
  Z = x0;
  cout << "! " << X << " " << Y << " " << Z << endl;
}
0