-
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
[이지민] - 겹치는 건 싫어, 기타리스트, 회전초밥, 쉬운 최단거리 #166
Conversation
|
||
while start < n and end < n: | ||
if nums_info[nums[start]] < k: | ||
nums_info[nums[start]] += 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.
파이썬은 ++이 안되는게 흠이네요ㅜㅜ
재귀의 경우 2^(n + 1) - 2의 시간이 걸린다. | ||
하지만 dp 테이블을 만들경우 n * m 으로 50,000만 걸린다! |
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.
시간복잡도 설명 👍👍
queue.append([x, y]) | ||
|
||
while queue: | ||
nx, ny = queue.popleft() |
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.
있어요! 근데 보통 deque 쓰는 것 같더라고요
https://khu98.tistory.com/187 보고 깨달았다. | ||
''' | ||
|
||
n, k = map(int, input().split()) |
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.
n, k = 으로 받는 거 코틀린만 되는 줄 알았는데...
for i in range(4): | ||
if 0 <= nx + dx[i] < n and 0 <= ny + dy[i] < m: | ||
if ground[nx + dx[i]][ny + dy[i]] == 1 and result[nx + dx[i]][ny + dy[i]] == -1: | ||
result[nx + dx[i]][ny + dy[i]] = result[nx][ny] + 1 | ||
queue.append([nx + dx[i], ny + dy[i]]) |
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.
헉..이부분 디게 깔끔하네요👍👍 한 수 배우고 갑니다..
sushi.append(int(input())) | ||
|
||
maxi = 0 | ||
sushi += sushi[:3000] |
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.
헉..아까 설명해주셨던 거 같은데 혹시 원래 sushi가 3000보다 작은 크기였다면 어떻게 되나요..?
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.
어 그러게요?ㅋㅋㅋㅋㅋ
근데 python은 크기가 커도 안터지는 것 같아요
sushi.append(int(input())) | ||
|
||
maxi = 0 | ||
sushi += sushi[:3000] |
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 #165 📌
📋문제 목록📋