[python]ํ๋ก๊ทธ๋๋จธ์ค - ๊ธฐ๋ฅ๊ฐ๋ฐ
https://school.programmers.co.kr/learn/courses/30/lessons/42586
ํ๋ก๊ทธ๋๋จธ์ค
์ฝ๋ ์ค์ฌ์ ๊ฐ๋ฐ์ ์ฑ์ฉ. ์คํ ๊ธฐ๋ฐ์ ํฌ์ง์ ๋งค์นญ. ํ๋ก๊ทธ๋๋จธ์ค์ ๊ฐ๋ฐ์ ๋ง์ถคํ ํ๋กํ์ ๋ฑ๋กํ๊ณ , ๋์ ๊ธฐ์ ๊ถํฉ์ด ์ ๋ง๋ ๊ธฐ์ ๋ค์ ๋งค์นญ ๋ฐ์ผ์ธ์.
programmers.co.kr
import math
# math.ceil() ์ฌ๋ฆผ
def solution(progresses, speeds):
answer = []
days=[]
for i in range(len(speeds)):
days.append(math.ceil((100-progresses[i])/speeds[i]))
front = 0
for idx in range(len(days)):
if days[idx] > days[front]:
answer.append(idx-front)
front = idx
print(front)
answer.append(len(days)-front)
return answer'Problem Solving > PROGRAMMERS' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
| [python]ํ๋ก๊ทธ๋๋จธ์ค - ์ฌ๋ฐ๋ฅธ ๊ดํธ (0) | 2022.11.01 |
|---|---|
| [python] ํ๋ก๊ทธ๋๋จธ์ค - ํ๋ฆฐํฐ (0) | 2022.10.31 |
| [python]ํ๋ก๊ทธ๋๋จธ์ค - ๋ค๋ฆฌ๋ฅผ ์ง๋๋ ํธ๋ญ (0) | 2022.10.29 |
| [JavaScript] ํ๋ก๊ทธ๋๋จธ์ค - ์ ๊ท์์ด๋ (0) | 2022.10.26 |
| [python]ํ๋ก๊ทธ๋๋จธ์ค - ์ผ์ด์ฌ (0) | 2022.10.25 |
๋๊ธ