P9230 [Lanqiao Cup 2023 NOI Qualifier A] Fill-in-the-Blank Problems

Description

## A. Lucky Number Xiao Lan thinks that if a number has an even number of digits, and the sum of the first half of the digits equals the sum of the second half of the digits, then this number is his lucky number. For example, $2314$ is a lucky number because it has $4$ digits, and $2+3=1+4$. Now please help him calculate how many different lucky numbers there are between $1$ and $100000000$. ## B. Prize Quiz Xiao Lan is taking part in a live quiz show. There are $30$ questions in total. For each question, there are only two outcomes: correct or wrong. Each correct answer gives $10$ points, and a wrong answer resets the score to zero. Xiao Lan can stop answering at any time and claim the prize corresponding to his current score, and then he cannot answer any more questions. The top prize requires $100$ points, so when he reaches $100$ points, Xiao Lan will stop answering immediately. Note that Xiao Lan may also stop when he has not yet reached $100$ points $^{[1]}$. It is known that Xiao Lan finally actually got the prize corresponding to $70$ points. How many possible answer sequences can Xiao Lan have? ${[1]}$: This sentence was not clearly stated in the original Lanqiao Cup problem. For the specific situation, please refer to [this discussion post](https://www.luogu.com.cn/discuss/1070210).

Input Format

This is a fill-in-the-blank problem. You only need to compute the result and submit it. The result of this problem is an integer; when submitting the answer, only fill in this integer. Any extra content will make you unable to score. You can submit by uploading answer files. You need to put your answers into `1.out` and `2.out`, where `1.out` corresponds to the answer for Problem A, and `2.out` corresponds to the answer for Problem B. The input file contains one character, representing the problem ID (`A` or `B`), and you need to output the corresponding answer. The following template is for reference: ```cpp #include using namespace std; char pid; int main() { cin >> pid; if(pid == 'A') puts("Answer for Problem A"); else puts("Answer for Problem B"); return 0; } ```

Output Format

N/A

Explanation/Hint

The 14th Lanqiao Cup Software Competition Provincial Contest C/C++ University Group A A-B. Translated by ChatGPT 5