Submission #744892

#TimeUsernameProblemLanguageResultExecution timeMemory
744892teo_thrashCombo (IOI18_combo)C++14
5 / 100
1 ms208 KiB
#include<bits/stdc++.h> #include "combo.h" using namespace std; string guess_sequence(int n) { string p="AB", a="ABXY"; string S, curr; vector<char> let; if(!press("AB")){ p="XY"; } char c=p[0]; if(!press(p.substr(0, 1))){ c=p[1]; } S+=c; for(int i=0; i<a.size(); i++){ if(a[i]!=c){ let.push_back(a[i]); } } int coins=0; for(int i=2; i<n; i++){ curr=S+let[0]+let[0] + S+let[0]+let[1] + S+let[0]+let[2] + S+let[1]; coins=press(curr); if(coins==i+1){ S+=let[0]; }else{ if(coins==i){ S+=let[1]; }else{ S+=let[2]; } } } if(press(S+let[0])==n){ S+=let[0]; }else{ if(press(S+let[1])==n){ S+=let[1]; }else{ S+=let[2]; } } return S; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:21:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   21 |     for(int i=0; i<a.size(); i++){
      |                  ~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...