#include "wombats.h"
#include<bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
const int N = 405;
int n, m, d[N][N];
int get (int x, int y) {
return x * m + y;
}
void init(int R, int C, int H[5000][200], int V[5000][200]) {
n = R; m = C;
for (int i = 0; i < n * m; i++) {
for (int j = 0; j < n * m; j++) d[i][j] = 1e9;
}
for (int i = 0; i < n; i++) {
for (int j = 0; j < m - 1; j++) {
d[get(i, j)][get(i, j + 1)] = d[get(i, j + 1)][get(i, j)] = H[i][j];
}
}
for (int i = 0; i < n - 1; i++) {
for (int j = 0; j < m; j++) {
d[get(i, j)][get(i + 1, j)] = V[i][j];
}
}
for (int k = 0; k < n * m; k++) {
for (int i = 0; i < n * m; i++) {
for (int j = 0; j < n * m; j++) d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
}
}
}
void changeH(int P, int Q, int W) {
}
void changeV(int P, int Q, int W) {
}
int escape(int V1, int V2) {
return d[get(0, V1)][get(n - 1, V2)];
}
Compilation message
grader.c: In function 'int main()':
grader.c:15:6: warning: variable 'res' set but not used [-Wunused-but-set-variable]
15 | int res;
| ^~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
7 ms |
13404 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
2396 KB |
Output is correct |
2 |
Correct |
0 ms |
2396 KB |
Output is correct |
3 |
Correct |
1 ms |
2396 KB |
Output is correct |
4 |
Correct |
48 ms |
4444 KB |
Output is correct |
5 |
Correct |
48 ms |
4444 KB |
Output is correct |
6 |
Correct |
48 ms |
4444 KB |
Output is correct |
7 |
Correct |
48 ms |
4444 KB |
Output is correct |
8 |
Correct |
36 ms |
4444 KB |
Output is correct |
9 |
Correct |
41 ms |
4600 KB |
Output is correct |
10 |
Correct |
41 ms |
4440 KB |
Output is correct |
11 |
Correct |
92 ms |
6940 KB |
Output is correct |
12 |
Correct |
47 ms |
4440 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
7 ms |
9052 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
9 ms |
17496 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
6 ms |
9052 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
7 ms |
9052 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |