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

[23-03-09] dain.py #159

Merged
merged 5 commits into from
Mar 10, 2023
Merged

[23-03-09] dain.py #159

merged 5 commits into from
Mar 10, 2023

Conversation

da-in
Copy link
Owner

@da-in da-in commented Mar 8, 2023

PR Summary

  • 다리를 지나는 트럭 : 트럭 진입 가능하면 push, 불가능하면 들어가 있는 트럭 pop.
  • 피로도 : itertools.permutations 로 모든 순열 생성 및 완전탐색.
  • 주식가격 : stack 에 push 할 때, push 시간(==index) 같이 넣어서 계산.
  • 전력망을 둘로 나누기 : dfs로 풀이. 최근에 우리 크루스칼 너무 해서 또 유니온 파인드 생각하다가...
    트리는 순환 안생기지~ 하고 인접리스트 방식의 dictionary 그래프로 변환해서 풀이.
  • 단속카메라 : 그리디 + 약간의 stack 느낌🥳
    한 자동차가 도로를 벗어나는 마지막에 카메라를 설치하면, 그 사이 진입한 차들도 모두 카메라에 잡힘(pop해버리기~)

ISSUE NUMBER

@da-in da-in self-assigned this Mar 8, 2023
@da-in da-in changed the title Dain [23-03-09] dain.py Mar 8, 2023

def solution(n, wires):
answer = n
tree = defaultdict(list)
Copy link
Collaborator

Choose a reason for hiding this comment

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

디폴트딕트 갱장히 잘 써먹으시네 매일 등장하는듯 ㅋㅋㅋㅋㅋ

@da-in da-in closed this Mar 10, 2023
@da-in da-in reopened this Mar 10, 2023
@da-in da-in merged commit 26fd32c into main Mar 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants