# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
338637 | blue | Quality Of Living (IOI10_quality) | C++17 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "quality.h"
#include <vector>
#include <algorithm>
using namespace std;
int quality(int R, int C, int H, int W, int Q[3001][3001])
{
int res = 0;
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]);
}
}
sort(temp.begin(), temp.end());
res = max(res, temp[temp.size()/2]);
}
}
return res;
}