#include "quality.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int rectangle(int R, int C, int H, int W, int Q[3001][3001]) {
ll col[R][C];
for(int i=0;i<R;i++){
for(int j=0;j<C;j++){
if(i!=0)col[i][j]=col[i-1][j]+(long long) Q[i][j];
else col[i][j]=(long long) Q[i][j];
}
}
ll ans=100000000000000000;
for(int i=0;i<R-H+1;i++){
ll cur=0;
for(int j=0;j<C;j++){
cur+=col[i+H-1][j];
if(i>0)cur-=col[i-1][j];
if(j-W>=0){
cur-=col[i+H-1][j-W];
if(i>0)cur+=col[i-1][j-W];
}
if(j>=W-1)ans=min(ans,cur);
}
}
int x=ans/H/W;
return x;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
332 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
332 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
332 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
332 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
332 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |