# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
986833 | LucaIlie | Combo (IOI18_combo) | C++17 | 0 ms | 344 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 <iostream>
using namespace std;
char ch[4] = {'A', 'B', 'X', 'Y' };
string s;
string guess_sequence( int n ) {
int coins, i, first_letter, j, verific;
for( i = 0; i < 4; i++ ) {
s = ch[i];
if( press(s) == 1 )
first_letter = i;
}
s = ch[first_letter];
cout << s;
for( i = 1; i < n; i++ ) {
verific = 0;
for( j = 0; j < 4; j++ ) {
if( j == first_letter )
continue;
if( verific < 2 ) {
verific++;
if( press(s + ch[j]) == i + 1 ) {
s = s + ch[j];
cout << ch[j];
break;
}
} else {
s = s + ch[j];
cout << ch[j];
break;
}
}
}
return s;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |