Skip to content

Commit

Permalink
Merge pull request #145 from yuna83/31-yuna83
Browse files Browse the repository at this point in the history
31-yuna83
  • Loading branch information
yuna83 authored Mar 4, 2024
2 parents 84d26c3 + 038e9b7 commit 7138d16
Show file tree
Hide file tree
Showing 2 changed files with 23 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)
2 changes: 2 additions & 0 deletions yuna83/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,6 @@
| 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 7138d16

Please sign in to comment.