# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
378017 | WLZ | Wombats (IOI13_wombats) | C++14 | 12374 ms | 197100 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "wombats.h"
#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
int r, c;
vector< vector<int> > h, v;
vector<int> range;
vector< vector<int> > calc(int x) {
vector< vector<int> > ans(c, vector<int>(c, INF)), pre(2, vector<int>(c, 0));
for (int i = 0; i < 2; i++) for (int j = 1; j < c; j++) pre[i][j] = pre[i][j - 1] + h[x + i][j - 1];
for (int i = 0; i < c; i++) {
int mx = -INF;
for (int j = 0; j < c; j++) {
mx = max(mx, pre[1][j] - abs(pre[0][i] - pre[0][j]) - v[x][j]);
ans[i][j] = min(ans[i][j], pre[1][j] - mx);
}
int mn = INF;
for (int j = c - 1; j >= 0; j--) {
mn = min(mn, abs(pre[0][i] - pre[0][j]) + v[x][j] + pre[1][j]);
ans[i][j] = min(ans[i][j], mn - pre[1][j]);
}
}
return move(ans);
}
vector< vector<int> > combine(const vector< vector<int> > &a, const vector< vector<int> > &b) {
vector< vector<int> > ans(c, vector<int>(c, INF)), best(c, vector<int>(c, -1));
Compilation message (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... |