結果

問題 No.513 宝探し2
ユーザー te-shte-sh
提出日時 2017-05-05 22:44:05
言語 D
(dmd 2.106.1)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 948 bytes
コンパイル時間 607 ms
コンパイル使用メモリ 84,220 KB
実行使用メモリ 35,456 KB
最終ジャッジ日時 2023-09-03 13:08:22
合計ジャッジ時間 7,648 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

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);
    auto ri = readln.chomp.to!int;

    writeln(xa, " ", y);
    auto ra = readln.chomp.to!int;

    writeln(x, " ", y);
    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) {
        x = xi;
      } else {
        x = xa;
      }
    }
  }
    
  for (;;) {
    writeln(x, " ", yi);
    auto ri = readln.chomp.to!int;

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

    writeln(x, " ", y);
    auto r = readln.chomp.to!int;

    if (yi >= ya) {
      y = yi;
    } else {
      y = ya;
    }
  }
}
0