結果

問題 No.305 鍵(2)
ユーザー くれちーくれちー
提出日時 2017-01-18 00:59:18
言語 C90
(gcc 11.4.0)
結果
AC  
実行時間 27 ms / 2,000 ms
コード長 466 bytes
コンパイル時間 191 ms
コンパイル使用メモリ 24,304 KB
実行使用メモリ 24,348 KB
平均クエリ数 58.77
最終ジャッジ日時 2023-09-24 00:50:02
合計ジャッジ時間 1,337 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
23,400 KB
testcase_01 AC 23 ms
23,652 KB
testcase_02 AC 22 ms
24,348 KB
testcase_03 AC 22 ms
23,964 KB
testcase_04 AC 21 ms
24,204 KB
testcase_05 AC 22 ms
23,976 KB
testcase_06 AC 22 ms
23,808 KB
testcase_07 AC 21 ms
23,664 KB
testcase_08 AC 21 ms
23,400 KB
testcase_09 AC 21 ms
23,616 KB
testcase_10 AC 24 ms
23,796 KB
testcase_11 AC 21 ms
23,532 KB
testcase_12 AC 20 ms
23,388 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <stdlib.h>
#define rep(i, n) for (i = 0; i < n; i++)

int try(int *t) {
	int i, x, s[9];
	rep(i, 10) printf("%d", t[i] % 10);
	printf("\n");
	fflush(stdout);
	scanf("%d %s", &x, s);
	if (x == 10) exit(0);
	return x;
}

int main() {
	int i, j, r[10];
	rep(i, 10) r[i] = rand() % 10;
	int x = try(r);
	rep(i, 10) {
		int t = x = try(r);
		rep(j, 10) {
			r[i]++;
			x = try(r);
			if (x > t) break;
			if (x < t) { r[i]--; break; }
		}
	}
}
0