(UPD: 2024-12-04 14:48 UTC) Judge is not working due to Cloudflare incident. (URL) We can do nothing about it, sorry. After the incident is resolved, we will grade all submissions.

Submission #733782

#TimeUsernameProblemLanguageResultExecution timeMemory
733782penguin133Quality Of Living (IOI10_quality)C++17
100 / 100
1951 ms140156 KiB
#include <bits/stdc++.h> using namespace std; #include "quality.h" //#define int long long typedef long long ll; #define pi pair<int, int> #define pii pair<int, pi> #define fi first #define se second #ifdef _WIN32 #define getchar_unlocked _getchar_nolock #endif mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count()); int rectangle(int R, int C, int H, int W, int Q[3001][3001]) { int lo = 1, hi = R * C, ans = lo; int A[R+1][C+1] = {0}; while(lo <= hi){ int mid = (lo + hi) >> 1; for(int i=1;i<=R;i++){ for(int j=1;j<=C;j++){ A[i][j] = (Q[i-1][j-1] <= mid ? 1 : -1); A[i][j] += A[i][j-1] + A[i-1][j] - A[i-1][j-1]; } } bool f = 0; for(int i=H;i<=R;i++){ for(int j=W;j<=C;j++){ if(A[i][j] - A[i-H][j] - A[i][j-W] + A[i-H][j-W] >= 1)f = 1; } } if(f)ans = mid, hi = mid - 1; else lo = mid + 1; } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...