(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 #802160

#TimeUsernameProblemLanguageResultExecution timeMemory
802160LiudasQuality Of Living (IOI10_quality)C++17
100 / 100
1472 ms115096 KiB
#include <bits/stdc++.h> #include "quality.h" using namespace std; int rectangle(int R, int C, int H, int W, int Q[][3001]){ int l = 0, r = R * C; while(l < r){ int mid = (l + r) / 2; vector<vector<int>> p(R+ 1, vector<int>(C + 1)); for(int i = 0; i < R; i ++){ for(int j = 0; j < C; j ++){ p[i+1][j+1] = p[i][j+1] + p[i+1][j] - p[i][j] + (Q[i][j] <= mid); } } int ans = 0; for(int i = H; i < R + 1; i++){ for(int j = W; j < C + 1; j++){ ans = max(ans, p[i][j]-p[i-H][j]-p[i][j-W] + p[i-H][j-W]); } } if(ans * 2 >= H * W){ r = mid; } else{ l = mid + 1; } } return l; }
#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...