Submission #303697

#TimeUsernameProblemLanguageResultExecution timeMemory
303697GilgameshCombo (IOI18_combo)C++17
Compilation error
0 ms0 KiB
#include "combo.h" std::string guess_sequence(int N) { std::string strs[4] = {"A", "B", "X", "Y"}; string ans = ""; if(N == 3){ while(N--){ for(int i = 0; i < 4; ++i){ int cur = press(ans + strs[i]); if(cur) { ans += strs[i]; break; } } } } return S; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:5:5: error: 'string' was not declared in this scope
    5 |     string ans = "";
      |     ^~~~~~
combo.cpp:5:5: note: suggested alternatives:
In file included from /usr/include/c++/10/string:39,
                 from combo.h:3,
                 from combo.cpp:1:
/usr/include/c++/10/bits/stringfwd.h:79:33: note:   'std::string'
   79 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included from combo.h:3,
                 from combo.cpp:1:
/usr/include/c++/10/string:67:11: note:   'std::pmr::string'
   67 |     using string    = basic_string<char>;
      |           ^~~~~~
combo.cpp:9:33: error: 'ans' was not declared in this scope; did you mean 'abs'?
    9 |                 int cur = press(ans + strs[i]);
      |                                 ^~~
      |                                 abs
combo.cpp:17:12: error: 'S' was not declared in this scope
   17 |     return S;
      |            ^