# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
287641 | 2020-08-31T21:45:37 Z | fgojko | 삶의 질 (IOI10_quality) | C++14 | 0 ms | 0 KB |
#include <vector> #include <algorithm> using namespace std; typedef unsigned long long ull; int rectangle(int n, int m, int x, int y, int** mat){ vector<ull> vec; ull max = n*m; for(int i = 0; i <= n-x; ++i){ for(int j = 0; j <= m-y; ++j){ vec.resize(0); for(int a = i; a < i+x; ++a){ for(int b =j; b < j+y; ++b){ vec.push_back(mat[a][b]); } } sort(vec.begin(), vec.end()); #ifdef FEEDBACK cout << "( " << i << ", " << j << " )\n"; cout << "median = " << vec[vec.size()/2] << endl; #endif // FEEDBACK if(max > vec[vec.size()/2]){ max = vec[vec.size()/2]; } } } }