結果

問題 No.514 宝探し3
ユーザー te-shte-sh
提出日時 2017-05-05 23:06:58
言語 D
(dmd 2.106.1)
結果
WA  
実行時間 -
コード長 812 bytes
コンパイル時間 809 ms
コンパイル使用メモリ 84,120 KB
実行使用メモリ 24,420 KB
平均クエリ数 4.75
最終ジャッジ日時 2023-09-03 13:08:56
合計ジャッジ時間 3,508 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
23,664 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 RE -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import std.algorithm, std.conv, std.range, std.stdio, std.string;

void main()
{
  auto ans = int.max;
  auto xi = 0, xa = 100000;
  auto yi = 0, ya = 100000;
  auto ri = 0, ra = 0;

  writeln(xi, " ", yi); stdout.flush();
  ri = readln.chomp.to!int;

  writeln(xa, " ", yi); stdout.flush();
  ra = readln.chomp.to!int;

  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;

  writeln(x, " ", ya); stdout.flush();
  ra = readln.chomp.to!int;

  auto y = 0;
  if (ri < ra) {
    y = (ya - (ra - ri)) / 2;
    writeln(x, " ", y); stdout.flush();
  } else if (ri > ra) {
    y = (yi + (ri - ra)) / 2;
    writeln(x, " ", y); stdout.flush();
  }
}
0