# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
477028 | glome | Combo (IOI18_combo) | C++17 | 83 ms | 536 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;
std::string guess_sequence(int N) {
set<int> s;
s.insert('A');
s.insert('B');
s.insert('X');
string S;
for (int i = 0; i<N; i++) {
if(i == 0) {
bool ok = 0;
for (char c : s) {
if(press(string(1, c))) {
S.push_back(c);
s.erase(c);
ok = 1;
break;
}
}
if(!ok) {
S.push_back('Y');
}
continue;
}
bool ok = 0;
for (char c : s) {
if(press(S + c) == S.size() + 1) {
S.push_back(c);
ok = 1;
break;
}
}
if(!ok) {
S.push_back('Y');
}
}
return S;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |