結果

問題 No.305 鍵(2)
ユーザー kurenaifkurenaif
提出日時 2016-05-31 18:20:11
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 30 ms / 2,000 ms
コード長 526 bytes
コンパイル時間 375 ms
コンパイル使用メモリ 52,556 KB
実行使用メモリ 24,336 KB
平均クエリ数 44.08
最終ジャッジ日時 2023-09-24 00:02:05
合計ジャッジ時間 1,724 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
23,592 KB
testcase_01 AC 27 ms
23,256 KB
testcase_02 AC 26 ms
23,364 KB
testcase_03 AC 26 ms
24,336 KB
testcase_04 AC 27 ms
24,252 KB
testcase_05 AC 29 ms
23,652 KB
testcase_06 AC 25 ms
24,252 KB
testcase_07 AC 26 ms
24,000 KB
testcase_08 AC 27 ms
24,036 KB
testcase_09 AC 27 ms
24,024 KB
testcase_10 AC 27 ms
23,832 KB
testcase_11 AC 26 ms
23,388 KB
testcase_12 AC 26 ms
23,556 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <cstdio>

using namespace std;

int get() {
	int num; cin >> num;
	string str; cin >> str;
	return num;
}

int main(void) {
	string str = "0000000000";
	cout << str << endl;
	int num = get();
	if (num == 10) return 0;

	for (int i = 0; i < 10; ++i) {
		for (int j = 0; j < 9; ++j) {
			str[i]++;
			cout << str << endl;
			int n = get();
			if (n == 10) return 0;
			if (n < num) {
				str[i]--;
				break;
			}
			if (n > num) {
				num = n;
				break;
			}
		}
	}

	return 0;
}
0