Submission #472387

# Submission time Handle Problem Language Result Execution time Memory
472387 2021-09-13T12:50:09 Z Mr_OK_Man Strah (COCI18_strah) C++17
22 / 110
1000 ms 1228 KB
#include <bits/stdc++.h>
using namespace std;
 long long n,m,c=0;
 char a[301][301]={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(c>0)
s+=c;
}


              }







          }
      }
  }
  cout<<s<<endl;

    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 1089 ms 332 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1073 ms 332 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1087 ms 332 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 7 ms 1100 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 12 ms 1228 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 9 ms 1228 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 716 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 13 ms 1228 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -