Submission #1142005

#TimeUsernameProblemLanguageResultExecution timeMemory
1142005ad_ouxCombo (IOI18_combo)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #define ll long long using namespace std; std::string guess_sequence(int N) { if (N==3){ std::string p = ""; int doubled{-1}; std::string conseq = ""; std::string S = ""; if (press("A")==0){conseq+="BXY";} else if (press("B")==0){conseq+="AXY";} else if (press("X")==0){conseq+="ABY";} else if (press("Y")==0){conseq+="ABX";} for(int i = 0 ; i < 3 ; i++){ if (press(conseq[i]+conseq[i])==2){doubled = i ;break ;} } if (doubled == -1){ for(int i = 0 ; i < 3 ; i++){ if ( press(conseq[i]+conseq[(i+1)%3]+conseq[(i+2)%3])==3){S += conseq[i]+conseq[(i+1)%3]+conseq[(i+2)%3];break ;} } } else { for(int i = 0 ; i < 3 ; i++){ if (i!= doubled && press(conseq[i]+conseq[doubled]+conseq[doubled])==3){S += conseq[i]+conseq[doubled]+conseq[doubled];break ;} } } return S; } else { return "HeLLO THERE" ; } }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:16:7: error: 'press' was not declared in this scope
   16 |   if (press("A")==0){conseq+="BXY";}
      |       ^~~~~
combo.cpp:22:7: error: 'press' was not declared in this scope
   22 |   if (press(conseq[i]+conseq[i])==2){doubled = i ;break ;}
      |       ^~~~~
combo.cpp:27:8: error: 'press' was not declared in this scope
   27 |   if ( press(conseq[i]+conseq[(i+1)%3]+conseq[(i+2)%3])==3){S += conseq[i]+conseq[(i+1)%3]+conseq[(i+2)%3];break ;}
      |        ^~~~~
combo.cpp:32:22: error: 'press' was not declared in this scope
   32 |   if (i!= doubled && press(conseq[i]+conseq[doubled]+conseq[doubled])==3){S += conseq[i]+conseq[doubled]+conseq[doubled];break ;}
      |                      ^~~~~