Submission #127111

#TimeUsernameProblemLanguageResultExecution timeMemory
127111redaCombo (IOI18_combo)C++14
0 / 100
111 ms292 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; string guess_sequence(int N) { string t = "" ,v; int a=press("A"),b=press("B"),x=press("X"),y=press("Y"); if(a){t.push_back('A'); v= "BXY"; } if(b){ t.push_back('B'); v= "AXY"; } if(y) { t.push_back('Y'); v="ABX"; } if(x){ t.push_back('X'); v="ABY" ; } int i=0; while(t.size()!=N) { int h=press(t+v[i%N]); if(h)v.push_back(v[i%N]); i++; } return t; }

Compilation message (stderr)

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