#P8790. [蓝桥杯 2022 国 C] 填空问题

[蓝桥杯 2022 国 C] 填空问题

Problem Description

Problem A: Fibonacci and 7

Problem Description

The recurrence formula of the Fibonacci sequence is: Fn=Fn1+Fn2F_n = F_{n−1} + F_{n−2}, where F1=F2=1F_1 = F_2 = 1.

Among terms 11 to 202202011200202202011200 (inclusive) of the Fibonacci sequence, how many terms have a ones digit of 77?

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 xx should satisfy 107x10810^7 ≤ x ≤ 10^8. However, experiments always have some errors, which may cause some unexpected data to appear. Such error data yy is in the range 103y101210^3 ≤ y ≤ 10^{12}. Since Xiaolan is very reliable in doing experiments, more than 99.99%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:

#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;
}

Output Format

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

Hint

Translated by ChatGPT 5