Submission #152677

#TimeUsernameProblemLanguageResultExecution timeMemory
152677SegtreeCombo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
typedef long long ll;
#define mod 1000000007

string guess_sequence(int N){
    string d="ABXY";
    string s="Y";
    for(int r=0;r<3;r++){
	string p=""; p+=d[r];
	if(press(p)==1)s=p;
    }
    char fi=s[0];
    for(int i=2;i<=N;i++){
	char res='#',rem;
	ll cnt=0;
	for(int r=0;r<4;r++){
	    if(d[r]==fi)continue;
	    cnt++;
	    if(cnt==3){
		rem=d[r];
		break;
	    }
	    string p=s; p+=d[r];
	    if(press(p)==i)res=d[r];
	}
	if(res=='#')res=rem;
	s+=res;
    }
    return s;
};
/*
int main(){
  
  return 0;
}*/

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:13:5: error: 'press' was not declared in this scope
   13 |  if(press(p)==1)s=p;
      |     ^~~~~
combo.cpp:27:9: error: 'press' was not declared in this scope; did you mean 'res'?
   27 |      if(press(p)==i)res=d[r];
      |         ^~~~~
      |         res