# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
529779 | Alex_tz307 | JJOOII 2 (JOI20_ho_t2) | C++17 | 136 ms | 45652 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>
#define INF 0x3f3f3f3f
using namespace std;
const int kN = 2e5;
const int kLog = 17;
int n, k, nxt[3][1 + kN][1 + kLog], nxt2[3][1 + kN];
string s;
void minSelf(int &x, int y) {
if (y < x) {
x = y;
}
}
void build(int t) {
nxt[t][n][0] = n;
nxt2[t][n] = n;
for (int i = n - 1; i >= 0; --i) {
if (i + 1 < n && s[i + 1] - '0' == t) {
nxt[t][i][0] = i + 1;
} else {
nxt[t][i][0] = nxt[t][i + 1][0];
}
if (s[i] - '0' == t) {
nxt2[t][i] = i;
} else {
nxt2[t][i] = nxt2[t][i + 1];
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |