結果

問題 No.305 鍵(2)
ユーザー masamasa
提出日時 2015-11-30 14:42:56
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 28 ms / 2,000 ms
コード長 583 bytes
コンパイル時間 414 ms
コンパイル使用メモリ 57,308 KB
実行使用メモリ 24,048 KB
平均クエリ数 53.08
最終ジャッジ日時 2023-09-23 22:12:42
合計ジャッジ時間 1,754 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
23,952 KB
testcase_01 AC 26 ms
23,328 KB
testcase_02 AC 24 ms
23,604 KB
testcase_03 AC 27 ms
23,640 KB
testcase_04 AC 26 ms
24,048 KB
testcase_05 AC 27 ms
23,664 KB
testcase_06 AC 24 ms
23,592 KB
testcase_07 AC 26 ms
23,832 KB
testcase_08 AC 26 ms
23,328 KB
testcase_09 AC 26 ms
23,652 KB
testcase_10 AC 26 ms
23,724 KB
testcase_11 AC 27 ms
23,400 KB
testcase_12 AC 26 ms
23,424 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

using namespace std;

int main() {
	string val = string(10, '0');

	string stat;
	int x;
	int hit;


	cout << val << endl;
	cin >> x >> stat;
	if (x == 10) {
		return 0;
	}

	hit = x;

	for (int i = 0; i < val.size(); i++) {
		for (char c = '0'; c <= '9'; c++) {
			val[i] = c;

			cout << val << endl;
			cin >> x >> stat;
			if (x == 10) {
				return 0;
			} else if (x > hit) {
				hit = x;
				break;
			} else if (x < hit) {
				val[i] = '0';
				break;
			}

		}
	}

	cout << val << endl;
	return 0;
}
0