Submission #445359

#TimeUsernameProblemLanguageResultExecution timeMemory
445359silverfishCombo (IOI18_combo)C++14
10 / 100
55 ms584 KiB
#include "combo.h"
#include <bits/stdc++.h>
using namespace std;

#define pb push_back

set<char> st = {'A', 'B', 'X', 'Y'};

string guess_sequence(int n) {
	string ans="";
	vector<char> c;
	for(char ch : st){
		if(press(ans+ch)){
			ans.pb(ch);	
			for(char cch : st) if(cch != ch) c.pb(cch);
			break;
		}
	}

	for(int i = 1; i < n; ++i){
		bool found = 0;
		for(int j = 0; j < 2; ++j){
			if(press(ans + c[j]) == i+1){
				found = 1;
				ans.pb(c[j]);
				break;
			}
		}
		if(!found) ans.pb(c[2]);
	}
	return ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...