Submission #436382

#TimeUsernameProblemLanguageResultExecution timeMemory
436382stoyan_malininCombo (IOI18_combo)C++14
10 / 100
89 ms444 KiB
#include <iostream> #include <vector> #include <string> #include "combo.h" #ifdef __LOCAL #include "grader.cpp" #endif // __LOCAL using namespace std; char extend(string &ans) { const vector <char> options = {'A', 'B', 'X', 'Y'}; for(char c: options) { if(ans.size()!=0 && ans[0]==c) continue; if(press(ans+c)==ans.size()+1) return c; } } string guess_sequence(int N) { string ans = ""; for(int i = 0;i<N;i++) ans += extend(ans); return ans; }

Compilation message (stderr)

combo.cpp: In function 'char extend(std::string&)':
combo.cpp:19:24: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   19 |         if(press(ans+c)==ans.size()+1) return c;
      |            ~~~~~~~~~~~~^~~~~~~~~~~~~~
combo.cpp:14:54: warning: control reaches end of non-void function [-Wreturn-type]
   14 |     const vector <char> options = {'A', 'B', 'X', 'Y'};
      |                                                      ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...