ocaml: phase 5.1 partition_count.ml baseline (p(15) = 176)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 22s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 22s
Counts integer partitions via classic DP:
let partition_count n =
let dp = Array.make (n + 1) 0 in
dp.(0) <- 1;
for k = 1 to n do
for i = k to n do
dp.(i) <- dp.(i) + dp.(i - k)
done
done;
dp.(n)
partition_count 15 = 176
Tests Array.make, .(i)<-/.(i) array access, nested for-loops, refs.
135 baseline programs total.
This commit is contained in:
@@ -95,6 +95,7 @@
|
||||
"palindrome_sum.ml": 49500,
|
||||
"paren_depth.ml": 7,
|
||||
"partition.ml": 3025,
|
||||
"partition_count.ml": 176,
|
||||
"pancake_sort.ml": 910,
|
||||
"pascal.ml": 252,
|
||||
"peano.ml": 30,
|
||||
|
||||
Reference in New Issue
Block a user