# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
245144 | m3r8 | Toll (BOI17_toll) | C++14 | 178 ms | 69880 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 <stdio.h>
#define N 50100
int bst[N][17][5];
int nm[N][17][5];
int adj[N][5];
int k;
int solve(int st, int en){
int mx = -1;
if(st == en)return 0;
if(st/k == en/k)return -1;
for(int i = 16;i>=0;i--){
if(nm[st][i][0]/k <= en/k){
for(int j = 0;j<k;j++){
int tmp = solve(nm[st][i][j],en);
if(tmp != -1){
if(bst[st][i][j] != -1){
if(mx == -1 || mx > bst[st][i][j] + tmp){
mx = bst[st][i][j] + tmp;
};
};
};
};
break;
};
};
return mx;
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... |