Submission #15070

# Submission time Handle Problem Language Result Execution time Memory
15070 2015-07-11T08:36:33 Z gs14004 빨간 직사각형 (kriii3_QQ) C++14
0 / 20
0 ms 45176 KB
#include <cstdio>

int a[3005][3005];
char str[3005][3005];
int n, m;
long long ret;

int main(){
	scanf("%d %d",&n,&m);
	for(int i=1; i<=n; i++){
		scanf("%s",str[i] + 1);
	}
	for(int i=1; i<=n; i++){
		for(int j=1; j<=m; j++){
			if(str[i][j] == 'B'){
				a[i][j] = 0;
			}
			else{
				a[i][j] = a[i-1][j] + a[i][j-1] - a[i-1][j-1] + 1;
			}
			ret += a[i][j];
		}
	}
	printf("%lld",ret);
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 45176 KB Output is correct
2 Correct 0 ms 45176 KB Output is correct
3 Incorrect 0 ms 45176 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Halted 0 ms 0 KB -