목록2025/01/21 (3)
on my way

https://school.programmers.co.kr/learn/courses/30/lessons/42586import mathdef solution(progresses, speeds): days = [math.ceil((100-p)/s) for p, s in zip(progresses, speeds)] answer = [] cur, func = 0, 0 for i, d in enumerate(days): if cur 먼저 소요일을 구하고, 소요일 배열을 기준으로 같이 배포될 수 있을지를 순회한다.cur는 기준배포일, func은 기능 수를 카운트하는 변수기준 배포일보다 큰 값이 나오면 새 그룹이므로 그 전까지 answer에 기능의 수를 넣고 기준배포일과 기능수 초기..

https://www.acmicpc.net/problem/2164from collections import dequeimport sysqueue = deque(range(1, int(sys.stdin.readline())+1))while len(queue) > 1: queue.popleft() queue.rotate(-1)print(queue[0])

https://school.programmers.co.kr/learn/courses/30/lessons/42584def solution(prices): N = len(prices) answer = [0 for _ in range(N)] stack = [] for now, price in enumerate(prices): # 스택 인덱스 가격과 현재 가격 비교. # 마지막 가격이 현재가격보다 크면 가격 떨어진 것이므로 인덱스 꺼냄 while stack and prices[stack[-1]] > price: idx = stack.pop() answer[idx] = now - idx # 현재 인덱스 - ..