Submission #226684

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
2266842020-04-24 19:44:57DS007The Kingdom of JOIOI (JOI17_joioi)C++14
100 / 100
1589 ms58884 KiB
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int H = 2000;
int a[H][H];
int h, w, mi, ma;
void pre() {
mi = 1e18, ma = -1;
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++)
mi = min(mi, a[i][j]), ma = max(ma, a[i][j]);
}
}
bool check(int dif) {
int ll = mi + dif + 1, ul = ma - dif - 1;
bool track[h][w] = {};
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++) {
if (a[i][j] >= ll)
track[i][j] = true;
}
}
for (int i = 0; i < h; i++) {
int li = w, hi = -1;
for (int j = 0; j < w; j++) {
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...