[HackerRank][Python3] Lisa's Workbook
2018. 9. 6. 22:21 |
프로그래밍/HackerRank
Problem :
https://www.hackerrank.com/challenges/lisa-workbook/problem
My Solution :
#!/usr/bin/env python3
def workbook(n, k, arr):
special = 0
page = 1
for problems in arr:
for number in range(1, problems + 1):
if page == number:
special += 1
if number % k == 0:
page += 1
if number % k != 0:
page += 1
return special
n, k = map(int, input().split())
arr = list(map(int, input().rstrip().split()))
result = workbook(n, k, arr)
print(result)
'프로그래밍 > HackerRank' 카테고리의 다른 글
| [HackerRank][Python3] Strange Counter (0) | 2018.09.07 |
|---|---|
| [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] Halloween Sale (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 |
최근에 달린 댓글 최근에 달린 댓글