Submission #706011

#TimeUsernameProblemLanguageResultExecution timeMemory
706011mseebacherCombo (IOI18_combo)C++17
0 / 100
0 ms208 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; string guess_sequence(int n) { string s = ""; vector<char> se = {'A','B','X','Y'}; if(press("A")){ s = "A"; }else if(press("B")){ s = "B"; }else if(press("X")){ s = "X"; }else{ s = "Y"; } se.erase(find(se.begin(),se.end(),s[0])); while(s.length() != n){ string zwischen = s+se[0]+se[0]+s+se[0]+se[1]+s+se[0]+se[2]+s+se[1]; int erg = press(zwischen); if(erg == 2){ s+=se[0]; }else if(erg == 1){ s+=se[1]; }else{ s+=se[0]; } } return s; }

Compilation message (stderr)

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