# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
436382 | stoyan_malinin | Combo (IOI18_combo) | C++14 | 89 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 <iostream>
#include <vector>
#include <string>
#include "combo.h"
#ifdef __LOCAL
#include "grader.cpp"
#endif // __LOCAL
using namespace std;
char extend(string &ans)
{
const vector <char> options = {'A', 'B', 'X', 'Y'};
for(char c: options)
{
if(ans.size()!=0 && ans[0]==c) continue;
if(press(ans+c)==ans.size()+1) return c;
}
}
string guess_sequence(int N)
{
string ans = "";
for(int i = 0;i<N;i++) ans += extend(ans);
return ans;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |