Submission #127676

#TimeUsernameProblemLanguageResultExecution timeMemory
127676ShushCombo (IOI18_combo)C++17
97 / 100
54 ms504 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; vector<char> b = {'A', 'B', 'X', 'Y'}; string guess_sequence(int N) { int n = N; string p = ""; for(int i = 0; i < 3; i++){ if(press(p + b[i])) { p += b[i]; b.erase(b.begin() + i); break; } } if(p == ""){ p += b[3]; b.erase(b.begin() + 3); } for(int i = 1; i < n - 1; i++){ int x = press(p + b[0] + p + b[1] + b[0] + p + b[1] + b[1] + p + b[1] + b[2]) - p.size(); if(x == 0) p+= b[2]; if(x == 1) p+= b[0]; if(x == 2) p+= b[1]; // cerr << p << "\n"; } if(n > 1){ for(int i = 0; i < 2; i++){ // cerr << p + b[i] << "\n"; if(press(p + b[i]) - p.size()) return p + b[i]; } // cerr << p + b[2] << "\n"; return p + b[2]; } return p; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...