Submission #588718

#TimeUsernameProblemLanguageResultExecution timeMemory
588718shezittCombo (IOI18_combo)C++14
30 / 100
39 ms548 KiB
#include "combo.h"
#include <bits/stdc++.h>
#define dbg(x) cerr << #x << ": " << x << endl;
#define raya cerr << "======================" << endl;
 
using namespace std;
 
string guess_sequence(int N) {
	string s = "";
	string aux = "ABXY";
	for(int j=0; j<4; ++j){
		s += aux[j];
      	if(j == 3){
          break;
        }
		if(press(s)){
			break;
		}
		s.pop_back();
	}
	string tmp = aux;
	aux = "";
	for(char c : tmp){
		if(c != s[0]){
			aux += c;
		}
	}
	for(int i=1; i<N; ++i){
		for(int j=0; j<3; ++j){
			s += aux[j];
			if(j == 2){
				break;
			}
			if(press(s) == i+1){
				break;
			}
			s.pop_back();
		}
	}
	return s;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...