# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
386385 | ritul_kr_singh | The Kingdom of JOIOI (JOI17_joioi) | C++17 | 1913 ms | 31816 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
// #pragma GCC optimize("Ofast,unroll-loops")
#include <bits/stdc++.h>
using namespace std;
// #define int long long
#define nl << '\n'
#define sp << ' ' <<
int h, w;
int g[2000][2000], a[2000], b[2000], maxElement, minElement;
bool possible(int diff){
int res0 = 0, res1 = 0;
for(int i=0; i<h; ++i){
a[i] = 0;
for(int j=0; j<w; ++j){
if(g[i][j]-minElement<=diff) ++a[i];
else break;
}
b[i] = a[i];
a[i] = min(a[i], a[i-1]);
}
for(int i=h-2; i>=0; --i) b[i] = min(b[i], b[i+1]);
for(int i=0; i<h; ++i){
for(int j=a[i]; j<w; ++j)
res0 = max(res0, maxElement - g[i][j]);
for(int j=b[i]; j<w; ++j)
res1 = max(res1, maxElement - g[i][j]);
}
return (res0<=diff or res1<=diff);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |