結果

問題 No.305 鍵(2)
ユーザー takubokudoritakubokudori
提出日時 2017-09-07 02:59:09
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 1,383 bytes
コンパイル時間 780 ms
コンパイル使用メモリ 93,756 KB
実行使用メモリ 35,640 KB
最終ジャッジ日時 2023-09-23 15:41:37
合計ジャッジ時間 7,461 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#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;
	}
}

string a="1234567890";
int q(string s){
	string k;
	int z=0;
	cout<<s<<endl;
	re(i,10) if(s[i]==a[i]) z++;
	// 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+='0'+i;
	}
	sort(s.begin(),s.end());
	do{
		q(s);
	}while(next_permutation(s.begin(),s.end()));

	return 0;
}
0