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

[이지민] - 구간 합 구하기 5, 작업, 도넛과 막대 그래프 #217

Merged
merged 4 commits into from
Mar 10, 2024

Conversation

jeeminimini
Copy link
Member

📌 from issue #214 📌

📋문제 목록📋

구간 합 구하기 5: ✅
작업: ✅
도넛과 막대 그래프: ✅
키 순서: ❎

@jeeminimini jeeminimini self-assigned this Mar 10, 2024
Comment on lines +13 to +15
for j in range(1, n + 1):
tmp.append(tmp[-1] + numbers[i - 1][j - 1])
sub_info.append(sum_info[i - 1][j] + tmp[-1])
Copy link
Contributor

Choose a reason for hiding this comment

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

애초부터 구간합도 이렇게 반복 한번으로 저장해둘 수 있었군요

Comment on lines +54 to +57
if e == first:
type = 1
else:
type = 4
Copy link
Contributor

Choose a reason for hiding this comment

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

분기 처리 깔끔하다고 생각했습니다!!!👍

check_students(i, reverse_students, visited)

if all(visited):
result += 1
Copy link
Contributor

Choose a reason for hiding this comment

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

제가 부등호에 현혹돼서 너무 어렵게 생각했나봐요 bfs 좋네용

Comment on lines +10 to +15
for i in range(1, n + 1):
sub_info = [0]
tmp = [0]
for j in range(1, n + 1):
tmp.append(tmp[-1] + numbers[i - 1][j - 1])
sub_info.append(sum_info[i - 1][j] + tmp[-1])
Copy link
Member

Choose a reason for hiding this comment

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

tmp.append 로 왼쪽과 덧셈, sub_info.append 로 위쪽과 덧셈이군요!!👍

return result


def check_graph(first, edge_info, visited, point):
Copy link
Member

Choose a reason for hiding this comment

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

색다르게 푸셔서 좋았어요! 👍
조건문으로 꼼꼼하게 비교하는 느낌?

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.

고생하셨습니다!!

Comment on lines +10 to +15
for i in range(1, n + 1):
sub_info = [0]
tmp = [0]
for j in range(1, n + 1):
tmp.append(tmp[-1] + numbers[i - 1][j - 1])
sub_info.append(sum_info[i - 1][j] + tmp[-1])
Copy link
Member

Choose a reason for hiding this comment

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

요기가 진짜 대단하네요,,,



def solution(edges):
edge_size = max(list(itertools.chain(*edges)))
Copy link
Member

Choose a reason for hiding this comment

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

edges의 타입이 정의되어있지 않아서 요런식으로 크기를 구해야하는 건가요??

Copy link
Member Author

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 +26
while queue:
nxt = queue.popleft()
if not visited[nxt]:
num += 1
visited[nxt] = True

for t in jobs[nxt]:
if not visited[t]:
queue.append(t)
Copy link
Member

Choose a reason for hiding this comment

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

bfs 보기가 깔끔합니다,,!

return result


def check_graph(first, edge_info, visited, point):
Copy link
Member

Choose a reason for hiding this comment

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

복잡한 구현을 깔끔하게 하신 거 같아요!

@jeeminimini jeeminimini merged commit 502719a into main Mar 10, 2024
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