Submission #433565

#TimeUsernameProblemLanguageResultExecution timeMemory
433565ApiramCombo (IOI18_combo)C++14
10 / 100
87 ms440 KiB
#include<bits/stdc++.h> #include "combo.h" using namespace std; std::string guess_sequence(int N) { int counts=0; string p; string k = "ABXY"; for (int i =0;i<4;++i){ if (press(p+k[i])>counts){ counts++; p+=k[i]; k.erase(i,1); break; } } while(p.length()<N){ for (auto c:k) if (press(p+c)>counts){ counts++; p+=c; break; } } return p; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:16:19: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   16 |   while(p.length()<N){
      |         ~~~~~~~~~~^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...