Submission #15069

# Submission time Handle Problem Language Result Execution time Memory
15069 2015-07-11T08:34:45 Z gs14004 빨간 직사각형 (kriii3_QQ) C++14
0 / 20
1 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-1][j] - 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 Incorrect 1 ms 45176 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Halted 0 ms 0 KB -