結果
| 問題 |
No.305 鍵(2)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-09-07 02:54:44 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,328 bytes |
| コンパイル時間 | 805 ms |
| コンパイル使用メモリ | 95,524 KB |
| 実行使用メモリ | 25,704 KB |
| 平均クエリ数 | 9.31 |
| 最終ジャッジ日時 | 2024-07-16 14:10:37 |
| 合計ジャッジ時間 | 4,072 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 2 WA * 11 |
ソースコード
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <functional>
#include <iostream>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <valarray>
#include <vector>
#define N 1000
// #define MOD 1000000007
#define MOD 1000000000000
#define pe(str) return cout<<(str)<<endl,0
#define px(str) {cout<<(str)<<endl;exit(0);}
#define re(i,n) for(int i=0;i<(n);i++)
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define fe(i,n,f) for_each(i,n,f)
#define bw(a,b,c) (((a)<=(b))&&((b)<=(c)))
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int,int> pii;
template<class InputIterator>
void dump(InputIterator first,InputIterator last,char delim=' '){
for(InputIterator it=first;it!=last;it++){
if(it!=first)cout<<delim;
cout<<*it;
}
}
int q(string s){
string k;
int z;
cout<<s<<endl;
cin>>z>>k;
if(z==10)exit(0);
return z;
}
int main(void){
int a[10];
re(i,10){
string s="";
re(j,10)s+=i+'0';
int k=q(s);
a[i]=k;
}
string s="";
re(i,10){
re(j,a[i])s[j]+=i+'0';
}
sort(s.begin(),s.end());
do{
q(s);
}while(next_permutation(s.begin(),s.end()));
return 0;
}