P8790 [Lanqiao Cup 2022 National C] Fill-in-the-Blank Problems

Description

## Problem A: Fibonacci and 7 ### Problem Description The recurrence formula of the Fibonacci sequence is: $F_n = F_{n−1} + F_{n−2}$, where $F_1 = F_2 = 1$. Among terms $1$ to $202202011200$ (inclusive) of the Fibonacci sequence, how many terms have a ones digit of $7$? ### Answer Submission This is a fill-in-the-blank (final answer only) problem. You only need to compute the result and submit it. The result of this problem is a string consisting of digits. When submitting the answer, only fill in this string; any extra content will cause you to receive no score. ## Problem B: Xiaolan Does Experiments ### Problem Description Xiaolan really likes scientific research. Recently, he did an experiment and obtained a batch of experimental testdata: a total of two million positive integers. If everything goes as expected, all experimental data $x$ should satisfy $10^7 ≤ x ≤ 10^8$. However, experiments always have some errors, which may cause some unexpected data to appear. Such error data $y$ is in the range $10^3 ≤ y ≤ 10^{12}$. Since Xiaolan is very reliable in doing experiments, more than $99.99\%$ of all his experimental testdata meets the expectation. All of Xiaolan’s experimental testdata is in primes.txt. Now he wants to count how many of these two million positive integers are prime numbers. Can you tell him? ### Answer Submission This is a fill-in-the-blank (final answer only) 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 cause you to receive no score.

Input Format

You can submit by uploading an answer file. 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`). 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

Based on the input problem ID, output the corresponding answer for that problem.

Explanation/Hint

Translated by ChatGPT 5