| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1100376 | akzytr | Combo (IOI18_combo) | C++17 | 1 ms | 336 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 <bits/stdc++.h>
using namespace std;
template <typename T> using ve = vector<T>;
template <typename T, int sz> using ar = array<T, sz>;
typedef long long ll;
#define pb push_back
#define fi first
#define se second
#define endl '\n'
int press(string p);
string guess_sequence(int N) {
string s = "";
ve<char> lst;
for(char j : {'A', 'B', 'X', 'Y'}) {
lst.pb(j);
}
for(char j : lst) {
int sc = press(s + j);
if(sc == 1) {
s += j;
break;
} else if(j == lst[lst.size() - 2]) {
s += lst[lst.size() - 1];
break;
}
}
for(int i = 1; i < N - 1; i++) {
ve<char> lst;
for(char j : {'A', 'B', 'X', 'Y'}) {
if(j == s[0]) {
continue;
}
lst.pb(j);
}
string q = "";
q += s + lst[0];
q += s + lst[1] + lst[0];
q += s + lst[1] + lst[1];
q += s + lst[1] + lst[2];
int score = press(q);
if(score == s.size() + 1) {
s += lst[0];
} else if(score == s.size()) {
s += lst[2];
} else if(score == s.size() + 2) {
s += lst[1];
}
}
lst.clear();
for(char j : {'A', 'B', 'X', 'Y'}) {
if(j == s[0]) {
continue;
}
lst.pb(j);
}
for(char j : lst) {
int sc = press(s + j);
if(sc == N) {
s += j;
break;
} else if(j == lst[lst.size() - 2]) {
s += lst[lst.size() - 1];
break;
}
}
return s;
}
Compilation message (stderr)
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
