結果

問題 No.305 鍵(2)
ユーザー kurenaif
提出日時 2016-05-31 18:20:11
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 29 ms / 2,000 ms
コード長 526 bytes
コンパイル時間 453 ms
コンパイル使用メモリ 56,260 KB
実行使用メモリ 25,220 KB
平均クエリ数 44.08
最終ジャッジ日時 2024-07-16 23:52:35
合計ジャッジ時間 1,818 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

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