제출 #1057675

#제출 시각아이디문제언어결과실행 시간메모리
105767512345678삶의 질 (IOI10_quality)C++17
100 / 100
732 ms140368 KiB
#include "quality.h" #include <bits/stdc++.h> using namespace std; const int nx=3e3+5; int qs[nx][nx], l, r; int rectangle(int R, int C, int H, int W, int Q[3001][3001]) { l=1, r=R*C; while (l<r) { int md=(l+r)/2, mx=0; for (int i=1; i<=R; i++) for (int j=1; j<=C; j++) qs[i][j]=(Q[i-1][j-1]<=md), qs[i][j]+=qs[i-1][j]+qs[i][j-1]-qs[i-1][j-1]; for (int i=H; i<=R; i++) for (int j=W; j<=C; j++) mx=max(mx, qs[i][j]-qs[i-H][j]-qs[i][j-W]+qs[i-H][j-W]); if (mx>=(H*W+1)/2) r=md; else l=md+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...