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 <stdio.h>
#include <stdlib.h>
#include "quality.h"
#include <vector>
#include <algorithm>
#include <iostream>
using namespace std;
int rectangle(int R, int C, int H, int W, int Q[3001][3001]) {
int n=R;
int m=C;
int h=H;
int w=W;
int ans=n*m;
// cout<<endl;
for(int i=0;i<=n-h;i++){
for(int j=0;j<=m-w;j++){
vector < int > v;
for(int k=i;k<i+h;k++){
for(int f=j;f<j+w;f++){
v.push_back(Q[k][f]);
// cout<<Q[k][f]<<" ";
}
// cout<<endl;
}
sort(v.begin(),v.end());
//cout<<endl;
ans=min(ans,v[(h*w)/2]);
}
}
return ans;
}
# | 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... |