# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
472381 |
2021-09-13T12:41:45 Z |
Mr_OK_Man |
Strah (COCI18_strah) |
C++17 |
|
2 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(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 |
308 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
460 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
460 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
460 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
460 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
452 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
460 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2 ms |
460 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
460 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |