|
Download benchmarks/Algorithms/huffman_encoding/problem.md from PV-SJTU/PV-Bench: direct link, hf CLI and curl.
- Browser
- Download file 458 Bytes
-
https://huggingface.co/datasets/PV-SJTU/PV-Bench/resolve/main/benchmarks/Algorithms/huffman_encoding/problem.md
- Command line
-
hf download hf://datasets/PV-SJTU/PV-Bench/benchmarks/Algorithms/huffman_encoding/problem.md
-
curl -L -o problem.md https://huggingface.co/datasets/PV-SJTU/PV-Bench/resolve/main/benchmarks/Algorithms/huffman_encoding/problem.md
458 Bytes
| # Huffman Merge Cost | |
| ## Description | |
| Repeatedly merge two available weights, paying their sum each time, until one weight remains. Find the minimum possible total cost. | |
| ## Input | |
| The function receives the input weights and a writable work array. | |
| ## Output | |
| Return the minimum total merge cost. | |
| ## Constraints | |
| - $1 \le n \le 8$. | |
| - $1 \le weight_i \le 1000$. | |
| ## Source | |
| Classical Huffman optimal-merge problem reconstructed from the verified C artifact. | |