結果

問題 No.305 鍵(2)
ユーザー pekempeypekempey
提出日時 2015-11-27 22:47:32
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 30 ms / 2,000 ms
コード長 1,013 bytes
コンパイル時間 1,179 ms
コンパイル使用メモリ 145,892 KB
実行使用メモリ 24,276 KB
平均クエリ数 61.15
最終ジャッジ日時 2023-09-23 22:00:50
合計ジャッジ時間 2,603 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
#define GET_MACRO(a, b, c, NAME, ...) NAME
#define rep(...) GET_MACRO(__VA_ARGS__, rep3, rep2)(__VA_ARGS__)
#define rep2(i, a) rep3 (i, 0, a)
#define rep3(i, a, b) for (int i = (a); i < (b); i++)
#define repr(...) GET_MACRO(__VA_ARGS__, repr3, repr2)(__VA_ARGS__)
#define repr2(i, a) repr3 (i, 0, a)
#define repr3(i, a, b) for (int i = (b) - 1; i >= (a); i--)
#define chmin(a, b) ((b) < a && (a = (b), true))
#define chmax(a, b) (a < (b) && (a = (b), true))
using namespace std;
typedef long long ll;

int main() {
	string ans(10, '0');
	rep (i, 10) {
		cout << ans << endl;
		int num;
		string s;
		cin >> num >> s;
		if (s == "unlocked") return 0;
		rep (j, 10) {
			string ans2 = ans;
			ans2[i] = '0' + j;
			int num2;
			string s2;
			cout << ans2 << endl;
			cin >> num2 >> s2;
			if (s2 == "unlocked") return 0;
			if (num2 < num) {
				break;
			} else if (num2 > num) {
				ans = ans2;
				break;
			}
		}
	}
	cout << ans << endl;
	int a;
	string b;
	cin >> a >> b;
	return 0;
}
0