Hyperbox
TCO19 SRM 751 · 2019-01-09 · by misof
Problem Statement
- The boundary of a two-dimensional rectangle is one-dimensional (a collection of line segments), and we can measure its length.
- The boundary of a three-dimensional box is two-dimensional (a collection of rectangles), and we can measure its area.
- In the same sense, the boundary of a four-dimensional hyperbox is three-dimensional, and we can measure its volume.
You are given the
Two hyperboxes are distinct if they are not congruent. (In other words, they are distinct if we cannot rearrange the dimensions of one to get the dimensions of the other.)
Constraints
- volume will be between 1 and 200,000,000, inclusive.
8 Returns: 1
The smallest possible hyperbox (i.e., the 1 x 1 x 1 x 1 hyperbox) is the only one with surface volume 8.
1234567 Returns: 0
There are no hyperboxes with integer sides and this exact surface volume.
120 Returns: 3
One of the three distinct hyperboxes with this surface volume has side lengths 1, 2, 2, and 7.
1 Returns: 0
2 Returns: 0
Submissions are judged against all 109 archived test cases, of which 5 are shown here. Case numbers match the judge’s.
Language: C++17 · define a public class Hyperbox with a public method int count(int volume) · 109 test cases · 2 s / 256 MB per case