# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
293821 | Saboon | Combo (IOI18_combo) | C++17 | 1 ms | 200 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 "combo.h"
#include <bits/stdc++.h>
using namespace std;
map<char,char> mp;
string guess_sequence(int n){
string p;
if (press("AB") > 0){
if (press("A")) p = "A";
else p = "B";
}
else{
if (press("X")) p = "X";
else p = "Y";
}
char fi = p[0];
mp['A'] = 'A', mp['B'] = 'B', mp['X'] = 'X', mp['Y'] = 'Y';
mp[fi] = 'A', mp['A'] = fi;
for (int i = 1; i < n-1; i++){
string Tmp = (p + mp['B']) + (p+mp['X']+mp['B']) + (p+mp['X']+mp['X']) + (p+mp['X']+mp['Y']);
int t = press(Tmp);
if (t == p.size())
p += mp['Y'];
else if (t == p.size()+1)
p += mp['B'];
else
p += mp['X'];
}
if (press(p+mp['B']) == n)
p += 'B';
else if (press(p+mp['X']) == n)
p += 'X';
else
p += 'Y';
return p;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |