답안 #472376

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
472376 2021-09-13T12:38:46 Z Mr_OK_Man Strah (COCI18_strah) C++17
0 / 110
1 ms 460 KB
#include <bits/stdc++.h>
using namespace std;
 long long n,m,c=0;
 char a[11][11]={0,0};
 long long vis[11][11]={0,0};
/* void dfs(long long i,long long j)
 {
    c++;
    vis[i][j]=1;
    if(i>0 && a[i-1][j]=='.' && vis[i-1][j]==0)
    {
            dfs(i-1,j);
    }
    if(i<n-1&&a[i+1][j]=='.' && vis[i+1][j]==0)
    {
            dfs(i+1,j);
    }
    if(j>0 && a[i][j-1]=='.' && vis[i][j-1]==0)
    {
            dfs(i,j-1);
    }
    if(j<m-1&&a[i][j+1]=='.'&&vis[i][j+1]==0)
    {
            dfs(i,j+1);
    }


 }*/
int main()
{
    //BRUTE
  //  cout << "Hello world!" << endl;
  ios_base::sync_with_stdio(0);
  cin.tie(0);
 long long s=0;
  cin>>n>>m;
  for(int i=0;i<n;i++)
  {
      for(int j=0;j<m;j++)
      {
          cin>>a[i][j];
      }
  }
  for(int i=0;i<n;i++)
  {
      for(int j=0;j<m;j++)
      {

          for(int b=i;b<n;b++)//firsting rectas
          {



              for(int l=j;l<m;l+=1)
              {

long long c=0,r=0;

               for(int y=i;y<=b;y+=1)
               {
//Make rectangels of recatngles 
                   //inin rectas
                   for(int u=j;u<=l;u++)
                   {
                      if(a[y][u]=='.')
                      {
                          c++;
                      }
                      else r=1;
                   }

               }
if(r<1)
{if(s>0)s+=c;}


              }







          }
      }
  }
  cout<<s<<endl;

    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 460 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 460 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 460 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 456 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 460 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 408 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 448 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 460 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -