# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
185339 | oofsauce | Combo (IOI18_combo) | C++14 | 1 ms | 244 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) {
string search = "ABXY";
int idx = 0;
if(press("AB") == 0) idx = 2;
if(press(search[idx] + "")) idx ++;
// cout << search[idx];
string X = "";
X.push_back(search[idx]);
if(N == 1) return X;
string ss = "";
for(char c: search)
if(c != search[idx])
ss.push_back(c);
while(X.size() < N-1) {
// string query = "";
cout << (X+ss[1]) + (X+ss[2]+ss[0]) + (X+ss[2]+ss[1]) + (X+ss[2]+ss[2]) << endl;
int c = press((X+ss[1]) + (X+ss[2]+ss[0]) + (X+ss[2]+ss[1]) + (X+ss[2]+ss[2]) );
X += ss[c-(X.size())];
}
idx = 0;
if(press(X+"AB") == N-1) idx = 2;
if(press(X + search[idx])) idx ++;
X.push_back(search[idx]);
// int coins = press(p);
return X;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |