Submission #701019

#TimeUsernameProblemLanguageResultExecution timeMemory
701019BobCompetitiveProgrammingCombo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; using ll=long long; /* int press(string s){ cout << " IN PRESS, ans with string s = " << s << endl; ll ret; cin>>ret; return ret; } */ string guess_sequence(int N){ string S = "", first; vector<string> buttons{"A", "B", "X", "Y"}; for(auto& button : buttons) if(press(button)) first = button, S += button; while(true){ if(S.size() == N) return S; for(auto& button : buttons) if(button != first && press(S + button) > S.size()) S += button; } } /* int main(){ guess_sequence(5); } */

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:16:12: error: 'press' was not declared in this scope
   16 |         if(press(button))
      |            ^~~~~
combo.cpp:20:21: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   20 |         if(S.size() == N)
      |            ~~~~~~~~~^~~~
combo.cpp:24:35: error: 'press' was not declared in this scope
   24 |             if(button != first && press(S + button) > S.size())
      |                                   ^~~~~