# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1074240 |
2024-08-25T09:00:08 Z |
deera |
Wombats (IOI13_wombats) |
C++14 |
|
46 ms |
15964 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[i - 1][j];
for (int j = 0; j < C - 1; j++)
dp[j + 1] = min(dp[j + 1], dp[j] + H[j][i]);
for (int j = C - 2; j >= 0; j--)
dp[j] = min(dp[j], dp[j + 1] + H[j][i]);
}
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 |
11 ms |
8028 KB |
Output is correct |
2 |
Incorrect |
8 ms |
8200 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 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 |
5 ms |
776 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
46 ms |
15964 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
2652 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
4 ms |
776 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |