# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
387043 | keko37 | Road Construction (JOI21_road_construction) | C++14 | 7012 ms | 41044 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;
typedef long long llint;
typedef pair <int, int> pi;
const int MAXN = 250005;
const int LOG = 18;
int n, k;
int x[MAXN], y[MAXN], sx[MAXN], sy[MAXN], fen[MAXN], ind[MAXN];
vector <llint> sazx, sazy, vx[MAXN], vy[MAXN], sol;
void ubaci (int x, int k) {
for (x++; x < MAXN; x += x&-x) fen[x] += k;
}
int upit (int x) {
int res = 0;
for (x++; x > 0; x -= x&-x) res += fen[x];
return res;
}
int kth (int br) {
int pos = 0;
for (int i = LOG - 1; i >= 0; i--) {
if (pos + (1 << i) < MAXN && br > fen[pos + (1 << i)]) {
pos += 1 << i;
br -= fen[pos];
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |