# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
701021 | BobCompetitiveProgramming | Combo (IOI18_combo) | C++14 | 53 ms | 572 KiB |
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 <bits/stdc++.h>
using namespace std; using ll=long long;
/*
int press(string s){
cout << " IN PRESS, ans with string s = " << s << endl;
ll ret; cin>>ret;
return ret;
}
*/
int press(std::string p);
string guess_sequence(int N){
string S = "", first;
vector<string> buttons{"A", "B", "X", "Y"};
for(auto& button : buttons)
if(button=="Y" || press(button)){
first = button, S += button;
break;
}
while(true){
if(S.size() == N)
return S;
for(auto& button : buttons) {
if(button == first)
continue;
if(button=="Y" || press(S + button) > S.size()) {
S += button;
break;
}
}
}
}
/*
int main(){
guess_sequence(5);
}
*/
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |