-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from just-stopyoon/2025-1-19-1
[just-stopyoon] programmers_기능개발_Python
- Loading branch information
Showing
1 changed file
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
def solution(progresses, speeds): | ||
answer = [] # 최종 정답 | ||
day = 1 # 작업 일자 | ||
cnt = 0 # 배포하는 기능의 개수 | ||
|
||
while (len(progresses) != 0) : # 남은 기능이 없을 때까지 | ||
if progresses[0] + speeds[0] * day >= 100 : # 기능이 완성되면 | ||
progresses.pop(0) # 해당 기능 배포 | ||
speeds.pop(0) # 해당 개발속도 없애기 | ||
cnt += 1 # 배포하는 기능의 개수 증가 | ||
else : # 아직 기능이 완성되지 않았다면 | ||
if cnt > 0 : # 지금까지 배포할 수 있는 기능이 있다면 | ||
answer.append(cnt) # 해당 배포에 배포되는 기능 수 추가 | ||
cnt = 0 # 개수 초기화 | ||
day += 1 # 일자 주가 | ||
if cnt > 0 : # 모든 기능 배포가 끝났을 때 마지막으로 배포해야하는 기능들이 있다면 | ||
answer.append(cnt) # 해당 배포에 배포되는 기능 수 추가 | ||
return answer |