1
+ #include < cstdio>
2
+ #include < iostream>
3
+ #include < cstring>
4
+ #include < cmath>
5
+ #include < ctime>
6
+ #include < vector>
7
+ #include < string>
8
+ #include < algorithm>
9
+ #include < map>
10
+ #include < set>
11
+ #include < unordered_map>
12
+ #include < unordered_set>
13
+ #include < queue>
14
+ #include < deque>
15
+ #include < stack>
16
+ #include < numeric>
17
+ #include < memory>
18
+ #include < list>
19
+ #include < climits>
20
+ #include < fstream>
21
+ #include < sstream>
22
+ #include < random>
23
+ #include < functional>
24
+
25
+ #define PB push_back
26
+ #define F first
27
+ #define S second
28
+
29
+ #define REP (i,from,to ) for (auto i=(from); i<=(to); ++i)
30
+ #define PER (i,from,to ) for (auto i=(from); i>=(to); --i)
31
+ #define REP_IF (i,from,to,assert ) for (auto i=(from); i<=(to); ++i) if (assert)
32
+
33
+ #define FOR (i,less_than ) for (auto i=0 ; i<(less_than); ++i)
34
+ #define FORI (i, container ) for (auto i=0 ; i<(container).size(); ++i)
35
+ #define FORI_IF (i, container, assert ) for (auto i=0 ; i<(container).size(); ++i) if (assert)
36
+ #define ROFI (i, container ) for (auto i=SZ(container)-1 ; i>=0 ; --i)
37
+
38
+ #define FOREACH (elem, container ) for (auto elem : (container))
39
+ #define MEMSET (container, value ) memset(container, value, sizeof (container))
40
+ #define MEMSET0 (container ) memset(container, 0 , sizeof (container))
41
+ #define FILL (container, value ) fill(container.begin(), container.end(), value)
42
+ #define FILL0 (container ) fill(container.begin(), container.end(), 0 )
43
+ #define ALL (container ) (container).begin(), (container).end()
44
+ #define SZ (container ) (int )((container).size())
45
+
46
+ #define BACK (set_map ) *prev ((set_map).end(), 1)
47
+ #define FRONT (set_map ) *(set_map).begin()
48
+
49
+ #define POP (var, container ) auto var=(container.front()); container.pop();
50
+
51
+ using PII = std::pair<int ,int >;
52
+ using LL = long long ;
53
+ using VI = std::vector<int >;
54
+ using CVI = const VI;
55
+ using VLL = std::vector<LL>;
56
+ using VVI = std::vector<VI>;
57
+ using VVLL = std::vector<VLL>;
58
+
59
+ using namespace std ;
60
+
61
+
62
+ int n;
63
+
64
+ int main () {
65
+ cin >> n;
66
+ vector<string> a (n+2 , string (n+2 , ' #' ));
67
+ REP (i, 1 , n) REP (j, 1 , n) cin >> a[i][j];
68
+
69
+ REP (i, 1 , n) {
70
+ REP_IF (j, 1 , n, a[i][j]==' .' )
71
+ if (a[i+1 ][j]==' #' || a[i+1 ][j-1 ]==' #' || a[i+1 ][j+1 ]==' #' || a[i+2 ][j]==' #' ) {
72
+ cout << " NO\n " ;
73
+ return 0 ;
74
+ } else
75
+ a[i+1 ][j] = a[i+1 ][j-1 ] = a[i+1 ][j+1 ] = a[i+2 ][j] = ' #' ;
76
+
77
+ }
78
+ cout << " YES\n " ;
79
+ return 0 ;
80
+ }
0 commit comments