結果

問題 No.3069 Invisible Speedrun
ユーザー k82b
提出日時 2025-03-21 23:18:05
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 85 ms / 2,000 ms
コード長 965 bytes
コンパイル時間 2,006 ms
コンパイル使用メモリ 192,492 KB
実行使用メモリ 26,212 KB
平均クエリ数 585.19
最終ジャッジ日時 2025-03-21 23:18:19
合計ジャッジ時間 9,957 ms
ジャッジサーバーID
(参考情報)
judge7 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 80
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using Int = long long;
template <class T> inline bool setmin(T &A, T B){
	if (A > B){
		A = B;
		return true;
	} else {
		return false;
	}
}
template <class T> inline bool setmax(T &A, T B){
	if (A < B){
		A = B;
		return true;
	} else {
		return false;
	}
}
#define REP(x, y) for (int x = 0; x < int(y); ++x)
#define rep(x, y, z) for (int x = int(y); x < int(z); ++x)
#define PER(x, y) for (int x = int(y) - 1; x >= 0; --x)
#define per(x, y, z) for (int x = int(z) - 1; x >= int(y); --x)

void solve(){
	int N;
	cin >> N;
	auto com = [&](char d) -> bool{
		cout << d << endl;
		int v;
		cin >> v;
		return v;
	};
	REP(i, N * 2 - 2){
		if (i % 2 == 0){
			if (com('D')){
				return;
			}
		} else {
			if (com('R')){
				return;
			}
		}
	}
	if (com('R')){
		return;
	}
	if (com('D')){
		return;
	}
}

int main(){
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int t = 1;
	// cin >> t;
	while (t--){
		solve();
	}
}
0