# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
484806 | MohamedFaresNebili | Combo (IOI18_combo) | C++14 | 69 ms | 256 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>
#pragma GCC optimize ("Ofast")
#pragma GCC target ("avx2")
#include "combo.h"
using namespace std;
using ll = long long;
using vi = vector<int>;
#define pb push_back
#define ff first
#define ss second
#define lb lower_bound
#define all(x) (x).begin() , (x).end()
string guess_sequence(int N) {
string lett = "ABXY";
string p = ""; int first;
for(int l = 0; l < 4; l++) {
p = "";
for (int i = 0; i < N; ++i) p += lett[l];
if(press(p)) {
first = l;
break;
}
}
for(int i = 1; i < N; i++) {
bool found = 0;
for(int l = 0; l < 3; l++) {
if(l == first) continue;
p[i] = lett[l];
if(press(p) == i+1) { found = 1; break; }
}
if(!found) p[i] = lett[3];
}
return p;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |