답안 #423461

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
423461 2021-06-11T07:18:23 Z chirathnirodha 삶의 질 (IOI10_quality) C++17
0 / 100
1 ms 332 KB
#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(j!=0)col[i][j]=col[i][j-1]+(long long) Q[i][j];
			else col[i][j]=(long long) Q[i][j];
		}
	}
	ll ans=1e18;
	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][j-W];
			}
			if(j>=W-1)ans=min(ans,cur);
		}
	}
	return ans/H/W;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 332 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 332 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 332 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 332 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 332 KB Output isn't correct
2 Halted 0 ms 0 KB -