Submission #988702

#TimeUsernameProblemLanguageResultExecution timeMemory
988702MighilonCombo (IOI18_combo)C++17
0 / 100
1 ms344 KiB
#include <combo.h> #include <bits/stdc++.h> using namespace std; #define trav(a, x) for(auto &a: x) #define sz(x) (int)x.size() string guess_sequence(int n){ string a="ABXY", b="AB", d, s; if(!press("AB")) d="XY"; char fc = b[0]; if(!press(b.substr(0, 1))) fc=b[1]; trav(c, a) if(c!=fc) d+=c; s+=fc; if(n<=1) return s; while(sz(s)<n-1) s+=d[press(s+d[1]+s+d[2]+d[0]+s+d[2]+d[1]+s+d[2]+d[2])-sz(s)]; if(press(s+d[0]+s+d[1])>sz(s)){ if(press(s+d[0])) return s+d[0]; return s+d[1]; } return s+d[2]; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...