# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
486461 | davi_bart | Index (COCI21_index) | C++14 | 2584 ms | 54028 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.
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define int ll
#define fi first
#define se second
#define ld long double
#define pb push_back
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
struct segment {
const int dim = 1 << 18;
struct node {
vector<int> v;
};
vector<node> s = vector<node>(2 * dim);
void upd(int pos, int l, int r, int p, int val) {
if (p < l || r < p) return;
s[pos].v.pb(val);
if (l == r) return;
int m = (l + r) / 2;
upd(2 * pos, l, m, p, val);
upd(2 * pos + 1, m + 1, r, p, val);
}
void upd(int p, int val) {
upd(1, 0, dim - 1, p, val);
}
void init() {
for (auto &k : s) {
sort(k.v.begin(), k.v.end());
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |