Skip to content

Conversation

@LiiNi-coder
Copy link
Contributor

@LiiNi-coder LiiNi-coder commented Aug 21, 2025

🧷 문제 링크

https://school.programmers.co.kr/learn/courses/30/lessons/72414

🧭 풀이 시간

80 분

👀 체감 난이도

✏️ 문제 설명

  • 유저들의 시청기록이 나오고,

🔍 풀이 방법

  • 먼저 유저의 시간대 양옆을 key로 가지는 TimeInfos를 두고, 이를 시간 순서대로 탐색하여 광고의 시작부분카운트와 끝나는 부분 카운트를 구하여 누적재생시간을 구하고, 누적합을 통해, 광고 삽입을 TimeInfos의 key 순서대로 순회하여, 이 key가 광고 삽입 시간일것이라고 그리디하게 접근하였음.

⏳ 회고

  • 그런데 시간초과가 뜸... 아무래도 TreeMap을 key순서대로 iter로 순회할때, 다음거로 가는 것이 O(1)이 아니기 떄문이라 생각...

@LiiNi-coder LiiNi-coder added the hint 💡 반례를 참고했거나 힌트를 얻고 풀었을 때 label Aug 21, 2025
@ShinHeeEul ShinHeeEul merged commit 1f39438 into main Aug 21, 2025
1 check passed
@LiiNi-coder LiiNi-coder added the fail 😢 해설을 보고 풀었거나, 못 풀었을 때 label Aug 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fail 😢 해설을 보고 풀었거나, 못 풀었을 때 hint 💡 반례를 참고했거나 힌트를 얻고 풀었을 때

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants