[HackerRank][Python3] Halloween Sale
2018. 9. 6. 21:34 |
프로그래밍/HackerRank
Problem :
https://www.hackerrank.com/challenges/halloween-sale/problem
My Solution :
#!/usr/bin/env python3 def how_many_games(p, d, m, s): count = 0 while p <= s: s -= p p = max(m, p-d) count += 1 return count p, d, m, s = map(int, input().split()) answer = how_many_games(p, d, m, s) print(answer)
'프로그래밍 > HackerRank' 카테고리의 다른 글
[HackerRank][Python3] Happy Ladybugs (0) | 2018.09.07 |
---|---|
[HackerRank][Python3] Fair Rations (0) | 2018.09.07 |
[HackerRank][Python3] Flatland Space Stations (0) | 2018.09.06 |
[HackerRank][Python3] Lisa's Workbook (0) | 2018.09.06 |
[HackerRank][Python3] Minimum Distances (0) | 2018.09.06 |
[HackerRank][Python3] Beautiful Triplets (0) | 2018.09.06 |
[HackerRank][Python3] Equalize the Array (0) | 2018.09.06 |
[HackerRank][Python3] Jumping on the Clouds (0) | 2018.09.06 |
최근에 달린 댓글 최근에 달린 댓글