『杭電1937』Finding Seats

漠宸離若發表於2020-11-13

#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
 
const int maxn = 305;
const int inf = 0x7ffffff;
int n,m,k,map[maxn][maxn],sum[maxn][maxn];
char str[maxn];
 
int main()
{
	while(scanf("%d%d%d",&n,&m,&k),n+m+k)
	{
		for(int i = 1; i <= n; i++)
		{
			scanf("%s",str+1);
			for(int j = 1; j <= m; j++)
			{
				if(str[j] == '.')
					map[i][j] = 1;
				else map[i][j] = 0;
				sum[i][j] = sum[i][j-1] + map[i][j];
			}
		}
		for(int i = 2; i <= n; i++)
			for(int j = 1; j <= m; j++)
				sum[i][j] +

相關文章