| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1330244 | norrawichzzz | 삶의 질 (IOI10_quality) | C++20 | 0 ms | 0 KiB |
#include <bits/stdc++.h>
using namespace std;
int main() {
cin.tie(0)->sync_with_stdio(0);
int r,c,h,w;
cin>> r>> c>> h>> w;
vector<vector<int>> d(r, vector<int>(c));
for (int i=0; i<r; i++) for (int j=0; j<c; j++) cin>> d[i][j];
int ans = INT_MAX;
for (int i=0; i<=r-h; i++) {
for (int j=0; j<=c-w; j++) {
vector<int> s;
for (int ii=i; ii<i+h; ii++) {
for (int jj=j; jj<j+w; jj++) {
s.push_back(d[ii][jj]);
}
}
sort(s.begin(), s.end());
//cout<< s[h*w/2]<< '\n';
ans = min(ans, s[h*w/2]);
}
}
cout<< ans;
}