結果
| 問題 | 
                            No.305 鍵(2)
                             | 
                    
| コンテスト | |
| ユーザー | 
                             dnish
                         | 
                    
| 提出日時 | 2017-07-10 00:58:24 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                TLE
                                 
                             
                            
                            (最新)
                                AC
                                 
                             
                            (最初)
                            
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 491 bytes | 
| コンパイル時間 | 2,003 ms | 
| コンパイル使用メモリ | 168,208 KB | 
| 実行使用メモリ | 24,580 KB | 
| 平均クエリ数 | 0.77 | 
| 最終ジャッジ日時 | 2024-07-17 01:16:41 | 
| 合計ジャッジ時間 | 5,736 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 1 TLE * 1 -- * 11 | 
ソースコード
#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;
}
            
            
            
        
            
dnish