CSDN programming challenge experience

CSDN programming challenge experience

1 Introduction

The CSDN competition encourages developers to actively participate in development-related skill evaluations, helps developers learn from each other in the process of practice and learning, and improves personal special abilities. This competition is open to all development students, you can come to challenge after signing up, and there are exquisite gifts and honor incentives around CSDN.

2. Competition content

The main question type is programming questions. Of course, sometimes there are other question types. Programming questions can be written in C language, C++, Java, Python and other programming languages.

3. Competition time and ideas

The competition time is generally at 7:00 on Wednesday evening and 9:00 on Sunday morning, and the test lasts for three hours. (Although there should be no classes on Sunday, I still hope it can be changed to evening.)

3. Competition topic

1. Topic name: Judging the outcome
There are always two strings A and B. Reading is performed n times in succession. The strings read in each time are A|B. Output the string that was read the most times.

2. Topic name: Moving the little guinea pigs
The little guinea pigs sit in a row. Xiao Yijiang bought a small house n*m ​​in rows of grids, and she wanted k little guinea pigs to have their own house. But in order not to waste space, she wants the outermost circle of the small house to have a small guinea pig living in each row and column as much as possible (the guinea pig can also live in the middle grid, just make sure that the outermost row and column of the house live at least one only guinea pigs, not every row and column). Xiao Yijiang wanted to know how many plans she had for arranging the little guinea pig.

3. Topic name: Drunken jailer
A certain prison has a hall consisting of n cells, and each cell is next to each other. There is one prisoner in each cell, and each cell is locked. One night, the jailer got bored and decided to play a game. In the first round, he drank a glass of whiskey and ran down the hall, unlocking every cell. In the second round, he drank a glass of whiskey and ran down the hall to lock every other cell (cells 2, 4, 6...). In the third round, he drank a whiskey and ran down the hall. He went to every third cell (cells 3, 6, and 9). If the cell was locked, he opened it; if the cell door was open, he locked the cell. He repeats for n rounds, drinks the last cup, and passes out. Some prisoners (possibly number zero) realize that their cells are unlocked and the guards are incapacitated
. They can run away immediately. Now based on the number of cells, determine how many prisoners escaped.

4. Topic name: Meeting Arrangement The
meeting has started! As a group, of course the table needs to be adjacent to the boss during the meeting! (The boss may be sitting on the table) Xiao Yi was assigned to arrange tables and chairs, but Xiao Yi spent all her energy on eating, how could she move these tables and chairs. She decided to use the existing layout as a conference seating arrangement. Assign one person to each table. Different adjacent tables have different colors. Xiaoyi wants to know how many people can surround the boss after choosing a certain table?

4. Examination experience

  This is my second time participating in the competition, and the questions are still acceptable. The first question is similar to the sign-in question. Participants who have learned programming can do it carefully. The second and third questions are still relatively difficult for me. I won't talk about the four questions.
  In fact, for many people, participating in this competition is quite good. It can not only communicate with more outstanding people, but also test yourself. If you perform well, you can get some prizes. Some of the books are still very valuable.
(There are too many big guys who get full marks, so I won’t write the solution)

Guess you like

Origin blog.csdn.net/weixin_59357453/article/details/130052673