이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#include "wombats.h"
using namespace std;
const int inf = 1e9;
using ll = long long;
constexpr ll infl = 1e18;
int sum = 0;
int r, c;
vector<vector<int>> level;
vector<vector<int>> pass;
void init(int r, int c, int h[5000][200], int v[5000][200]) {
::r = r;
::c = c;
level.resize(r);
for (int i = 0; i < r; i++) {
level[i].resize(c-1);
for (int j = 0; j < c-1; j++) {
level[i][j] = h[i][j];
}
}
pass.resize(r-1);
for (int i = 0; i < r-1; i++) {
pass[i].resize(c);
for (int j = 0; j < c; j++) {
pass[i][j] = v[i][j];
}
}
}
void changeH(int p, int q, int w) {
level[p][q] = w;
}
void changeV(int p, int q, int w) {
pass[p][q] = w;
}
int escape(int v1, int v2) {
vector<ll> dp(c, infl);
dp[v2] = 0;
for (int i = r-1; i >= 0; i--) {
vector<ll> ndp(c, infl);
for (int j = 0; j < c; j++) {
for (ll k = j - 1, sum = 0; k >= 0; k--) {
sum += level[i][k];
ndp[j] = min(ndp[j], dp[k] + sum);
}
for (ll k = j, sum = 0; k < c; k++) {
ndp[j] = min(ndp[j], dp[k] + sum);
if (k < c-1) sum += level[i][k];
}
if (i) ndp[j] += pass[i-1][j];
}
dp.swap(ndp);
}
return dp[v1];
}
컴파일 시 표준 에러 (stderr) 메시지
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 |
---|
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... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |