# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
837167 | _martynas | The Kingdom of JOIOI (JOI17_joioi) | C++11 | 24 ms | 340 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 <bits/stdc++.h>
using namespace std;
const int mxn = 2005;
const int inf = 2e9;
int h, w;
int a[mxn][mxn];
int best = inf;
vector<int> heights;
void recur() {
if(heights.size() == w) {
int ioimx = 0, ioimn = inf/2, joimx = 0, joimn = inf/2;
for(int i = 0; i < h; i++) {
for(int j = 0; j < w; j++) {
if(i < heights[j]) {
ioimx = max(ioimx, a[i][j]);
ioimn = min(ioimn, a[i][j]);
}
else {
joimx = max(joimx, a[i][j]);
joimn = min(joimn, a[i][j]);
}
}
}
best = min(best, max(ioimx-ioimn, joimx-joimn));
return;
}
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... |