Submission #810599

#TimeUsernameProblemLanguageResultExecution timeMemory
810599oscar1fCombo (IOI18_combo)C++17
100 / 100
28 ms548 KiB
#include<bits/stdc++.h> #include "combo.h" using namespace std; //#define int long long string rep,quest; int valQuest; vector<char> lettrePossi; string guess_sequence(int taille) { ios_base::sync_with_stdio(false); cin.tie(0); if (press("AB")>=1) { if (press("A")==1) { lettrePossi={'B','X','Y'}; rep+='A'; } else { lettrePossi={'A','X','Y'}; rep+='B'; } } else { if (press("X")==1) { lettrePossi={'A','B','Y'}; rep+='X'; } else { lettrePossi={'A','B','X'}; rep+='Y'; } } if (taille==1) { return rep; } for (int i=2;i<taille;i++) { quest=""; quest+=rep; quest+=lettrePossi[0]; quest+=rep; quest+=lettrePossi[1]; quest+=lettrePossi[0]; quest+=rep; quest+=lettrePossi[1]; quest+=lettrePossi[1]; quest+=rep; quest+=lettrePossi[1]; quest+=lettrePossi[2]; valQuest=press(quest); if (valQuest==i) { rep+=lettrePossi[0]; } else if (valQuest==i+1) { rep+=lettrePossi[1]; } else { rep+=lettrePossi[2]; } } quest=""; quest+=rep; quest+=lettrePossi[0]; if (press(quest)==taille) { rep+=lettrePossi[0]; return rep; } quest=""; quest+=rep; quest+=lettrePossi[1]; if (press(quest)==taille) { rep+=lettrePossi[1]; return rep; } rep+=lettrePossi[2]; return rep; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...