"Title Set" Cattle net • 2018 National multi-school algorithm winter Camp Practice competition (second session)

Source: Internet
Author: User

The original link:2018 national multi-school algorithm winter training Camp Practice Competition (second session)

A Spit Bubble

Time limit: C/s 1 sec, other languages 2 seconds

Space Limitations: C/C + + 32768K, other languages 65536K
64bit IO Format:%lldTitle Description
Small fish spit bubble, toot toot out. Small fish will spit out two kinds of bubbles: Big bubble "o", Small bubble "O". Two adjacent small bubbles will melt into a large bubble, two adjacent large bubbles will explode. (Yes, you're right, little bubbles and bubbles don't make any difference, and I don't know why.) For example: Oooooooo will become OO after a period of time.
Input Description:
The data has multiple groups and is processed to the end of the file.
Each set of inputs contains a single row of ' O ' and ' O ' strings.
Output Description:
Each set of outputs contains only one row, and the output line string represents the bubbles that the small fish spit out after fusion.
Example 1 input
Oooooooo
Output
Oo
Description
Merge from left to right
Note:
For 100% of data,
The length of the string does not exceed 100.

B Taotao to eat chicken

Time limit: C/s 1 sec, other languages 2 seconds

Space Limitations: C/C + + 32768K, other languages 65536K
64bit IO Format:%lldTitle Description
Taotao's computer does not move the Jedi to survive, so Taotao only to play the PC version of the Wilderness, and Jedi survival, the game characters themselves can carry a certain weight m of items, equipped with backpacks can carry more H (H 0 for no backpack) weight of things. Play for a few days Taotao found a bug, when equipped with a backpack, if you can carry the weight is not full, you can take an arbitrary heavy things. (Explanation see example) one day Taotao to a strange island, the island has n pieces of equipment, each equipped with a weight of WI and the value of the VI, but Taotao do not know these equipment, so he came to help you, pick the most powerful equipment, help him eat chicken.
Input Description:
The subject has multiple sets of inputs (less than 10) that end when N=0 is entered.
The first line enters N,m,h. N,m,h is an integer, and 0<=n,m,h<=100,
Next n rows, each line enters the weight of the item I items of WI and the Power value VI. 0<=wi,vi<=100.
Output Description:
Outputs the maximum power value, one row per set of outputs.
Example 1 input
3 3 32 33 22 30
Output
8
Description
The total weight that can be carried is 6, when you take the first two pieces of equipment, at this time the capacity is 5/6, you can also take the third item.

C Little Fairy's birthday.

Time limit: C/s 1 sec, other languages 2 seconds

Space Limitations: C/C + + 32768K, other languages 65536K
64bit IO Format:%lldTitle Description
The Little fairy birthday, a lot of celebrities are coming, like the small King Kong, Bump Mann, bald strong AH. Come so many people, the little fairy shy hide up. At this time, the air came a wisp of cake aroma, the little fairy no longer shy, rushed out two eyes to take the green light (n-side shape) cake, the Little fairy thought: emmmm ... A lot of people, they eat a bad person. But I want to eat big!!! How to do!!! Small g saw this scene, in order to let the little fairy can't open happy to eat big cake, can only be along the diagonal (n-3) times, cut into triangles, cut into (n-2) block the biggest piece to the little fairy, now want how to make the biggest piece of cake smallest.
Input Description:
Multiple sets of data input and output
The first line, an integer n, represents the number of vertices of the polygon,
The following n rows are two integers x per line, and Y represents the horizontal ordinate of the point, respectively
Output Description:
One row for each set of outputs.
The size of the cake that outputs the largest block is one after the floating-point number.
Example 1 input
67 06 29 53 50 31 1
Output
9.0
Note:
For a sample of 100%,
4<=n<=100;
-100<=x,y<=100

D YB to hit the Furnace Stone

Time limit: C/s 1 sec, other languages 2 seconds

Space Limitations: C/C + + 32768K, other languages 65536K
64bit IO Format:%lldTitle Description
Wozuinb like to play the stone legend, but the food is not good, so he decided to play the arena to practice practiced hand. System in order to give n cards, each card has its own use consumption a[i], each time only give one, WOZUINB can choose or discard this card. Each card selected will be placed in the order of selection in the card slot, when the card slot is filled with 30 sheets can form a set of cards. Wozuinb hope that the consumption of his deck meets a smooth curve, that is, 30 cards are satisfied with the first card consumption is not less than the I-1 (i>1). Please help WOZUINB take a look, these cards can make up the desired deck, if you can compose the output "yes", if you cannot output "no".
Input Description:
The first line enters an integer n,0<n<100.
The second line enters a line of numbers a[i], each number is separated by a space, representing the consumption of the card that appears on the first sheet.
Output Description:
Output one line, "yes" or "no"
Example 1 input
51 2 3) 4 5
Output
No

E Little G has a big tree

Time limit: C/s 1 sec, other languages 2 seconds

Space Limitations: C/C + + 32768K, other languages 65536K
64bit IO Format:%lldTitle Description
Little G wants to move the orange tree in his home yard to the door (qaq. Just as Little G is Popeye. But little G is a man with a balanced grey, often grey, and he wants to find a balance in the orange tree. How to describe this tree ... Think of it as a tree made up of nodes. The node count is the tree weight.
Input Description:
Multiple sets of data input and output,
The first line contains an integer n (3<=n<=1000) that represents the number of nodes of the tree
The following n-1 lines describe the connection relationship between nodes (1-n).
Output Description:
The output of two integers x,num represents the balance point of the tree, and the node number of the maximum subtree after the balance point is deleted (if the node is the same as the output numbers are small).
Example 1 input
31 21 3
Output
1 1

Long Live F Demacia

Time limit: C/s 1 sec, other languages 2 seconds

Space Limitations: C/C + + 32768K, other languages 65536K
64bit IO Format:%lldTitle Description Demacia is a strong, law-abiding country, with outstanding meritorious history of the military. This place attaches great importance to the ideology of justice, honor and responsibility, and the people here are very proud of it. One day they wanted to sanction the evil bilgewater, so they sent their best fighters. As a result bilgewater the territory was too small, only a length of n wide for m amounted to n*m block of land, some of which were labeled 0 as mountains or deep-sea lakes, where heroes could not stand, only the land marked 1 could accommodate a hero. The heroes of Demacia have a characteristic of fighting, and they don't want their teammates to stand beside themselves and look ambiguous. Can you tell me how many ways to arrange Demacia heroes? Input Description:
Input contains multiple sets of test data;
The first row of each group of data contains 2 integers n and m (n <=, M <= 12), separated by a space;
The next n rows, the number of M per line, represent N*m's bilgewater territory.
Output Description:
Outputting an integer n represents the method for arranging the application.
(The answer is taken from the film 100000000)
Example 1 input
3 31 1 10 1 11 0 0
Output
24

G sent out Qaq.

Time limit: C/s 1 sec, other languages 2 seconds

Space Limitations: C/C + + 32768K, other languages 65536K
64bit IO Format:%lldThe title describes Hangzhou as a person who is stupid 62, and there is no such custom in the Doodle home. Compared with 62, the people there are more annoying the number 38, of course, there are 4 this number! So, Doodle doesn't want to see numbers that contain 38 or 4. Each time you give an interval [n,m], can you find all the annoying numbers? Input Description:
Multiple sets of input and output;
All inputs are integers to n, m (0<n≤m<1000000),
If you encounter an integer pair that is 0, the input ends.
Output Description:
For each input
Output the number of all annoying numbers
Example 1 input
1 1000 0
Output
20

H Break-up Bureau

Time limit: C/s 1 sec, other languages 2 seconds

Space Limitations: C/C + + 32768K, other languages 65536K
64bit IO Format:%lldTitle Description
Since it is the end of the Bureau, we will play random numbers. It is known that the first 10 items of a series are {0, 1, 1, 2, 4, 7, 13, 24, 44, 81} Small G not satisfied: I want more number!!! No, I won't let you play. The little G will ask you what number is the nth item, please answer this naughty child.
Input Description:
Multiple sets of data input and output;
The first line enters an integer n (1<=n<=50)
Output Description:
The number of nth in the output sequence.
Example 1 input
123
Output
011

time limit: C/s 1 sec, other languages 2 seconds
Space Limitations: C/C + + 32768K, other languages 65536K
64bit IO Format:%lldTitle Description
Taotao's computer does not move the Jedi to survive, so Taotao only to play the PC version of the Wilderness, and Jedi survival, the game characters themselves can carry a certain weight m of items, equipped with backpacks can carry more H (H 0 for no backpack) weight of things. Play for a few days Taotao found a bug, when equipped with a backpack, if you can carry the weight is not full, you can take an arbitrary heavy things. (Explanation see example) one day Taotao to a strange island, the island has n pieces of equipment, each equipped with a weight of WI and the value of the VI, but Taotao do not know these equipment, so he came to help you, pick the most powerful equipment, help him eat chicken.
Input Description:
The subject has multiple sets of inputs (less than 10) that end when N=0 is entered.
The first line enters N,m,h. N,m,h is an integer, and 0<=n,m,h<=100,
Next n rows, each line enters the weight of the item I items of WI and the Power value VI. 0<=wi,vi<=100.
Output Description:
Outputs the maximum power value, one row per set of outputs.
Example 1 input
3 3 32 33 22 30
Output
8
Description
The total weight that can be carried is 6, when you take the first two pieces of equipment, at this time the capacity is 5/6, you can also take the third item.

"Title Set" Cattle Network • 2018 National multi-school algorithm winter Camp Practice competition (second session)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.