In the game, Deliv-e-droid, a robot droid has to deliver packages while avoiding obstacles. At the end of the game, the final score is calculated based on the following point system:
Gain 50 points for every package delivered.
Lose 10 points for every collision with an obstacle.
Earn a bonus 500 points if the number of packages delivered is greater than the number of collisions with obstacles.
Your job is to determine the final score at the end of a game.
The input will consist of two lines. The first line will contain a
non-negative integer
The output will consist of a single integer
5
2
730
There are 5 packages delivered, so
0
10
-100
There are 0 packages delivered, so
Ron is cooking chili using an assortment of peppers.
The spiciness of a pepper is measured in Scolville Heat Units (SHU). Ron’s chili is currently not spicy at all, but each time Ron adds a pepper, the total spiciness of the chili increases by the SHU value of that pepper.
The SHU values of the peppers available to Ron are shown in the following table:
Pepper Name | Scolville Heat Units |
---|---|
Poblano | 1500 |
Mirasol | 6000 |
Serrano | 15500 |
Cayenne | 40000 |
Thai | 75000 |
Habanero | 125000 |
Your job is to determine the total spiciness of Ron’s chili after he has finished adding peppers.
The first line of input will contain a positive integer
The output will consist of a positive integer
4
Poblano
Cayenne
Thai
Poblano
118000
A Poblano pepper has an SHU value of
You are trying to schedule a special event on one of five possible days.
Your job is to determine on which day you should schedule the event, so that the largest number of interested people are able to attend.
The first line of input will contain a positive integer Y
means the person
is able to attend and a period (.
) means the person is not
able to attend.
The following table shows how the available 15 marks are distributed:
Marks | Description |
---|---|
6 | There will be exactly one day on which every person will be able to attend. |
6 | There will be exactly one day on which the largest number of people will be able to attend. |
3 | There might be more than one day on which the largest number of people will be able to attend. |
The output will consist of one line listing the day number(s) on which the largest number of interested people are able to attend.
If there is more than one day on which the largest number of people are able to attend, output all of these day numbers in increasing order and separated by commas (without spaces).
3
YY.Y.
...Y.
.YYY.
4
All three people are able to attend on Day 4, and they are not all available on any other day.
5
YY..Y
.YY.Y
.Y.Y.
.YY.Y
Y...Y
2,5
There is no day on which all five people are able to attend. Four people are able to attend on both Day 2 and Day 5.
Bocchi the Builder just finished constructing her latest project: a laneway consisting of two rows of white equilateral triangular tiles. However, at the last moment, disaster struck! She accidentally spilled black paint on some of the tiles. Now, some of the tiles are wet and the other tiles are dry. Bocchi must place warning tape around the perimeters of all wet areas. Can you help her determine how many metres of tape she needs?
The first triangular tile will point upwards. Each pair of adjacent tiles (that is, tiles that share a common side) will point in opposite directions. Each tile has a side length of 1 metre.
The first line of input will consist of one positive integer
The next two lines will each consist of
The following table shows how the available 15 marks are distributed:
Marks | Description | Bound |
---|---|---|
3 | The laneway is not very long, black tiles are never adjacent and the second row is fully white. | |
3 | The laneway is not very long, black tiles may be adjacent and the second row is fully white. | |
5 | The laneway is not very long, black tiles may be adjacent and may appear in the second row. | |
4 | The laneway may be very long, black tiles may be adjacent and may appear in the second row. |
Output a single integer representing the length of tape Bocchi needs, in metres.
5
1 0 1 0 1
0 0 0 0 0
9
The tiles are painted as follows, creating three wet areas. Bocchi will need 9 metres of warning tape as shown in yellow.
7
0 0 1 1 0 1 0
0 0 1 0 1 0 0
11
The tiles are painted as follows, creating three wet areas. Bocchi will need 5 metres of warning tape to surround one area and 3 metres of warning tape to surround each of the other two areas as shown in yellow.
In the CCC Word Hunt, words are hidden in a grid of letters. The letters of a hidden word always appear in order on horizontal, vertical, or diagonal line segments in one of two ways. One way is for the letters of a word to appear on one line segment. The other way is for the letters of a word to appear on one line segment up to some letter and then on a second line segment that forms a right angle at this letter.
Given a grid of letters and a single word to search for, your job is to determine the number of times that particular word is hidden in the grid.
The first line of input will contain a string of distinct uppercase
letters,
The remaining input will provide the letters in the grid. It will
consist of
The following table shows how the available 15 marks are distributed:
Marks | Word Placement |
---|---|
2 | On one horizontal line segment |
2 | On one horizontal or vertical line segment |
2 | On one horizontal, vertical, or diagonal line segment |
9 | On one line segment or two perpendicular line segments |
The output will consist of a single non-negative integer
MENU
5
7
F T R U B L K
P M N A X C U
A E R C N E O
M N E U A R M
M U N E M N S
3
The word MENU
is hidden three times in the grid. Once
horizontally, once vertically, and once diagonally as shown. Notice that a single letter can be used more than once.
NATURE
6
9
N A T S F E G Q N
S A I B M R H F A
C F T J C U C L T
K B H U P T A N U
D P R R R J D I R
I E E K M E G B E
4
The word NATURE
is hidden four times in the grid. Once
diagonally, once vertically, and twice on perpendicular line
segments.