Submission #600690

#TimeUsernameProblemLanguageResultExecution timeMemory
600690enerelt14Combo (IOI18_combo)C++14
5 / 100
1 ms336 KiB
#include "combo.h" #include<bits/stdc++.h> using namespace std; string guess_sequence(int N){ string ans, x; for (int i=0;i<N;i++){ if (i==0){ if (press("AB")>0){ if (press("A")>0){ ans="A"; x="BXY"; } else{ ans="B"; x="AXY"; } continue; } if (press("X")>0){ ans="X"; x="ABY"; } else{ ans="Y"; x="ABX"; } continue; } if (N==1)return ans; if (i==N-1){ if (press(ans+x[0])==N)return ans+x[0]; if (press(ans+x[1])==N)return ans+x[1]; return ans+x[2]; } int y=press(ans+x[0]+ans+x[1]+x[0]+ans+x[1]+x[2]+ans+x[1]+x[1]); if (y==i)ans+=x[2]; if (y==i+1)ans+=x[0]; if (y==i+2)ans+=x[1]; } }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:5:12: warning: control reaches end of non-void function [-Wreturn-type]
    5 |     string ans, x;
      |            ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...