Submission #167324

#TimeUsernameProblemLanguageResultExecution timeMemory
167324muhammad_hokimiyonCombo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
# include <bits/stdc++.h> using namespace std; string guess_sequence( int N ) { string s; vector < string > t; if( press( "AB" ) > 0 ){ if( press( "A" ) == 1 ){ s = "A"; t = { "B" , "X" , "Y" }; } else{ s = "B"; t = { "B" , "X" , "Y" }; } } else{ if( press( "X" ) == 1 ){ s = "X"; t = { "A" , "B" , "Y" }; } else{ s = "Y"; t = { "A" , "B" , "X" }; } } if( N == 1 )return s; for( int i = 1; i < N - 1; i++ ){ string g = s + t[0] + s + t[1] + t[0] + s + t[1] + t[1] + s + t[1] + t[2]; int c = press(g); if( c == i )s += t[2]; else if( c == i + 1 )s += t[0]; else s += t[1]; } if( press( s + "A" + s + "B" ) == N ){ if( press( s + "A" ) == 1 ){ s += "A"; } else{ s += "B"; } } else{ if( press( s + "X" ) == N ){ s += "X"; } else{ s += "Y"; } } return s; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:9:9: error: 'press' was not declared in this scope
    9 |     if( press( "AB" ) > 0 ){
      |         ^~~~~
combo.cpp:32:17: error: 'press' was not declared in this scope
   32 |         int c = press(g);
      |                 ^~~~~
combo.cpp:37:9: error: 'press' was not declared in this scope
   37 |     if( press( s + "A" + s + "B" ) == N ){
      |         ^~~~~