結果

問題 No.5006 Hidden Maze
ユーザー square1001
提出日時 2022-06-12 14:27:19
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 53 ms / 2,000 ms
コード長 752 bytes
コンパイル時間 682 ms
実行使用メモリ 22,856 KB
スコア 19,408
平均クエリ数 806.92
最終ジャッジ日時 2022-06-12 14:27:29
合計ジャッジ時間 9,191 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
純コード判定しない問題か言語
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 100
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <string>
#include <vector>
#include <iostream>
using namespace std;

uint64_t seed = 123456789ULL;
uint64_t xorshift64() {
	seed ^= seed << 13;
	seed ^= seed >> 7;
	seed ^= seed << 17;
	return seed;
}
int rand_int(int l, int r) {
	return l + int(xorshift64() % (r - l));
}
double randouble() {
	return double(xorshift64()) / double(uint64_t(-1));
}

int main() {
	const int T = 1000;
	int H, W, PN;
	cin >> H >> W >> PN;
	double p = double(PN) / 100;
	int iteration = 0;
	while (true) {
		iteration += 1;
		string str = string(H - 1, 'D') + string(W - 1, 'R');
		for (int i = 0; i < H + W - 2; i++) {
			swap(str[i], str[rand_int(0, i + 1)]);
		}
		cout << str << endl;
		int res;
		cin >> res;
		if (res == -1) {
			break;
		}
	}
	return 0;
}
0