Submission #1021008

#TimeUsernameProblemLanguageResultExecution timeMemory
1021008SolikhaCombo (IOI18_combo)C++17
0 / 100
33 ms344 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; string guess_sequence(int N) { string s = "", t = "ABXY", tmp = ""; for(int i = 0; i < 4; i++){ if(press(s + t[i]) == 1){ s += t[i]; } } for(int i = 0; i < 4; i++){ if (t[i] != s[0]) tmp += t[i]; } while(press(s) != N){ for(int i = 0; i < 3; i++){ if(press(s + tmp[i]) == s.size() + 1){ s += tmp[i]; break; } } } return s; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:20:28: 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(s + tmp[i]) == s.size() + 1){
      |          ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...