# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
936970 | MuntherCarrot | Combo (IOI18_combo) | C++14 | 1 ms | 596 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>
#include "combo.h"
using namespace std;
// int press(string s)
string s = "ABXY";
string guess_sequence(int N){
string ans;
int x = 0;
if(press("AB")){
if(press("B")) swap(s[0], s[1]);
}
else{
if(press("X")) swap(s[0], s[2]);
else swap(s[0], s[3]);
}
ans = s[0];
while((int)ans.size() < N - 1){
string f = ans + s[1] + ans + s[2] + s[1] + ans + s[2] + s[2] + ans + s[2] + s[3];
int res = press(f);
if(res == (int)ans.size()){
ans += s[3];
}
else if(res == (int)ans.size() + 1){
ans += s[1];
}
else{
ans += s[2];
}
}
if(press(ans + s[1]) == N) ans += s[1];
else if(press(ans + s[2]) == N) ans += s[2];
else ans += s[3];
return ans;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |