Submission #849483

#TimeUsernameProblemLanguageResultExecution timeMemory
849483Bach21Combo (IOI18_combo)C++14
10 / 100
27 ms1456 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; const int m=4; string gue="ABXY"; string guess_sequence(int N) { string s=""; string tmp=""; int cnt=0; for (int i=0;i<N;i++) { for (int trie = 0; trie < gue.size(); trie++) { tmp = s; tmp += gue[trie]; cnt = press(tmp); if (cnt > s.size()) { s+=gue[trie]; if (i==0) gue.erase(gue.begin()+trie); break; } } } return s; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:11:33: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 |         for (int trie = 0; trie < gue.size(); trie++) {
      |                            ~~~~~^~~~~~~~~~~~
combo.cpp:15:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   15 |             if (cnt > s.size()) {
      |                 ~~~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...