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 <vector>
#include <algorithm>
#define v vector
using namespace std;
// Subtask 1: Brute Force
int rectangle(int R, int C, int H, int W, int Q[3001][3001]) {
int median = R*C;
for (int i=0; i<R-H+1; i++) {
for (int j=0; j<C-W+1; j++) {
v<int> blocks;
for (int s=i; s<i+H; s++) {
for (int t=j; t<j+W; t++) {
blocks.push_back(Q[s][t]);
}
}
sort(blocks.begin(), blocks.end());
median = min(median, blocks[(H*W)/2]);
}
}
return median;
}
//
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |