結果

問題 No.3069 Invisible Speedrun
ユーザー sai
提出日時 2025-03-21 22:28:13
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 84 ms / 2,000 ms
コード長 731 bytes
コンパイル時間 3,348 ms
コンパイル使用メモリ 275,120 KB
実行使用メモリ 26,228 KB
平均クエリ数 585.15
最終ジャッジ日時 2025-03-21 22:28:25
合計ジャッジ時間 10,497 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 80
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

int v;
int N;

void down() {
  std::cout << 'D' << std::endl;
  std::cin >> v;
  assert(v != -1);
  if (v == 1) {
    exit(0);
  }
}

void up() {
  std::cout << 'U' << std::endl;
  std::cin >> v;
  assert(v != -1);
  if (v == 1) {
    exit(0);
  }
}

void right() {
  std::cout << 'R' << std::endl;
  std::cin >> v;
  assert(v != -1);
  if (v == 1) {
    exit(0);
  }
}

void left() {
  std::cout << 'L' << std::endl;
  std::cin >> v;
  assert(v != -1);
  if (v == 1) {
    exit(0);
  }
}

int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  std::cin >> N;
  for (int i = 0; i < 2 * N; i++) {
    if (i % 2) {
      down();
    } else {
      right();
    }
  }
  assert(false);
}
0