Submission #133410

#TimeUsernameProblemLanguageResultExecution timeMemory
133410redaCombo (IOI18_combo)C++14
5 / 100
68 ms256 KiB
#include<bits/stdc++.h> #include "combo.h" using namespace std ; string guess_sequence(int N) { if(N==3) { string ans=""; string use[4]={"A","B","X","Y"}; int g=-1; string t; for(int i=0;i<4;i++) { if(press(use[i])>g) { g=press(use[i]); t=use[i]; } } ans+=t; string s; if(t=="A")s="BXY"; if(t=="B")s="AXY"; if(t=="X")s="ABY"; if(t=="Y")s="ABX"; int i=0; int pv=press(ans); while (ans.size()<3) { string C; C=ans; C+=s[i]; int k =press(C); if(k>pv) { ans+=s[i]; pv=k; } else i++; i=i%3; } return ans; } }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:45:1: warning: control reaches end of non-void function [-Wreturn-type]
   45 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...