#P8759. Multi-Part Constant Answer Problems

    ID: 21923 Type: Default 1000ms 256MiB

Multi-Part Constant Answer Problems

Multi-Part Constant Answer Problems

This contest problem consists of four independent result‐fill tasks. For each task, you are required to output a single integer answer. The tasks are described below:

Problem A: Bandwidth

The internet bandwidth at Xiaolan’s home is \(200\,\mathrm{Mbps}\). In theory, what is the maximum amount of data (in \(\mathrm{MB}\)) that can be downloaded from the Internet in one second? Note that 1 byte = 8 bits.

Answer Submission: This is a fill-in answer problem. You only need to submit the computed integer result. Any extra characters will result in no score.

Problem B: Pure Primes

A prime number is a positive integer with exactly two distinct divisors: 1 and itself. For example, the first few primes are \(2,3,5,7,11,13,17,19,23,29,31,37,\dots\). A prime is called a pure prime if every digit in its decimal representation is itself a prime digit (i.e. one of \(2,3,5,7\)). For example, 2, 3, 5, 7, 23, 37 are pure primes, while 11, 13, 17, 19, 29, 31 are not (and neither are numbers like 1, 4, or 35).

Count how many pure primes exist between 1 and 20210605 (inclusive).

Answer Submission: Output only the integer answer.

Problem C: Complete Dates

A date is called complete if the sum of all digits in its year, month, and day is a perfect square (in \(\LaTeX\) format, e.g. \(16=4^2\)). For instance, consider June 5, 2021. Its digits add up as \(2+0+2+1+6+5=16\), and since \(16\) is a perfect square, the date is complete. Similarly, June 23, 2021 is also complete since \(2+0+2+1+6+2+3=16\).

Determine how many complete dates occur from January 1, 2001 to December 31, 2021.

Answer Submission: Output only the integer result.

Problem D: Minimum Weight

Consider a rooted binary tree \(T\). For any node \(v\) with left subtree \(L\) and right subtree \(R\), let \(C(L)\) and \(C(R)\) be the number of nodes in \(L\) and \(R\) respectively. The weight \(W(v)\) of node \(v\) is defined recursively as follows:

[ \begin{aligned} W(\text{empty}) &= 0,\ W(v) &= 1 + 2,W(L) + 3,W(R) + \Bigl(C(L)\Bigr)^2,C(R). \end{aligned} ]

The weight of the tree is defined as the weight of its root. Given all binary trees with exactly 2021 nodes, determine the minimum possible weight.

Answer Submission: Output only the integer answer.

Overall Instructions: There is no input. Your program should simply output four lines, where each line is the answer to Problems A, B, C, and D respectively, in that order.

inputFormat

This problem does not require any input.

outputFormat

Your program should output exactly four lines. Each line must contain a single integer: the answer for Problem A, Problem B, Problem C, and Problem D respectively.

sample

 
25

3057 1234 567890

</p>