# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
977250 | aaaaaarroz | Combo (IOI18_combo) | C++17 | 16 ms | 1900 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;
int press(string s);
//Lo hizo el Nova
string guess_sequence(int N){
string s, bottons = "ABXY", box;
if(press("AB")){
if(press("A"))
s = "A";
else
s = "B";
} else{
if(press("X"))
s = "X";
else
s = "Y";
}
for(char c: bottons){
if(c != s[0])
box.push_back(c);
}
if(N==1) return s;
for(int i=0;i<N-2;i++){
string s2;
char add;
for(char c : box)
s2 += s+box[2]+c; // abc (b, c, d) s0 abc, s1 abcc, s2 abcdb abcdc abcdd
int x = press(s+box[1]+s2), y = s.size();
add = box[x-y];
s += add;
}
char add;
if(press(s+box[0]) == s.size()+1)
add = box[0];
else{
if(press(s+box[1]) == s.size()+1)
add = box[1];
else
add = box[2];
}
s += add;
return s;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |