Submission #286966

#TimeUsernameProblemLanguageResultExecution timeMemory
286966infinite_iqCombo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std ;
//#include "combo.h"
int n ;
string ans , but = "ABXY" , ret ;
int query ( string s ) {
        return press (s) ;
}
void solve () {
        string crnt = "" ;
        for ( int i = 0 ; i < 3 ; i ++ ) {
                crnt += ans ;
                crnt += ret [0] ;
                crnt += ret [i] ;
        }
        crnt += ans ;
        crnt += ret [1] ;
        int x = query ( crnt ) ;
        x -= ans .size () ;
        if ( x == 0 ) {
                ans += ret [2] ;
        }
        if ( x == 1 ) {
                ans += ret [1] ;
        }
        if ( x == 2 ) {
                ans += ret [0] ;
        }
}
string guess_sequence ( int N ) {
        n = N ;
        if ( query ( "AB" ) ) {
                if ( query ( "A" ) ) ans += 'A' ;
                else                 ans += 'B' ;
        }
        else {
                if ( query ( "X" ) ) ans += 'X' ;
                else                 ans += 'Y' ;
        }
        for ( int i = 0 ; i < 4 ; i ++ ) {
                if ( but [i] != ans [0] )
                        ret += but [i] ;
        }
        for ( int i = 1 ; i < n - 1 ; i ++ ) solve () ;
        string crnt = "" ;
        crnt += ans ;
        crnt += ret [0] ;
        crnt += ans ;
        crnt += ret [1] ;
        if ( query ( crnt ) - ans .size () == 0 ) {
                ans += ret [2] ;
        }
        else {
                crnt = "" ;
                crnt += ans ;
                crnt += ret [0] ;
                if ( query ( crnt ) - ans .size () == 0 ) {
                        ans += ret [1] ;
                }
                else ans += ret [0] ;
        }
        return ans ;
}

Compilation message (stderr)

combo.cpp: In function 'int query(std::string)':
combo.cpp:7:16: error: 'press' was not declared in this scope
    7 |         return press (s) ;
      |                ^~~~~