이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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... |