# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1066184 | sammyuri | The Kingdom of JOIOI (JOI17_joioi) | C++17 | 3764 ms | 106008 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;
int height[4][2005][2005];
bool taken[2005][2005];
int biggest = 0;
int h, w;
bool check(int limit, int index) {
// take all cells that are big enough
int req = biggest - limit;
int curbig = 0, cursmall = 1e9;
for (int i = 0; i < h; i ++)
for (int j = 0; j < w; j ++)
if (height[index][i][j] < req)
taken[i][j] = true;
else
taken[i][j] = false;
// turn into one component
for (int i = 0; i < h; i ++) {
bool seen = false;
for (int j = w - 1; j >= 0; j --) {
if (taken[i][j]) seen = true;
if (seen) {
taken[i][j] = true;
curbig = max(curbig, height[index][i][j]);
cursmall = min(cursmall, height[index][i][j]);
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |