Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[이지민] - A와 B 2, 알고스팟, 회장뽑기, 입국심사 #189

Merged
merged 4 commits into from
Oct 8, 2023

Conversation

jeeminimini
Copy link
Member

📌 from issue #185 📌

📋문제 목록📋

알고스팟: ✅
A와 B 2: ⛔️
회장뽑기: ✅
입국심사: ✅

📍추가로 해결한 문제📍

추천: 👍  
비추천: 👎  
문제에 대한 간단한 코멘트를 남겨주셔도 좋을 것 같아요!

Copy link
Member

@soopeach soopeach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨어요!!

answer = sys.maxsize

front = 1
last = 1_000_000_000 * 1_000_000_000
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

파이썬은 이런게 부럽네요...

Comment on lines +18 to +30
def bfs(target):
global n, info
queue = deque([[target, 0]])
visited = [0 for _ in range(n + 1)]

while queue:
now, num = queue.popleft()
for i in friends[now]:
if i != target and not visited[i]:
queue.append([i, num + 1])
visited[i] = num + 1

return num
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

엄청 깔끔하게 로직 잘 짜신 것 같아요..!!

front = mid + 1
else:
last = mid - 1
answer = mid
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

answer 를 여기서 최신화 시켜서 리턴 시키는 게 더 잘 읽히네요!

queue.append([i, num + 1])
visited[i] = num + 1

return num
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오 점수를 이렇게 한 번에 구하신 게 좋네요!

set_recursion(b[:-1])

if b[0] == 'B':
set_recursion(b[:0:-1])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

와 부럽다 파이썬...

queue.append([i, num + 1])
visited[i] = num + 1

return num
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

num이 리턴되니 로직이 훨씬 깔끔한 것 같아요 멋집니당

@jeeminimini jeeminimini merged commit 2c85f2a into main Oct 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants