結果
| 問題 | No.3520 L1等距離点 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-05-01 21:48:47 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 619 bytes |
| 記録 | |
| コンパイル時間 | 2,926 ms |
| コンパイル使用メモリ | 330,548 KB |
| 実行使用メモリ | 30,320 KB |
| 平均クエリ数 | 5.51 |
| 最終ジャッジ日時 | 2026-05-01 21:48:58 |
| 合計ジャッジ時間 | 9,858 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 11 WA * 24 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
int T;
pair<int, int> P0, PT;
cin >> T >> P0.first >> P0.second >> PT.first >> PT.second;
int l = 0, r = T;
while (l + 1 < r) {
int m = (l + r) >> 1, x, y;
cout << "? " << m << endl;
cin >> x >> y;
int d0 = abs(P0.first - x) + abs(P0.second - y), dT = abs(PT.first - x) + abs(PT.second - y);
if (d0 == dT) {
cout << "! " << m << endl;
break;
} else if (d0 < dT) {
l = m;
} else {
r = m;
}
}
cout << "! " << l << endl;
}