Submission #869210

#TimeUsernameProblemLanguageResultExecution timeMemory
869210NinedesuCombo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
string guess_sequence(int N) {
  string p = "";
  for (int i=0; i<4; i++) {
    p+=t[i];
    int c=press(p);
    if(c){
      st=i;
      break;
    }
    p="";
  }
  for(int i=1; i<N; i++){
    string q="";
    int x=0;
    if(x==st)x++;
    for(int j=0; j<4; j++){
      if(st==j)continue;
      q+=p+t[x]+t[j];
    }
    x++;
    if(x==st)x++;
    q+=p+t[x];
    x++;
    int c=press(q);
    if(c==p.size()+2)p+=q[p.size()];
    else if(c==p.size()+1)p+=q[q.size()-1];
    else p+=t[x];
  }

  return p;
}

Compilation message (stderr)

combo.cpp:1:1: error: 'string' does not name a type
    1 | string guess_sequence(int N) {
      | ^~~~~~