Submission #548392

#TimeUsernameProblemLanguageResultExecution timeMemory
548392Killer2501Combo (IOI18_combo)C++14
100 / 100
30 ms552 KiB
#include "combo.h" using namespace std; using ll = long long; using ld = long double; const int N = 3e5 +2; const int base = 31; const int mod = 1e9 +7; int a[4], k; string c[4] = {"A", "B", "X", "Y"}; string guess_sequence(int n) { string res; if(!n)return res; if(press(c[0]+c[1])) { if(press(c[1]))swap(c[0], c[1]); } else if(press(c[2]))swap(c[0], c[2]); else swap(c[0], c[3]); res = c[0]; if(n == 1)return res; for(int i = 2; i < n; i ++) { k = press(res+c[2]+res+c[3]+c[1]+res+c[3]+c[2]+res+c[3]+c[3]); if(k == i-1)res += c[1]; else if(k == i)res += c[2]; else res += c[3]; } if(press(res+c[1]) == n)res += c[1]; else if(press(res+c[2]) == n)res += c[2]; else res += c[3]; return res; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...