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 <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define endl '\n'
int n,m;
bool valid(int i,int j){
if(i<n && i >=0 && j<m && j >=0) return 1;
return 0;
}
void solve(){
cin>>n>>m;
vector <string> v(n);
vector <vector<ll>> ans(n,vector<ll>(m));
for(auto &i:v) cin>>i;
for(int i=0;i<n;i++){
for(int j=0;j<m;j++){
for(int k=0;k<n;k++){
for(int c=0;c<m;c++){
if(valid(i+k,j+c)){
bool x = 1;
for(int z=i;z<=i+k;z++){
for(int f=j;f<=j+c;f++){
if(v[z][f] == '#') x = 0;
}
}
if(x){
for(int z=i;z<=i+k;z++){
for(int f=j;f<=j+c;f++){
ans[z][f] ++;
}
}
}
}
}
}
}
}
ll x = 0;
for(auto i : ans){
for(auto j : i) x += j;
}
cout<<x<<endl;
}
int main()
{
int t=1;
// cin>>t;
while(t--){
solve();
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |