# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
298638 | emil_physmath | 웜뱃 (IOI13_wombats) | C++17 | 20071 ms | 215544 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "wombats.h"
#include <bits/stdc++.h>
using namespace std;
const int maxN = 5000;
const int maxM = 100;
int n, m;
int h[5000][200], v[5000][200];
int dp[maxM][maxN][maxM];
void Mini(auto& l, auto r) { l = min(l, r); }
void Build()
{
for (int s = 0; s < m; ++s)
{
int (*dp)[maxM] = ::dp[s];
dp[0][s] = 0;
for (int j = s + 1; j < m; ++j)
dp[0][j] = dp[0][j - 1] + h[0][j - 1];
for (int j = s - 1; j >= 0; --j)
dp[0][j] = dp[0][j + 1] + h[0][j];
for (int i = 1; i < n; ++i)
{
for (int j = 0; j < m; ++j)
dp[i][j] = dp[i - 1][j] + v[i - 1][j];
for (int j = 1; j < m; ++j)
Mini(dp[i][j], dp[i][j - 1] + h[i][j - 1]);
for (int j = m - 2; j >= 0; --j)
Mini(dp[i][j], dp[i][j + 1] + h[i][j]);
}
}
}
void init(int R, int C, int H[5000][200], int V[5000][200]) {
if (C <= 2);
else if (min(R, C) <= 100);
else exit(0);
n = R, m = C;
for (int i = 0; i < 5000; ++i)
for (int j = 0; j < 200; ++j)
h[i][j] = H[i][j], v[i][j] = V[i][j];
Build();
}
void changeH(int x, int y, int w) {
h[x][y] = w;
Build();
}
void changeV(int x, int y, int w) {
v[x][y] = w;
Build();
}
int escape(int v1, int v2) {
return dp[v1][n - 1][v2];
}
컴파일 시 표준 에러 (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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |