# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
563672 | Error42 | Arranging Shoes (IOI19_shoes) | C++14 | 94 ms | 16464 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 "shoes.h"
#include <iostream>
#include <vector>
using namespace std;
#define int long long
#define pb push_back
#define mp make_pair
int n;
vector<int> val;
vector<int> diff; // diff[i] = value(i) - value(i - 1)
vector<int> segtree;
int range_query(int v, int vl, int vr, int ql, int qr) {
if (ql > vr || qr < vl) {
return 0;
}
if (vl == ql && vr == qr) {
return segtree[v];
}
int mid = (vl + vr) / 2;
return range_query(2 * v, vl, mid, ql, min(qr, mid))
+ range_query(2 * v + 1, mid + 1, vr, max(ql, mid + 1), qr);
}
int query(int pos) {
return range_query(1, 1, 2 * n + 1, 1, pos);
}
# | 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... |