Submission #894417

#TimeUsernameProblemLanguageResultExecution timeMemory
894417AtabayRajabliCombo (IOI18_combo)C++17
10 / 100
26 ms1480 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; string guess_sequence(int N) { string p = "ABXY"; string res = ""; if(press("A"))res = "A"; else if(press("B"))res = "B"; else if(press("X"))res = "X"; else res = "Y"; while(res.size() < N) { for(char c : p) { if(c == res[0])continue; if(press(res + c) == res.size() + 1) { res += c; break; } } } return res; }

Compilation message (stderr)

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