結果

問題 No.305 鍵(2)
ユーザー QCFiumQCFium
提出日時 2020-06-16 18:27:32
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 31 ms / 2,000 ms
コード長 459 bytes
コンパイル時間 1,572 ms
コンパイル使用メモリ 163,052 KB
実行使用メモリ 24,288 KB
平均クエリ数 92.62
最終ジャッジ日時 2023-09-24 02:39:35
合計ジャッジ時間 2,651 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
23,364 KB
testcase_01 AC 26 ms
24,036 KB
testcase_02 AC 26 ms
23,652 KB
testcase_03 AC 28 ms
23,808 KB
testcase_04 AC 27 ms
23,664 KB
testcase_05 AC 28 ms
24,240 KB
testcase_06 AC 24 ms
23,532 KB
testcase_07 AC 27 ms
23,664 KB
testcase_08 AC 27 ms
24,288 KB
testcase_09 AC 27 ms
23,652 KB
testcase_10 AC 27 ms
23,400 KB
testcase_11 AC 26 ms
24,024 KB
testcase_12 AC 26 ms
23,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

int main() {
	char res[11] = { 0 };
	char tmp[11] = { 0 };
	for (int i = 0; i < 10; i++) tmp[i] = '0';
	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