# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1175849 | nightingale | 삶의 질 (IOI10_quality) | C++20 | 0 ms | 0 KiB |
#include <bits/stdc++.h>
#include "quality.h"
#define int long long
using namespace std;
int rectangle(int r,int c,int h,int w,int city[3001][3001])
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
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());
if(meh[((meh.size()+1)/2)-1]<best) best = meh[((meh.size()+1)/2)-1];
}
}
return best;
}