#include "quality.h"
//#include "grader.cpp"
#include <bits/stdc++.h>
using namespace std;
int rectangle(int R, int C, int H, int W, int Q[3001][3001]) {
int median = (H*W)/2;
int mn=INT_MAX;
for(int i = 0 ; i <= R-H ; i ++)
{
for(int j = 0; j <= C-W ; j ++)
{
vector<int>ans;
for(int p = i ; p <= i+H-1 ; p ++){
for(int k = j ; k <= j+W-1 ; k ++)
{
ans.push_back(Q[p][k]);
}
}
sort(ans.begin(),ans.end());
mn=min(mn,ans[median]);
}
}
// cout<<mn<<endl;
return mn;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
340 KB |
Output is correct |
2 |
Correct |
1 ms |
340 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
340 KB |
Output is correct |
2 |
Correct |
1 ms |
340 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
4 |
Correct |
249 ms |
804 KB |
Output is correct |
5 |
Correct |
204 ms |
772 KB |
Output is correct |
6 |
Correct |
149 ms |
828 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
340 KB |
Output is correct |
2 |
Correct |
1 ms |
340 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
4 |
Correct |
249 ms |
804 KB |
Output is correct |
5 |
Correct |
204 ms |
772 KB |
Output is correct |
6 |
Correct |
149 ms |
828 KB |
Output is correct |
7 |
Execution timed out |
5086 ms |
2648 KB |
Time limit exceeded |
8 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
340 KB |
Output is correct |
2 |
Correct |
1 ms |
340 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
4 |
Correct |
249 ms |
804 KB |
Output is correct |
5 |
Correct |
204 ms |
772 KB |
Output is correct |
6 |
Correct |
149 ms |
828 KB |
Output is correct |
7 |
Execution timed out |
5086 ms |
2648 KB |
Time limit exceeded |
8 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
340 KB |
Output is correct |
2 |
Correct |
1 ms |
340 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
4 |
Correct |
249 ms |
804 KB |
Output is correct |
5 |
Correct |
204 ms |
772 KB |
Output is correct |
6 |
Correct |
149 ms |
828 KB |
Output is correct |
7 |
Execution timed out |
5086 ms |
2648 KB |
Time limit exceeded |
8 |
Halted |
0 ms |
0 KB |
- |