# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
979196 | chautanphat | Toll (BOI17_toll) | C++14 | 3056 ms | 25668 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;
const int N = 5e4;
struct query
{
int a, b, id, ans;
} queries[N];
int k, n, m, o, cost[N][5][5];
void dnc(int l, int r, int level = 0)
{
if (l == r) return;
int mid = (l+r)/2, L[n/k+1][k][k], R[n/k+1][k][k];
for (int i = l; i <= r; i++)
for (int a = 0; a < k; a++)
for (int b = 0; b < k; b++)
L[i][a][b] = R[i][a][b] = 1e9;
for (int a = 0; a < k; a++)
L[mid][a][a] = 0;
for (int i = mid-1; i >= l; i--)
for (int a = 0; a < k; a++)
for (int b = 0; b < k; b++)
for (int c = 0; c < k; c++)
L[i][a][c] = min(L[i][a][c], L[i+1][b][c]+cost[i][a][b]);
for (int a = 0; a < k; a++)
for (int b = 0; b < k; b++)
R[mid+1][a][b] = cost[mid][a][b];
# | 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... |