8000 Update 2583.cpp · SooYeonida/basic-algo-lecture@837c83c · GitHub
[go: up one dir, main page]

Skip to content

Commit 837c83c

Browse files
Update 2583.cpp
1 parent 8855b23 commit 837c83c

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

0x09/solutions/2583.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Authored by : 0silver00
2-
// Co-authored by : -
3-
// http://boj.kr/7daa30318d98480985e402b4e3a14bc1
2+
// Co-authored by : BaaaaaaaaaaarkingDog
3+
// http://boj.kr/d0c205b6ead644d896fec013b6e64129
44
#include <bits/stdc++.h>
55
using namespace std;
66

@@ -10,7 +10,7 @@ int dx[4] = { 1, 0, -1, 0 };
1010
int dy[4] = { 0, 1, 0, -1 };
1111
int m, n, k;
1212
int board[102][102];
13-
int dist[102][102];
13+
int vis[102][102];
1414

1515
int main(void){
1616
ios::sync_with_stdio(0);
@@ -30,10 +30,10 @@ int main(void){
3030

3131
for (int i = 0; i < m; i++) {
3232
for (int j = 0; j < n; j++) {
33-
if (board[i][j] == 1 || dist[i][j] == 1)
33+
if (board[i][j] == 1 || vis[i][j] == 1)
3434
continue;
3535
queue<pair<int, int>> Q;
36-
dist[i][j] = 1;
36+
vis[i][j] = 1;
3737
Q.push({ i, j });
3838
int width = 1;
3939
count++;
@@ -45,10 +45,10 @@ int main(void){
4545
int ny = cur.Y + dy[dir];
4646
if (nx < 0 || nx >= m || ny < 0 || ny >= n)
4747
continue;
48-
if (board[nx][ny] == 1 || dist[nx][ny] == 1)
48+
if (board[nx][ny] == 1 || vis[nx][ny] == 1)
4949
continue;
5050
Q.push({ nx, ny });
51-
dist[nx][ny] = 1;
51+
vis[nx][ny] = 1;
5252
width++;
5353
}
5454
}
@@ -62,4 +62,4 @@ int main(void){
6262
cout << i << ' ';
6363

6464
return 0;
65-
}
65+
}

0 commit comments

Comments
 (0)
0