# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1066158 | sammyuri | The Kingdom of JOIOI (JOI17_joioi) | C++17 | 5 ms | 4440 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 h, w;
bool check(int limit, int index) {
memset(taken, false, sizeof(taken));
// first row
taken[0][0] = true;
for (int j = 1; j < w; j ++) {
if (abs(height[index][0][j] - height[index][0][j - 1]) <= limit)
taken[0][j] = true;
else
break;
}
// subsequent rows
for (int i = 1; i < h; i ++) {
// ended
if (abs(height[index][i][0] - height[index][i - 1][0]) > limit)
break;
taken[i][0] = true;
for (int j = 1; j < w; j ++) {
if (taken[i - 1][j] && abs(height[index][0][j] - height[index][0][j - 1]) <= limit)
taken[0][j] = true;
else
break;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |