結果

問題 No.305 鍵(2)
ユーザー hanorverhanorver
提出日時 2016-05-18 09:29:15
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 579 bytes
コンパイル時間 773 ms
コンパイル使用メモリ 53,056 KB
実行使用メモリ 24,492 KB
平均クエリ数 15.46
最終ジャッジ日時 2023-09-23 10:38:20
合計ジャッジ時間 2,971 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<iostream>
#include<string>
#include<cctype>

int main() {
	std::string ans = "0000000000";
	std::cout << ans << std::endl;
	int ans_num;
	std::string result;
	std::cin >> ans_num >> result;
	if (result == "unlocked") return 0;

	int prev_ans = ans_num;
	for (int i = 0; i < ans.size(); i++) {
		for (int j = 0; j < 10; j++) {
			ans[i] = '0' + j;
			std::cout << ans << std::endl;
			std::cin >> ans_num >> result;

			if (result == "unlocked") return 0;
			if (ans_num > prev_ans) break;
			if (ans_num < prev_ans) {
				ans[i] = '0' + (j - 1);
				break;
			}
		}
	}
}
0