Submission #116186

#TimeUsernameProblemLanguageResultExecution timeMemory
116186mirbek01Combo (IOI18_combo)C++11
10 / 100
101 ms440 KiB
# include <bits/stdc++.h> # include "combo.h" using namespace std; string t = "ABXY"; string guess_sequence(int N) { string ans; int ret = press("A"); if(ret) ans = "A"; ret = press("B"); if(ret) ans = "B"; ret = press("X"); if(ret) ans = "X"; ret = press("Y"); if(ret) ans = "Y"; for(int i = 1; i < N; i ++){ for(int j = 0; j < 4; j ++){ if(t[j] == ans[0]) continue; ans += t[j]; ret = press(ans); if(ret != ans.size()){ ans.pop_back(); } else { break; } } } return ans; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:30:26: 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(ret != ans.size()){
      |                      ~~~~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...