Submission #728882

#TimeUsernameProblemLanguageResultExecution timeMemory
728882ToxtaqCombo (IOI18_combo)C++17
30 / 100
43 ms472 KiB
#include <bits/stdc++.h> using namespace std; int press(std::string p); std::string guess_sequence(int N){ int n = N; string res = "", s; if(press("A")){ res += 'A'; s = "BXY"; } else if(press("B")){ res += 'B'; s = "AXY"; } else if(press("X")){ res += 'X'; s = "ABY"; } else{ res += 'Y'; s = "ABX"; } for(int i = 1;i < n;++i){ bool ok = 0; for(int j = 0;j < 2;++j){ res += s[j]; if(press(res) == res.size()){ ok = 1; break; } res.pop_back(); } if(!ok){ res += s[2]; } } return res; }

Compilation message (stderr)

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