結果

問題 No.305 鍵(2)
ユーザー dnishdnish
提出日時 2017-07-10 00:58:24
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 491 bytes
コンパイル時間 1,369 ms
コンパイル使用メモリ 165,188 KB
実行使用メモリ 23,604 KB
平均クエリ数 0.77
最終ジャッジ日時 2023-09-24 01:21:50
合計ジャッジ時間 5,093 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
23,604 KB
testcase_01 TLE -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define REP(i,n,N) for(int i=(n);i<(int) N;i++)
#define p(s) cout<<(s)<<endl
using namespace std;

int main(){
	int sum=0;
	string q="";
	int num;
	string s;
	REP(i,0,9){
		REP(j,0,10) cout<<i;
		cout<<endl;
		cin>>num>>s;
		if(s=="unlocked") break;
		sum+=num;
		REP(j,0,num) q+=(char) '0'+i;
	}
	if(s!="unlocked"){
		REP(j,0,10-sum) q+='9';
		do{
			p(q);
			cin>>num>>s;
			if(s=="unlocked")	break;
		}while(next_permutation(q.begin(),q.end()));
	}

	return 0;
}
0