# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1175850 | nightingale | Quality Of Living (IOI10_quality) | C++20 | 0 ms | 0 KiB |
#include <bits/stdc++.h>
#define int long long
using namespace std;
int rectangle(int r, int c, int h, int w, int city[3001][3001])
{
int best = LLONG_MAX;
for(int i=0; i<r-h+1; i++){
for(int j=0; j<c-w+1; j++){
vector<int> meh;
for(int k=0; k<h; k++){
for(int m=0; m<w; m++){
meh.push_back(city[i+k][j+m]);
}
}
sort(meh.begin(), meh.end());
int median = meh[((meh.size()+1)/2)-1];
if(median < best) best = median;
}
}
return best;
}