結果
| 問題 | No.513 宝探し2 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-05-05 22:54:38 |
| 言語 | D (dmd 2.111.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 1,148 bytes |
| 記録 | |
| コンパイル時間 | 746 ms |
| コンパイル使用メモリ | 99,680 KB |
| 実行使用メモリ | 25,604 KB |
| 平均クエリ数 | 76.17 |
| 最終ジャッジ日時 | 2024-06-12 19:01:15 |
| 合計ジャッジ時間 | 3,084 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | RE * 12 |
ソースコード
import std.algorithm, std.conv, std.range, std.stdio, std.string;
void main()
{
auto ans = int.max;
auto x = 50000, y = 50000;
auto xi = 0, xa = 100000, yi = 0, ya = 100000;
for (;;) {
writeln(xi, " ", y); stdout.flush();
auto ri = readln.chomp.to!int;
writeln(xa, " ", y); stdout.flush();
auto ra = readln.chomp.to!int;
writeln(x, " ", y); stdout.flush();
auto r = readln.chomp.to!int;
if (xa - xi <= 2) {
if (x <= xa && x <= xi) {
break;
} else if (xi <= x && xi <= xa) {
x = xi;
break;
} else {
x = xa;
break;
}
} else {
if (xi >= xa) {
xi = x;
x = (xa - xi) / 2;
} else {
xa = x;
x = (xa - xi) / 2;
}
}
}
for (;;) {
writeln(x, " ", yi); stdout.flush();
auto ri = readln.chomp.to!int;
writeln(x, " ", ya); stdout.flush();
auto ra = readln.chomp.to!int;
writeln(x, " ", y); stdout.flush();
auto r = readln.chomp.to!int;
if (yi >= ya) {
yi = y;
y = (ya - yi) / 2;
} else {
ya = y;
y = (ya - yi) / 2;
}
}
}