| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1348012 | boropoto | 삶의 질 (IOI10_quality) | C++20 | 5093 ms | 580 KiB |
#include <bits/stdc++.h>;
#include "quality.h"
const int maxn = 3005;
using namespace std;
int ans=-1, n, m, a[maxn][maxn], h, w,pref[maxn][maxn],k;
bool check(int x)
{
for(int i=1;i<=n;i++)
{
for(int j=1;j<=m;j++)
{
pref[i][j]=pref[i][j-1];
if(a[i][j]<x)
{
pref[i][j]++;
}
}
for(int j=1;j<=m;j++)
{
pref[i][j]+=pref[i-1][j];
}
}
for(int i=h;i<=n;i++)
{
for(int j=w;j<=m;j++)
{
if(pref[i][j]-pref[i-h][j]-pref[i][j-w]+pref[i-h][j-w]==k)
{
return 1;
}
}
}
return 0;
}
int rectangle(int R, int C, int H, int W, int Q[3001][3001])
{
n=R;
m=C;
h=H;
w=W;
k=n*m/2;
for(int i=0;i<n;i++)
{
for(int j=0;j<m;j++)
{
a[i+1][j+1]=Q[i][j];
}
}
int l=1,r=n*m,mid;
while(l<=r)
{
mid=(l+r)/2;
if(check(mid)==1)
{
r=mid-1;
ans=mid;
}
else
{
l=mid+1;
}
}
}
컴파일 시 표준 에러 (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... | ||||
