結果
問題 | No.513 宝探し2 |
ユーザー | te-sh |
提出日時 | 2017-05-05 23:11:48 |
言語 | D (dmd 2.106.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 905 bytes |
コンパイル時間 | 537 ms |
コンパイル使用メモリ | 83,960 KB |
実行使用メモリ | 24,540 KB |
平均クエリ数 | 4.67 |
最終ジャッジ日時 | 2023-09-03 13:09:25 |
合計ジャッジ時間 | 3,130 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge13 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 29 ms
23,400 KB |
testcase_01 | WA | - |
testcase_02 | WA | - |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | AC | 22 ms
23,412 KB |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | WA | - |
ソースコード
import std.algorithm, std.conv, std.range, std.stdio, std.string; void main() { auto ans = int.max; auto xi = 0, xa = 10; auto yi = 0, ya = 10; auto ri = 0, ra = 0; writeln(xi, " ", yi); stdout.flush(); ri = readln.chomp.to!int; if (ri == 0) return; writeln(xa, " ", yi); stdout.flush(); ra = readln.chomp.to!int; if (ra == 0) return; auto x = 0; if (ri < ra) { x = (xa - (ra - ri)) / 2; } else if (ri > ra) { x = (xi + (ri - ra)) / 2; } else { x = (xa + xi) / 2; } writeln(x, " ", yi); stdout.flush(); ri = readln.chomp.to!int; if (ri == 0) return; writeln(x, " ", ya); stdout.flush(); ra = readln.chomp.to!int; if (ra == 0) return; auto y = 0; if (ri < ra) { y = (ya - (ra - ri)) / 2; } else if (ri > ra) { y = (yi + (ri - ra)) / 2; } else { y = (ya + yi) / 2; } writeln(x, " ", y); stdout.flush(); }