# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
797326 | andecaandeci | 삶의 질 (IOI10_quality) | C++17 | 1383 ms | 70968 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "quality.h"
#include<bits/stdc++.h>
using namespace std;
int rectangle(int n, int m, int h, int w, int a[3001][3001]) {
int num=h*w/2+1, pre[n][m];
int l=1, r=n*m, ans=n*m;
while(l<=r) {
int mid=l+r>>1;
for(int i=0; i<n; i++) {
for(int j=0; j<m; j++) {
pre[i][j]=(a[i][j]<=mid);
if(i) pre[i][j]+=pre[i-1][j];
if(j) pre[i][j]+=pre[i][j-1];
if(i && j) pre[i][j]-=pre[i-1][j-1];
}
}
bool can=0;
for(int i=h-1; i<n; i++) {
for(int j=w-1; j<m; j++) {
int sum=pre[i][j];
if(i-h>=0) sum-=pre[i-h][j];
if(j-w>=0) sum-=pre[i][j-w];
if(i-h>=0 && j-w>=0) sum+=pre[i-h][j-w];
if(sum>=num) {can=1; break;}
}
if(can) break;
}
if(can) ans=mid, r=mid-1;
else l=mid+1;
}
return ans;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |