#include "quality.h"
#include <bits/stdc++.h>
#define PB push_back
using namespace std;
//long long rtamx = __INT_MAX__;
/*
struct SegTree{
long long dd, htt, val1, mid;
SegTree *L, *R;
SegTree(long long l, long long r){
dd=l, htt=r;
val1=0;
mid=(dd+htt)/2;
if(l!=r){
L=new SegTree(l, mid);
R=new SegTree(mid+1, r);
}
}
int query(long long val){
if(dd==htt){
cout<<" "<< dd<<endl;
return dd;
}
if(val<=L->val1){
return L->query(val);
}else{
return R->query(val-L->val1);
}
}
void insert(int pos, int val){
if(dd==htt){
cout<<dd<<endl;
val1+=val;
return ;
}
if(pos<=mid){
L->insert(pos, val);
}else{
R->insert(pos, val);
}
val1=L->val1+R->val1;
}
};*/
int rectangle(int R, int C, int H, int W, int Q[3001][3001]) {
int minimum = INT_MAX;
for(int i = 0 ; i <= R-H ; i++){
for(int j = 0 ; j <= C-H ; j++){
vector<int>vec;
for(int x = i ; x < i+H ; x++){
for(int y = j ; y < j+W ; y++){
vec.PB(Q[x][y]);
}
}
sort(vec.begin(), vec.end());
//cout<<vec[((H*W)/2)]<<endl;
minimum=min(minimum, vec[((H*W)/2)]);
}
}
return minimum;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
420 KB |
Output is correct |
2 |
Incorrect |
5 ms |
332 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
420 KB |
Output is correct |
2 |
Incorrect |
5 ms |
332 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
420 KB |
Output is correct |
2 |
Incorrect |
5 ms |
332 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
420 KB |
Output is correct |
2 |
Incorrect |
5 ms |
332 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
420 KB |
Output is correct |
2 |
Incorrect |
5 ms |
332 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |