結果

問題 No.305 鍵(2)
ユーザー hanorverhanorver
提出日時 2015-11-27 22:48:30
言語 C++11
(gcc 11.4.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 594 bytes
コンパイル時間 508 ms
コンパイル使用メモリ 52,088 KB
実行使用メモリ 36,348 KB
最終ジャッジ日時 2023-09-23 22:01:06
合計ジャッジ時間 6,817 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<iostream>
#include<string>

void print(int pass[]) {
	for (int i = 0; i < 10; i++) {
		std::cout << pass[i];
	}
	std::cout << std::endl;
}

int main() {
	int pass[] = {0,0,0,0,0,0,0,0,0,0};
	int ans = 0;
	std::string s;

	print(pass);
	std::cin >> ans >> s;

	while (ans != 10) {
		for (int i = 0; i < 10; i++) {
			for (int j = 0; j < 10; j++) {
				int tmp;
				std::string stmp;
				pass[i] = j;
				print(pass);
				std::cin >> tmp >> stmp;
				if (stmp == "10") return 0;
				if (tmp > ans) break;
				if (tmp < ans) {
					pass[i] -= 1;
					break;
				}
			}
		}
	}
	return 0;
}
0