#P10423. [蓝桥杯 2024 省 B] 填空问题

[蓝桥杯 2024 省 B] 填空问题

Problem Description

Task A: Handshake Problem

Problem Description

Xiao Lan organized an algorithm sharing meeting, with a total of 5050 people attending. At the meeting, everyone greeted each other by shaking hands. As usual, each person needs to shake hands with every other person except themselves exactly once. However, there are 77 people, and these 77 people did not shake hands with each other (but these 77 people did shake hands with everyone except these 77 people). How many handshakes happened in total among all the people?

Note that when AA shakes hands with BB, it also means BB shakes hands with AA, so it counts as one handshake.

Answer Submission

This is a result 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. Extra content will make you get no score.

Task B: Ball Rebound

Problem Description

There is a rectangle with length 343720343720 units and width 233333233333 units. At the top-left vertex inside it, there is a small ball (ignore its volume). Its initial velocity is as shown in the figure and its speed stays constant. The ratio of the speed components along the length and width directions is dx:dy=15:17dx : dy = 15 : 17. When the ball hits the border of the rectangle, it rebounds. Each rebound has equal angle of incidence and angle of reflection, so the ball changes direction and keeps the same speed (if the ball is aimed exactly at a corner, it returns along the incident direction). From the moment the ball starts to the first time it returns to the top-left vertex, what is the distance the ball travels, in units? Round the answer to two decimal places.

Answer Submission

This is a result fill-in-the-blank problem. You only need to compute the result and submit it. The result of this problem is a decimal number. When submitting the answer, only fill in this decimal number. Extra content will make you get no score.

Input Format

Input one uppercase letter, indicating which task it is.

Output Format

According to the input task label, output the answer of the corresponding task.

Hint

Answer template, for reference.

#include<iostream>
using namespace std;
int main() {
    string ans [] = {
        "The answer of task A", // Replace inside the double quotes with the answer for task A
        "The answer of task B", // Replace inside the double quotes with the answer for task B
    };
    char T;
    cin >> T;
    cout << ans[T - 'A'] << endl;
    return 0;
}

Translated by ChatGPT 5