# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
450412 | snoop | Toll (BOI17_toll) | C++14 | 206 ms | 22792 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>
#include<math.h>
#define f first
#define s second
#define int long long
using namespace std;
const int N = 5e4 + 5, oo = 1e18;
int t, dist[N][5][5], d[N][5][5], n, k, m, q, ans[N];
vector<int> cur[N];
pair<int, int> p[N];
void solve(int l, int r, vector<int> v) {
if (l == r) return;
int mid = (l + r) / 2;
vector<int> x, y;
for (int i = l; i <= r; i++) cur[i].clear();
for (int i = 0; i < v.size(); i++) {
int ind = v[i];
if (p[ind].s / k <= mid) x.push_back(v[i]);
else if (p[ind].f / k >= mid + 1) y.push_back(v[i]);
else cur[p[ind].s / k].push_back(v[i]);
}
for (int j = 0; j < k; j++) {
for (int x = 0; x < k; x++) {
d[mid + 1][j][x] = 0;
}
}
for (int i = mid; i >= l; i--) {
for (int from = 0; from < k; from++) {
for (int to = 0; to < k; to++) {
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... |