#P8741. Advanced Calculation Challenge

    ID: 21905 Type: Default 1000ms 256MiB

Advanced Calculation Challenge

Advanced Calculation Challenge

This contest problem consists of 5 subproblems. You are required to compute the answer for each subproblem and output the results. In all subproblems the answer is an integer and you must output only that integer (or in the combined version, output the 5 integers in order, each on a new line).

Subproblem A: Memory Space

Blue wants to allocate an array using 256MB of memory. Each element is a 32‐bit integer. Ignoring the space used by the program and any auxiliary memory overhead, how many 32‐bit integers can be stored in 256MB?

Recall that
\(256\,MB = 256 \times 2^{20}\) bytes, and each 32‐bit integer uses 4 bytes. Use LaTeX formatting for any formulas.

Subproblem B: Card Arrangement

Blue has 10 types of digit cards, numbered 0 to 9. Initially he has 2021 cards of each digit (for a total of 20210 cards). He wishes to form positive integers starting from 1 consecutively. For each number formed, the required cards are used up and cannot be reused. For example, if Blue has 30 cards in total (each digit appears 3 times), he can form the numbers 1 to 10 but he cannot form 11 because there is only one card for digit 1 left.

Now, with 2021 cards of each digit available, what is the largest positive integer Blue can form starting from 1?

Subproblem C: Distinct Lines

In the 2D coordinate system, two distinct points determine a line (all pairs of points on a common line determine the same line). For the grid of integer points {(x,y) | 0 ≤ x < 2, 0 ≤ y < 3} (i.e. x = 0,1 and y = 0,1,2), there are exactly 11 distinct lines determined by these points.

For the grid {(x,y) | 0 ≤ x < 20, 0 ≤ y < 21} (that is, x = 0,...,19 and y = 0,...,20), how many distinct lines are determined by these points?

Subproblem D: Cargo Arrangement

Blue has n boxes of cargo, each a perfect cube. He wishes to arrange them in a large cuboid with dimensions L, W, and H (each a positive integer) such that L × W × H = n. In other words, the arrangement is an L by W by H stack of boxes.

For example, if n = 4 there are 6 valid arrangements: 1 × 1 × 4, 1 × 2 × 2, 1 × 4 × 1, 2 × 1 × 2, 2 × 2 × 1, 4 × 1 × 1.

When n = \(2021041820210418\) (a 16-digit number), how many valid arrangements are there?

Subproblem E: Shortest Path in a Special Graph

Blue constructs a special undirected graph with 2021 nodes labeled 1 to 2021. For any two distinct nodes a and b, an edge is present if and only if \(|a - b| \le 21\). The weight of the edge connecting a and b is defined as the least common multiple (lcm) of a and b, i.e., \(\text{lcm}(a,b)\). For example, there is no edge between nodes 1 and 23 because \(|1-23|=22>21\); there is an edge between 3 and 24 with weight \(\text{lcm}(3,24)=24\); and between 15 and 25, the edge weight is \(\text{lcm}(15,25)=75\).

Compute the length of the shortest path from node 1 to node 2021.

Note on Answer Submission: These are result‐output problems. You need only output the computed integer for each subproblem (or in the combined version, output the 5 answers in order, each on a new line). Extra output will result in a wrong answer.

inputFormat

No input is provided for this problem.

outputFormat

Output 5 lines. The first line is the answer for Subproblem A; the second line for Subproblem B; the third line for Subproblem C; the fourth line for Subproblem D; and the fifth line for Subproblem E.

For example, the expected output is:

67108864
3181
53181
810
388000000

All formulas in the description are formatted in LaTeX.

sample

67108864

3181 53181 810 388000000

</p>