結果

問題 No.305 鍵(2)
ユーザー QCFiumQCFium
提出日時 2020-06-16 18:26:52
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 439 bytes
コンパイル時間 1,492 ms
コンパイル使用メモリ 161,960 KB
実行使用メモリ 24,456 KB
平均クエリ数 116.38
最終ジャッジ日時 2023-09-24 03:40:37
合計ジャッジ時間 5,003 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>

int main() {
	char res[11] = { 0 };
	char tmp[11];
	memset(tmp, '0', sizeof(tmp));
	for (int i = 0; i < 10; i++) {
		int max = -1, index = -1;
		for (int j = 0; j < 10; j++) {
			tmp[i] += j;
			puts(tmp);
			fflush(stdout);
			int match;
			scanf("%d%*s", &match);
			if (match == 10) return 0;
			if (match > max) max = match, index = j;
			tmp[i] -= j;
		}
		res[i] = index + '0';
	}
	puts(res);
	return 0;
}

0