#P9230. [蓝桥杯 2023 省 A] 填空问题

[蓝桥杯 2023 省 A] 填空问题

Problem 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, 23142314 is a lucky number because it has 44 digits, and 2+3=1+42+3=1+4. Now please help him calculate how many different lucky numbers there are between 11 and 100000000100000000.

B. Prize Quiz

Xiao Lan is taking part in a live quiz show. There are 3030 questions in total. For each question, there are only two outcomes: correct or wrong. Each correct answer gives 1010 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 100100 points, so when he reaches 100100 points, Xiao Lan will stop answering immediately. Note that Xiao Lan may also stop when he has not yet reached 100100 points [1]^{[1]}.

It is known that Xiao Lan finally actually got the prize corresponding to 7070 points. How many possible answer sequences can Xiao Lan have?

[1]{[1]}: This sentence was not clearly stated in the original Lanqiao Cup problem. For the specific situation, please refer to this discussion post.

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:

#include<bits/stdc++.h>
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;
}

Hint

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

Translated by ChatGPT 5