You are viewing a single comment's thread. Return to all comments →
f# solution
open System let rec count b x n = match int (float b ** float n) with | bn when bn = x -> 1 | bn when bn > x -> 0 | bn -> (count (b + 1) (x - bn) n) + (count (b + 1) (x) n) [<EntryPoint>] let main _ = let x = Console.ReadLine() |> int let n = Console.ReadLine() |> int count 1 x n |> string |> Console.WriteLine 0
Seems like cookies are disabled on this browser, please enable them to open this website
The Sums of Powers
You are viewing a single comment's thread. Return to all comments →
f# solution