Submission #477028

#TimeUsernameProblemLanguageResultExecution timeMemory
477028glomeCombo (IOI18_combo)C++17
10 / 100
83 ms536 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; std::string guess_sequence(int N) { set<int> s; s.insert('A'); s.insert('B'); s.insert('X'); string S; for (int i = 0; i<N; i++) { if(i == 0) { bool ok = 0; for (char c : s) { if(press(string(1, c))) { S.push_back(c); s.erase(c); ok = 1; break; } } if(!ok) { S.push_back('Y'); } continue; } bool ok = 0; for (char c : s) { if(press(S + c) == S.size() + 1) { S.push_back(c); ok = 1; break; } } if(!ok) { S.push_back('Y'); } } return S; }

Compilation message (stderr)

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