結果

問題 No.3418 【絶望】30個並列ごちゃ混ぜHit&Blowで遊ぼう!
コンテスト
ユーザー daiota
提出日時 2025-12-25 06:39:28
言語 C++17
(gcc 13.3.0 + boost 1.89.0)
結果
WA  
実行時間 -
コード長 1,494 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,367 ms
コンパイル使用メモリ 213,568 KB
実行使用メモリ 26,356 KB
スコア 0
平均クエリ数 30241.00
最終ジャッジ日時 2025-12-25 06:42:35
合計ジャッジ時間 185,743 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 100
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int,int> P;
#define REP(i,n) for(ll i=0;i<int(n);i++)















int main(){
	cin.tie(nullptr);  ios_base::sync_with_stdio(false);
    int i,j,k,l,m;


	vector<string> S;
	for(i=0;i<10;i++){
		for(j=0;j<10;j++){
			if(j==i) continue;
			for(k=0;k<10;k++){
				if(k==i || k==j) continue;
				for(l=0;l<10;l++){
					if(l==i || l==j || l==k) continue;
					for(m=0;m<10;m++){
						if(m==i || m==j || m==k || m==l) continue;

						string s;
						s+=char(i+'0');
						s+=char(j+'0');
						s+=char(k+'0');
						s+=char(l+'0');
						s+=char(m+'0');

						S.push_back(s);

					}
				}
			}
		}
	}



	map<string,vector<string>> mp;


	string x="02468";
	REP(i,30240){

		if(S[i]==x) continue;

		ll e=0;
		set<char> t;

		REP(j,5){
			if(x[j]==S[i][j]) e++;
			else{
				t.insert(x[j]);
				t.insert(S[i][j]);
			}
		}

		int h=e,b=2*(5-e)-(int)t.size();


		string c;
		c+=char(h+'0');
		c+=char(b+'0');


		mp[c].push_back(S[i]);


	}


	cout << "02468" << endl;
	cout.flush();


	REP(i,30){

		int x,y;
		cin >> x >> y;

		if(i==0){
			if(x==5) return 0;
		}

		if(x==-1 && y==-1) return 0;

		string z;
		z+=char(x+'0');
		z+=char(y+'0');

		vector<string> d=mp[z];
		REP(j,d.size()){

			cout << d[j] << endl;
			cout.flush();

			REP(k,30){
				int xx,yy;
				cin >> xx >> yy;

				if(xx==-1 && yy==-1) return 0;

				if(k==0){
					if(xx==5) return 0;
				}
			}



		}


	}








  return 0;

}
0