Submission #1196418

#TimeUsernameProblemLanguageResultExecution timeMemory
1196418ffeyyaae_Combo (IOI18_combo)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
#include combo.h

using namespace std;

string guess_sequence( int N )
{
    string s = "";
    string a = "ABXY", bt = "";
    if( press("A") ) s += "A";
    else if( press("B") ) s += "B";
    else if( press("X") ) s += "X";
    else s += "Y";
    if( N == 1 ) return s;
    for( auto c : a ) if( s != a ) bt += c;
    for( int i=1;i<N;i++ )
    {
        string tp = s+bt[0] + s+bt[1]+bt[0] + s+bt[1]+bt[1] + s+bt[1]+bt[2];
        if( press(tp) == 1 ) s += bt[0];
        else if( press(tp) == 2 ) s += bt[1];
        else s += bt[2];
    }
    if( press(s+bt[0]) ) s += bt[0];
    else if( press(s+bt[1]) ) s += bt[1];
    else s += bt[2];
    return s;
}

Compilation message (stderr)

combo.cpp:2:10: error: #include expects "FILENAME" or <FILENAME>
    2 | #include combo.h
      |          ^~~~~
combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:10:9: error: 'press' was not declared in this scope
   10 |     if( press("A") ) s += "A";
      |         ^~~~~
combo.cpp:19:13: error: 'press' was not declared in this scope
   19 |         if( press(tp) == 1 ) s += bt[0];
      |             ^~~~~
combo.cpp:23:9: error: 'press' was not declared in this scope
   23 |     if( press(s+bt[0]) ) s += bt[0];
      |         ^~~~~