The third simulation of the Blue Bridge Cup

Problem Description

  Please find the smallest number greater than 2022 that, when converted to hexadecimal, has all digits (without leading 0s) as letters (A to F).

  Please submit the decimal form of this number as an answer.

answer submission

  This is a question of filling in the blanks with the result, you only need to calculate the result and submit it. The result of this question is an integer, only fill in this integer when submitting the answer, filling in redundant content will result in no scoring.

Answer

Problem Description

  In Excel, column names use a combination of English letters. The first 26 columns use one letter, in order from A to Z, and the next 26*26 columns use a combination of two letters, in order from AA to ZZ.

  What is the name of column 2022?

answer submission

  This is a question of filling in the blanks with the result, you only need to calculate the result and submit it. The result of this question is a string composed of uppercase letters. When submitting the answer, only fill in this string. If you fill in the extra content, you will not get points.

Answer BYS

Problem Description

  For a date, we can calculate the sum of the digits of the year, or the sum of the digits of the month and day. How many days are there in total from January 1, 1900 to December 31, 9999? The sum of the digits of the year is equal to the sum of the digits of the month plus the sum of the digits of the day.

  For example, November 13, 2022 satisfies the requirement because 2+0+2+2=(1+1)+(1+3).

  Please submit the total number of dates that meet the criteria.

answer submission

  This is a question of filling in the blanks with the result, you only need to calculate the result and submit it. The result of this question is an integer, only fill in this integer when submitting the answer, filling in redundant content will result in no scoring.

Answer 16698

Problem Description

  Xiaolan has 30 numbers, namely: 99, 22, 51, 63, 72, 61, 20, 88, 40, 21, 63, 30, 11, 18, 99, 12, 93, 16, 7, 53, 64, 9, 28, 84, 34, 96, 52, 82, 51, 77.

  Xiaolan can take two numbers with different serial numbers from these numbers, and there are 30*29/2=435 ways to take them.

  May I ask how many of these 435 methods yield the product of two numbers greater than or equal to 2022.

answer submission

  This is a question of filling in the blanks with the result, you only need to calculate the result and submit it. The result of this question is an integer, only fill in this integer when submitting the answer, filling in redundant content will result in no scoring.

Answer 189

#include <iostream>
#include <stdio.h>
#include <queue>
#include <stack>
#include <vector>
#include <climits>
#include <cstdlib>
//#define <memory.h>
//#define <math.h>
//#define <algorithm>

using namespace std;

int main()
{
    long long n;
    cin >> n;
    long long a[n];
    long long k;
    for(int i = 0; i < n; i++)
    {
        cin >> a[i];
    }
    cin >> k;

    long long mark = k;
    long long min1 = 1000001;

    for(long long i = 0; i < n; i++)
    {
        //cout << "1" << endl;
        min1 = 1000001;
        for(long long j = i-mark; j <= i+mark; j++)
        {
            //cout << "2" << endl;
            if(j >= 0 && j < n && a[j] < min1)
            {
                min1 = a[j];
            }
        }
        cout << min1 << ' ';

    }

    return 0;
}

long long maze[110][110];
long long time[110][110];

int nowDistance = 0;
int maxDistance = 0;

int xMove[4] = {0, 0, 1, -1};
int yMove[4] = {1, -1, 0, 0};

void slip(int x, int y)
{
    if(maze[x][y] > 10000 || (maze[x][y+1] >= maze[x][y] && maze[x][y-1] >= maze[x][y] && maze[x+1][y] >= maze[x][y] && maze[x-1][y+1] >= maze[x][y]))
    {
        if(nowDistance > maxDistance)
        {
            maxDistance = nowDistance;

        }
        return;
    }
    if(time[x][y] <= 100)
    {
        nowDistance += time[x][y];
        return;
    }

    for(int i = 0; i < 4; i++)
    {
        nowDistance++;
        int newX = x+xMove[i];
        int newY = y+yMove[i];
        if(maze[newX][newY] < maze[x][y])
            slip(newX,newY);
        nowDistance--;
    }

}
int main()
{
    int m, n;
    cin >> n >> m;
    for(int i = 0; i < 110; i++)
        for(int j = 0; j < 110; j++)
            maze[i][j] = 10010;
    for(int i = 0; i < 110; i++)
        for(int j = 0; j < 110; j++)
            time[i][j] = 110;
    for(int i = 1; i <= n; i++)
        for(int j = 1; j <= m; j++)
            cin >> maze[i][j];


    for(int i = 1; i <= n; i++)
    {
        for(int j = 1; j<= m; j++)
        {
            slip(i,j);
        }
    }

    cout << maxDistance+1;

    return 0;
}
int main()
{
    int count1 = 0;
    int n,m,t;
    cin >> n >> m >> t;
    int r1, c1, r2, c2;
    int poor[n][m];

    for(int i = 0; i < n; i++)
        for(int j = 0; j < m; j++)
            poor[i][j] = 0;


    for(int k = 0; k < t; k++)
    {
        cin >> r1 >> c1 >> r2 >> c2;
        for(int i = r1; i <= r2; i++)
        {
            for(int j = c1; j <= c2; j++)
            {
                if(poor[i][j] != 1)
                {
                    count1++;
                    poor[i][j] = 1;  //打扫了的为1
                }

            }
        }
    }

    cout << m*n-count1;
    return 0;
}
typedef struct poi{
    double x;
    double y;
}Pos;

bool isContain(Pos posi1, Pos posi2, double R)
{
    double x = posi1.x - posi2.x;
    double y = posi1.y - posi2.y;
    if(x < 0) x = -x;
    if(y < 0) y = -y;
    if((x*x+y*y) <= R*R)
    {
        return true;
    }
    else
        return false;
}
int main()
{
    int count1 = 0;
    int W, H, n;
    double R;
    cin >> W >> H >> n >> R;
    Pos posi[n];
    for(int i = 0; i < n; i++)
    {
        cin >> posi[i].x >> posi[i].y;
    }
    for(int i = 0; i <= W; i++)
    {
        for(int j = 0; j <= H; j++)
        {
            for(int k = 0; k < n; k++)
            {
                Pos newPosi;
                newPosi.x = i;
                newPosi.y = j;
                if(isContain(posi[k], newPosi, R))
                {
                    count1++;
                    break;
                }
            }
        }
    }
    cout << count1;

    return 0;
}
int main()
{
    int w; //给定的天是一周中的哪一天1~7
    long long n; //n天后
    cin >> w >> n;
    n %= 7;
    w += n;
    w %= 7;
    cout << w;
}

int main()
{
    int count1 = 0;
    int nums[30] = {99, 22, 51, 63, 72, 61, 20, 88, 40, 21, 63, 30, 11, 18, 99, 12, 93, 16, 7, 53, 64, 9, 28, 84, 34, 96, 52, 82, 51, 77};
    for(int i = 0; i < 30; i++)
    {
        for(int j = i+1; j < 30; j++)
        {
            if(nums[i]*nums[j] >= 2022)
            {
                count1++;
                cout << nums[i]*nums[j] << endl;
            }
        }
    }
    cout << count1;

}

int monthP[] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int monthR[] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

bool isRun(int year)
{
    if(year%4 == 0 && year%100 != 0)
    {
        return true;
    }
    else
        return false;
}

int main()
{
    int count1 = 0;
    for(int i = 1900; i <= 9999; i++)
    {
        if(isRun(i))
        {
            for(int j = 1; j <= 12; j++)
            {
                int year = i;
                int month = j;
                for(int k = 1; k <= monthR[j]; k++)
                {
                    int day = k;
                    int yearSum = 0, monthSum = 0, daySum = 0;
                    yearSum = year%10 + year/10%10 + year/100%10 + year/1000%10;
                    monthSum = month%10 + month/10%10;
                    daySum = day%10 + day/10%10;
                    if(yearSum == monthSum + daySum)
                    {
                        cout << year << ' ' << month << ' ' << day << endl;
                        count1++;
                    }
                }

            }
        }
    }
    cout << count1;


    return 0;
}

Written by myself, please correct me if there are mistakes.

Guess you like

Origin blog.csdn.net/weixin_63484669/article/details/129547045