# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
489451 | QuantumK9 | Combo (IOI18_combo) | C++17 | 46 ms | 444 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;
string guess_sequence(int N) {
// guess the first letter: this will take at MOST two moves
string start = "";
int coins = press("AB");
if ( coins > 0 ){
coins = press("A");
if ( coins > 0 ){ start = "A"; }
else{ start = "B"; }
}
else{
coins = press("X");
if ( coins > 0 ){ start = "X"; }
else{ start = "Y"; }
}
// guess the succeeding letters --> current method needs two guesses / letter
string check[3];
int ind = 0;
if ( "A" != start ){ check[ind] = "A"; ind++; }
if ( "B" != start ){ check[ind] = "B"; ind++; }
if ( "X" != start ){ check[ind] = "X"; ind++; }
if ( "Y" != start ){ check[ind] = "Y"; ind++; }
for ( int i = 1; i < N; i++ ){
coins = press( start+check[0] );
if ( coins == start.length()+1 ){ start += check[0]; }
else{
coins = press( start+check[1] );
if ( coins == start.length()+1 ){ start += check[1]; }
else{ start += check[2]; }
}
}
//cout << start << endl;
return start;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |