Submission #1214577

#TimeUsernameProblemLanguageResultExecution timeMemory
1214577michael12콤보 (IOI18_combo)C++20
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>
#define ff first
#define ss second
using namespace std;
int dx[4] = {0, 0, -1, 1};
int dy[4] = {-1, 1, 0, 0};
bool vis[100][100];
string guess_sequence(int N){
   string S, tmp;
   string ans = "";
   string nn = "";
   if(press("AB")){
     if(press("A")){
        ans += "A";
        nn += "BXY";
     }
     else{
        ans += "B";
        nn += "AXY";
     }
   }
   else if(press("X")){
    ans += "X";
    nn += "ABY";
   }
   else{
    ans += "Y";
    nn += "ABX";
   }
   if(N == 1){
    return ans;
   }
for(int i = 1; i < N - 1; i++){
  tmp = ans + nn[0] + ans + nn[1] + nn[1] + ans + nn[1] + nn[0] + ans + nn[1] + nn[2];
  int rr = press(tmp);
  if(rr = ans.size()){
    ans += nn[2];
  }
  else if(rr = ans.size() + 1){
    ans += nn[0];
  }
  else{
    ans += nn[1];
  }
}
if(press(ans + nn[0]) == ans.size() + 1){
    return ans + nn[0];
}
else if(press(ans + nn[1]) == ans.size() + 1){
    return ans + nn[1];
}
else{
    return ans + nn[2];
}

}

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:12:7: error: 'press' was not declared in this scope
   12 |    if(press("AB")){
      |       ^~~~~
combo.cpp:35:12: error: 'press' was not declared in this scope
   35 |   int rr = press(tmp);
      |            ^~~~~
combo.cpp:46:4: error: 'press' was not declared in this scope
   46 | if(press(ans + nn[0]) == ans.size() + 1){
      |    ^~~~~
combo.cpp:56:1: warning: control reaches end of non-void function [-Wreturn-type]
   56 | }
      | ^