# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1074253 |
2024-08-25T09:06:39 Z |
deera |
Wombats (IOI13_wombats) |
C++14 |
|
42 ms |
15960 KB |
#include <bits/stdc++.h>
using namespace std;
#include "wombats.h"
const int M = 5000;
const int N = 200;
int R, C;
int H[M][N], V[M][N];
void init(int _R, int _C, int _H[5000][200], int _V[5000][200]) {
R = _R;
C = _C;
for (int i = 0; i < R; i++)
for (int j = 0; j < C - 1; j++)
H[i][j] = _H[i][j];
for (int i = 0; i < R - 1; i++)
for (int j = 0; j < C; j++)
V[i][j] = _V[i][j];
}
void changeH(int P, int Q, int W) {
H[P][Q] = W;
}
void changeV(int P, int Q, int W) {
V[P][Q] = W;
}
int escape(int a, int b) {
int dp[1000];
for (int &x : dp) x = 1e9;
dp[a] = 0;
for (int i = 0; i < R - 1; i++) {
for (int j = 0; i && j < C; j++)
dp[j] += V[j][i - 1];
for (int j = 0; j < C - 1; j++)
dp[j + 1] = min(dp[j + 1], dp[j] + H[i][j]);
for (int j = C - 2; j >= 0; j--)
dp[j] = min(dp[j], dp[j + 1] + H[i][j]);
}
return dp[b];
}
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 |
Correct |
15 ms |
8284 KB |
Output is correct |
2 |
Incorrect |
15 ms |
8284 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
6 ms |
852 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
42 ms |
15960 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
860 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
4 ms |
604 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |