Submission #55972


ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#include <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int, int> pint;
typedef vector<long long> vlong;
#define vpush(a,x) a.push_back(x);
#define rep(i, n) REP(i, 0, n)
#define all(v) v.begin(), v.end()
#define REP(i, x, n) for(int i = x; i < n; i++)
#define INF 2e9
signed main(){
cin.tie(0);
ios::sync_with_stdio(false);
int n,m,d;
cin>>n>>m>>d;
vector<string> s(n);
rep(i,n){
cin>>s[i];
}
int count=0,ans=0,flag=0;
rep(i,n){
rep(j,m){
flag=0;
count=0;
if(s[i][j]=='.'){
REP(k,j,m){
if(s[i][k]=='#'){
break;
}
count++;
if(count>=d){
flag=1;
break;
}
}
if(flag==1){
ans++;
}
}
}
}
rep(i,m){
rep(j,n){
flag=0;
count=0;
if(s[j][i]=='.'){
REP(k,j,n){
if(s[k][i]=='#'){
break;
}
count++;
if(count>=d){
flag=1;
break;
}
}
if(flag==1){
ans++;
}
}
}
}
cout<<ans<<'\n';
return 0;
}

ステータス

項目 データ
問題 0594 - 休憩スペース (Refreshment Area)
ユーザー名 ei1918
投稿日時 2019-10-31 21:43:19
言語 C++
状態 Accepted
得点 100
ソースコード長 1876 Byte
最大実行時間 42 ms
最大メモリ使用量 644 KB

セット

セット 得点 Cases
1 set1 20 / 20 *t3*1.txt
2 set2 20 / 20 *t3*2.txt
3 set3 20 / 20 *t3*3.txt
4 set4 20 / 20 *t3*4.txt
5 set5 20 / 20 *t3*5.txt

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
2017-yo-t3-in1.txt AC 28 ms 604 KB
1
2017-yo-t3-in2.txt AC 23 ms 560 KB
2
2017-yo-t3-in3.txt AC 41 ms 516 KB
3
2017-yo-t3-in4.txt AC 42 ms 580 KB
4
2017-yo-t3-in5.txt AC 22 ms 644 KB
5