結果

問題 No.305 鍵(2)
ユーザー furafura
提出日時 2020-04-27 05:07:27
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 30 ms / 2,000 ms
コード長 415 bytes
コンパイル時間 2,151 ms
コンパイル使用メモリ 199,220 KB
実行使用メモリ 24,420 KB
平均クエリ数 54.69
最終ジャッジ日時 2023-09-24 02:35:59
合計ジャッジ時間 3,589 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
24,384 KB
testcase_01 AC 25 ms
23,364 KB
testcase_02 AC 23 ms
24,324 KB
testcase_03 AC 25 ms
23,520 KB
testcase_04 AC 26 ms
23,988 KB
testcase_05 AC 27 ms
24,180 KB
testcase_06 AC 23 ms
23,340 KB
testcase_07 AC 25 ms
24,276 KB
testcase_08 AC 25 ms
24,420 KB
testcase_09 AC 25 ms
23,364 KB
testcase_10 AC 25 ms
23,316 KB
testcase_11 AC 25 ms
23,364 KB
testcase_12 AC 25 ms
23,364 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;

random_device seed_gen;
mt19937 rng(seed_gen());

int ask(int* a){
	rep(i,10) printf("%d",a[i]);
	puts("");
	fflush(stdout);
	int x; scanf("%d%*s",&x);
	return x;
}

int main(){
	int a[10];
	do{
		rep(i,10) a[i]=rng()%10;
	}while(ask(a)!=0);

	rep(i,10){
		rep(d,10){
			a[i]=d;
			if(ask(a)==i+1) break;
		}
	}

	return 0;
}
0