1
1
// Authored by : heheHwang
2
- // Co-authored by : -
3
- // http://boj.kr/26322cc46f674b9faf8bb7227c864284
2
+ // Co-authored by : BaaaaaaaaaaarkingDog
3
+ // http://boj.kr/b318d03bfd694a57be91322ff1dcd4ef
4
4
#include < bits/stdc++.h>
5
5
using namespace std ;
6
- using PII = pair<int , int >;
7
6
8
7
bool mask[25 ];
9
8
string board[5 ];
10
- int ans, dx[4 ] = {1 , 0 , -1 , 0 }, dy[4 ] = {0 , 1 , 0 , -1 };
9
+ int ans;
10
+ int dx[4 ] = {1 , 0 , -1 , 0 };
11
+ int dy[4 ] = {0 , 1 , 0 , -1 };
11
12
int main (void ) {
12
13
ios::sync_with_stdio (0 );
13
14
cin.tie (0 );
@@ -16,9 +17,9 @@ int main(void) {
16
17
cin >> board[i];
17
18
18
19
// 25명중 칠공주가 될 사람의 후보 조합을 뽑습니다.
19
- for ( int i = 7 ; i < 25 ; i++) mask[i] = true ;
20
+ fill (mask + 7 , mask+ 25 , true ) ;
20
21
do {
21
- queue<PII > q;
22
+ queue<pair< int , int > > q;
22
23
// 구성원 중 이다솜파의 수, 가로세로로 인접한 사람의 수
23
24
int dasom = 0 , adj = 0 ;
24
25
bool isp7[5 ][5 ] = {}, vis[5 ][5 ] = {};
@@ -32,7 +33,8 @@ int main(void) {
32
33
}
33
34
}
34
35
while (!q.empty ()) {
35
- auto [x, y] = q.front ();
36
+ int x, y;
37
+ tie (x, y) = q.front ();
36
38
q.pop ();
37
39
adj++;
38
40
dasom += board[x][y] == ' S' ;
@@ -55,4 +57,4 @@ int main(void) {
55
57
충분히 2초안에 수행될 수 있습니다.
56
58
서로 가로세로로 인접해야 한다는 2번 조건은 여러가지 방법으로
57
59
확인할 수 있으나, 본 풀이에서는 BFS를 이용하였습니다.
58
- */
60
+ */
0 commit comments