[HackerRank][Python3] The Power Sum
2018. 5. 31. 01:12 |
프로그래밍/HackerRank
Problem :
https://www.hackerrank.com/challenges/the-power-sum/problem
My Solution :
#!/usr/bin/env python3 def powerSum(X, N, n): a = n**N if a == X: return 1 if a > X: return 0 return powerSum(X-a, N, n+1) + powerSum(X, N, n+1) X, N = int(input()), int(input()) result = powerSum(X, N, 1) print(result)
'프로그래밍 > HackerRank' 카테고리의 다른 글
[HackerRank][Python3] Marc's Cakewalk (0) | 2018.06.06 |
---|---|
[HackerRank][Python3] Minimum Loss (0) | 2018.06.05 |
[HackerRank][Python3] Strong Password (0) | 2018.06.05 |
[HackerRank][Python3] Climbing the Leaderboard (0) | 2018.06.01 |
[HackerRank][Python3] Construct the Array (0) | 2018.05.30 |
[HackerRank][Python3] Minimum Absolute Difference in an Array (0) | 2018.05.29 |
[HackerRank][Python3] Big Sorting (0) | 2018.05.29 |
[HackerRank][Python3] CamelCase (0) | 2018.05.27 |
최근에 달린 댓글 최근에 달린 댓글