Skip to content

Commit

Permalink
31-yuna83
Browse files Browse the repository at this point in the history
  • Loading branch information
yuna83 committed Feb 23, 2024
1 parent af790fe commit 00aec03
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
21 changes: 21 additions & 0 deletions yuna83/DFS/๋ฐ”์ด๋Ÿฌ์Šค.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
cnt=0
def DFS(virus):
global cnt
visited[virus]=1

for i in network[virus]:
if (visited[i]==0):
DFS(i)
cnt+=1

N= int(input())
link = int(input())

network = [[]*(N+1) for _ in range(N+1)]
for i in range(link):
a, b = map(int, input().split())
network[a].append(b)
network[b].append(a)
visited = [0]*(N+1)
DFS(1)
print(cnt)
3 changes: 3 additions & 0 deletions yuna83/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,7 @@
| 26์ฐจ์‹œ | 2024.01.30 | ๋”•์…”๋„ˆ๋ฆฌ | [๊ทค ๊ณ ๋ฅด๊ธฐ](https://school.programmers.co.kr/learn/courses/30/lessons/138476)|https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/125|
| 27์ฐจ์‹œ | 2024.02.05 | ํˆฌํฌ์ธํ„ฐ | [์ข‹๋‹ค](https://www.acmicpc.net/problem/1253)|https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/129|
| 28์ฐจ์‹œ | 2024.02.07 | ํˆฌํฌ์ธํ„ฐ | [๊ตฌ๋ช…๋ณดํŠธ](https://school.programmers.co.kr/learn/courses/30/lessons/42885)|https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/134|
| 29์ฐจ์‹œ | 2024.02.13 | ์Šฌ๋ผ์ด๋”ฉ์œˆ๋„์šฐ | [๋ธ”๋กœ๊ทธ](https://www.acmicpc.net/problem/21921)|https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/136|
| 30์ฐจ์‹œ | 2024.02.19 | ์Šฌ๋ผ์ด๋”ฉ์œˆ๋„์šฐ | [๋„๋‘‘](https://www.acmicpc.net/problem/13422)|https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/141|
| 31์ฐจ์‹œ | 2024.02.23 | DFS/BFS | [๋ฐ”์ด๋Ÿฌ์Šค](https://www.acmicpc.net/problem/2606)|https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/145|
---

0 comments on commit 00aec03

Please sign in to comment.