This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <iostream>
#include "combo.h"
#include <string>
using namespace std;
/* int press(string p){ */
/* int ans; */
/* cin >> ans; */
/* return ans; */
/* cout.flush(); */
/* } */
string guess_sequence(int N) {
string cur = "";
string options = "ABXY";
string ans = "";
for(int i = 1; i <= N; i++) {
for(int j = 0; j < 4; j++){
cur += options[j];
/* cout << cur << endl; */
int ans_ = press(cur);
if(ans_ == i) {
ans += options[j];
break;
}
else{
cur.pop_back();
}
}
}
return ans;
}
/* int main () { */
/* int N; */
/* cin >> N; */
/* cout << guess_sequence(N) << '\n'; */
/* } */
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |