Submission #93021

#TimeUsernameProblemLanguageResultExecution timeMemory
93021temoyanteladzeCombo (IOI18_combo)C++14
0 / 100
2 ms200 KiB
#include<bits/stdc++.h> #include "combo.h" using namespace std; string guess_sequence(int n) { string s=""; string ch=""; if (press("A")) { s+="A"; ch="A"; } if (press("B")) { s+="B"; ch="B"; } if (press("X")) { s+="X"; ch="X"; } if (press("Y")) { s+="Y"; ch="Y"; } string t="ABXY"; int k=t.find(ch); t.erase(k,1); for (int i=2;i<=n;i++) { for (int k=0;k<t.size();k++) { if (press(s+t[i])==i) { s+=t[i]; break; } } } return s; }

Compilation message (stderr)

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