# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
587324 | HeyYouNotYouYou | Quality Of Living (IOI10_quality) | C++14 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "quality.h"
#include "grader.cpp"
#include <bits/stdc++.h>
using namespace std;
int rectangle(int R, int C, int H, int W, int Q[3001][3001]) {
int median = (H*W)/2;
int mn=INT_MAX;
for(int i = 0 ; i <= R-H ; i ++)
{
for(int j = 0; j <= C-W ; j ++)
{
vector<int>ans;
for(int p = i ; p <= i+H-1 ; p ++){
for(int k = j ; k <= j+W-1 ; k ++)
{
ans.push_back(Q[p][k]);
}
}
sort(ans.begin(),ans.end());
mn=min(mn,ans[median]);
}
}
// cout<<mn<<endl;
return mn;
}