Submission #75720

#TimeUsernameProblemLanguageResultExecution timeMemory
75720rzbtCombo (IOI18_combo)C++14
100 / 100
51 ms508 KiB
#include <bits/stdc++.h> #include "combo.h" std::string guess_sequence(int n) { std::string osnova,res,q; q.resize(4*n+5); if(press("AB")){ if(press("A")) osnova="A"; else osnova="B"; }else{ if(press("X")) osnova="X"; else osnova="Y"; } if(n==1)return osnova; int brojac=0; std::string kul[5]; if(osnova!="A") kul[brojac++]="A"; if(osnova!="B") kul[brojac++]="B"; if(osnova!="X") kul[brojac++]="X"; if(osnova!="Y") kul[brojac++]="Y"; for(int i=1;i<n-1;i++){ int t=press(osnova+kul[0]+kul[0]+ osnova+kul[0]+kul[1]+ osnova+kul[0]+kul[2]+ osnova+kul[1]); if(t==i+2)osnova+=kul[0]; else if(t==i+1)osnova+=kul[1]; else osnova+=kul[2]; } if(press(osnova+kul[0])==n)return osnova+kul[0]; else if(press(osnova+kul[1])==n)return osnova+kul[1]; else return osnova+kul[2]; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...