結果
| 問題 |
No.594 壊れた宝物発見機
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-11-10 23:06:17 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,581 bytes |
| コンパイル時間 | 1,390 ms |
| コンパイル使用メモリ | 169,984 KB |
| 実行使用メモリ | 25,616 KB |
| 平均クエリ数 | 117.10 |
| 最終ジャッジ日時 | 2024-07-16 14:29:50 |
| 合計ジャッジ時間 | 4,703 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 11 WA * 9 |
ソースコード
#include <bits/stdc++.h>
#define show(x) cerr << #x << " = " << x << endl
using namespace std;
using ll = long long;
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v)
{
os << "sz:" << v.size() << "\n[";
for (const auto& p : v) {
os << p << ",";
}
os << "]\n";
return os;
}
template <typename S, typename T>
ostream& operator<<(ostream& os, const pair<S, T>& p)
{
os << "(" << p.first << "," << p.second
<< ")";
return os;
}
constexpr ll MOD = (ll)1e9 + 7LL;
template <typename T>
constexpr T INF = numeric_limits<T>::max() / 64;
ll ask(const int x, const int y, const int z)
{
cout << "? " << x << " " << y << " " << z << endl;
ll i;
cin >> i;
return i;
}
int main()
{
cin.tie(0);
ios::sync_with_stdio(false);
vector<int> sup(3, 150);
vector<int> inf(3, -150);
for (int i = 0; i < 3; i++) {
while (inf[i] < sup[i]) {
const ll ainf = (i == 0) ? ask(inf[i], 0, 0) : (i == 1) ? ask(0, inf[i], 0) : ask(0, 0, inf[i]);
const ll asup = (i == 0) ? ask(sup[i], 0, 0) : (i == 1) ? ask(0, sup[i], 0) : ask(0, 0, sup[i]);
if (asup == ainf) {
inf[i] = (inf[i] + sup[i]) / 2;
sup[i] = inf[i];
} else if (asup < ainf) {
inf[i] = (inf[i] + sup[i]+1) / 2;
} else {
sup[i] = (inf[i] + sup[i] ) / 2;
}
}
}
cout << "!";
for (int i = 0; i < 3; i++) {
cout << " " << inf[i];
}
cout << endl;
return 0;
}