# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
338641 | blue | Quality Of Living (IOI10_quality) | C++17 | 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 <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int rectangle(int R, int C, int H, int W, int Q[301][301])
{
int res = R*C;
vector<int> temp;
for(int i = H-1; i < R; i++)
{
for(int j = W-1; j < C; j++)
{
temp.clear();
for(int x = i-H+1; x <= i; x++)
{
for(int y = j-W+1; y <= j; y++)
{
temp.push_back(Q[x][y]);
}
}
if(i == 3 && j == 4) for(int t: temp) cout << t << ' ';
cout << '\n';
sort(temp.begin(), temp.end());
res = min(res, temp[temp.size()/2]);
}
}
return res;
}