結果
問題 | No.594 壊れた宝物発見機 |
ユーザー |
|
提出日時 | 2020-09-09 01:02:12 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 166 ms / 2,000 ms |
コード長 | 690 bytes |
コンパイル時間 | 2,929 ms |
コンパイル使用メモリ | 193,980 KB |
最終ジャッジ日時 | 2025-01-14 08:45:19 |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define REP(i,n) for(int i=0; i<(int)(n); i++) int ask(int t, int x) { cout << "?"; REP (i, 3) cout << " " << (i == t ? x : 0); cout << endl; int d; cin >> d; return d; } void ans(int x, int y, int z) { cout << "! " << x << " " << y << " " << z << endl; cout.flush(); } int main() { ios_base::sync_with_stdio(0); cin.tie(0); vector<int> ret; REP (t, 3) { int lo = -101; int hi = 100; while (hi - lo > 1) { int mi = (lo+hi)/2; if (ask(t, mi) < ask(t, mi+1)) hi = mi; else lo = mi; } ret.push_back(hi); } ans(ret[0], ret[1], ret[2]); return 0; }