Submission #238582

#TimeUsernameProblemLanguageResultExecution timeMemory
238582rahul_a_nCombo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>
using namespace std;
int guess_sequence(int N){
  string ans;
  if(press("A")>0)
    ans="A";
  else if(press("B")>0)
    ans="B";
  else if(press("X")>0)
    ans="X";
  else
    ans="Y";
  for(int i=1;i<N;i++){
    if(press(ans+"A")>i)
    ans+="A";
  else if(press(ans+"B")>i)
    ans+="B";
  else if(press(ans+"X")>i)
    ans+="X";
  else
    ans+="Y";
  }
  return ans;
}

Compilation message (stderr)

combo.cpp: In function 'int guess_sequence(int)':
combo.cpp:5:6: error: 'press' was not declared in this scope
    5 |   if(press("A")>0)
      |      ^~~~~
combo.cpp:14:8: error: 'press' was not declared in this scope
   14 |     if(press(ans+"A")>i)
      |        ^~~~~
combo.cpp:23:10: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'int' in return
   23 |   return ans;
      |          ^~~