This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<cstdio>
int a,b,i,j,S,w[3333][3333];
char s[3333];
main()
{
scanf("%d%d",&a,&b);
for(i=1;i<=a;i++)
{
scanf("%s",s);
for(j=0;j<b;j++)
{
if(s[j]=='R')w[i][j+1]=1;
}
}
for(i=1;i<=a;i++)
{
for(j=1;j<=b;j++)
{
if(w[i][j]==0)
{
S+=i*j;
}
}
}
printf("%d",a*(a+1)/2*b*(b+1)/2-S);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |