Submission #480648

#TimeUsernameProblemLanguageResultExecution timeMemory
480648couplefireCombo (IOI18_combo)C++17
5 / 100
1 ms216 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; string guess_sequence(int n){ string cur = ""; vector<string> c = {"A", "B", "X", "Y"}; if(press(c[0]+c[1])) if(press(c[0])) cur = c[0]; else cur = c[1], swap(c[0], c[1]); else if(press(c[2])) cur = c[2], swap(c[0], c[2]); else cur = c[3], swap(c[3], c[0]); for(int i = 2; i<=n-1; ++i){ int res = press(cur+c[1]+cur+c[2]+c[1]+cur+c[2]+c[2]+cur+c[2]+c[3]); if(res==(int)cur.size()+1) cur += c[1]; else if(res==(int)cur.size()+2) cur += c[2]; else cur += c[3]; } if(press(cur+c[1])==n) cur += c[1]; else if(press(cur+c[2])==n) cur += c[2]; else cur += c[3]; return cur; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...