← 返回 stripe 的题目列表Bitfont Repository: Implement Decoders and Compose Them
类型:online_judge
Bitfont Repo: Implement Two Decoders and Compose Them
You are given a repository (Bitfont repo) with existing files and tests. You need to implement two decoders:
Decoder A (base decoder): parse an input byte/bit stream according to a specified encoding into a structured representation.
Decoder B (upper decoder): parse the raw input into an intermediate format; its output will be used as Decoder A’s input.
The evaluation pipeline is:
input -> Decoder B -> intermediate -> Decoder A -> final output
Requirements
Follow the function signatures defined in the repo and make all tests pass.
Handle endianness, bit packing, padding, and invalid inputs.
Scale
Inputs may be large; aim for linear or near-linear parsing.
The original post doesn’t include the exact encoding spec; this is a faithful reconstruction of the question shape.
Example
Input
(Repo-provided input sample 1)
Output
(Repo-provided expected output 1)