-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
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]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
애초부터 구간합도 이렇게 반복 한번으로 저장해둘 수 있었군요
if e == first: | ||
type = 1 | ||
else: | ||
type = 4 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
제가 부등호에 현혹돼서 너무 어렵게 생각했나봐요 bfs 좋네용
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]) |
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
색다르게 푸셔서 좋았어요! 👍
조건문으로 꼼꼼하게 비교하는 느낌?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨습니다!!
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]) |
There was a problem hiding this comment.
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))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
edges의 타입이 정의되어있지 않아서 요런식으로 크기를 구해야하는 건가요??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
사실 문제에 순서대로 번호를 붙인다고 안쓰여져있어서 정석인 방식은 아닌 것 같아요..!!
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) |
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
복잡한 구현을 깔끔하게 하신 거 같아요!
📌 from issue #214 📌
📋문제 목록📋