Submission #972847

#TimeUsernameProblemLanguageResultExecution timeMemory
972847tamir1Combo (IOI18_combo)C++17
30 / 100
20 ms1464 KiB
#include "combo.h"
#include <bits/stdc++.h>
using namespace std;
std::string guess_sequence(int N) {
  std::string p = "";
  string v,S;
  if(press("A")==1){
  	S="A";
  	v="BXY";
  }
  else if(press("B")==1){
  	S="B";
  	v="AXY";
  }
  else if(press("X")==1){
  	S="X";
  	v="ABY";
  }
  else{
  	S="Y";
  	v="ABX";
  }
  for(int i=1;i<N;i++){
  	bool ok=0;
  	for(int j=0;j<=1;j++){
  		p=S;
		p+=v[j];
		if(press(p)>i){
			ok=1;
			S=p;
			break;
		}	
	}
	if(!ok) S+=v[2];
  }
  return S;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...