Problem J1: Deliv-e-droid
Problem Description
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.
Input Specification
The input will consist of two lines. The first line will contain a non-negative integer P , representing the number of packages delivered. The second line will contain a non-negative integer C, representing the number of collisions with obstacles.
Output Specification
The output will consist of a single integer F , representing the final score. Sample Input 1 5 2 Output for Sample Input 1 730 Explanation of Output for Sample Input 1 There are 5 packages delivered, so 5 × 50 = 250 points are gained. There are 2 collisions, so 2 × 10 = 20 points are lost. Since 5 > 2, a bonus 500 points are earned. Therefore, the final score is 250 − 20 + 500 = 730. Sample Input 2 0 10 Output for Sample Input 2 -100 Explanation of Output for Sample Input 2 There are 0 packages delivered, so 0 × 50 = 0 points are gained. There are 10 collisions, so 10 × 10 = 100 points are lost. Since 0 ≤ 10, no bonus points are earned. Therefore, the final score is 0 − 100 + 0 = −100.
La version fran¸caise figure a` la suite de la version anglaise.
Probleme J1 : Livr-`a-dro¨ıde´
Enonc´e du probl`eme
Dans le jeu Livr-a-dro¨ıde, un dro¨ıde robot doit livrer des colis tout en ´evitant des obstacles.
la fin du jeu, le score final est calcul´e en fonction du syst`eme de points suivant :
A
— Vous gagnez 50 points pour chaque colis livr´e.
— Vous perdez 10 points pour chaque collision avec un obstacle.
— Vous gagnez un bonus de 500 points si le nombre de colis livr´es est sup´erieur au
nombre de collisions avec des obstacles.
Votre tˆache consiste ad´eterminer le score final a
la fin d’une partie.
Pr´ecisions par rapport aux donn´ees d’entr´ee Les donn´ees d’entr´ee ne contiennent que deux lignes. La premi`ere ligne doit contenir un entier non n´egatif P , repr´esentant le nombre de colis livr´es. La seconde ligne doit contenir un entier non n´egatif C, repr´esentant le nombre de collisions avec des obstacles.
Pr´ecisions par rapport aux donn´ees de sortie
Les donn´ees de sortie ne devraient contenir qu’un seul entier F , repr´esentant le score final.
Donn´ees d’entr´ee d’un 1er exemple
5
2
Donn´ees de sortie du 1er exemple
730
Justification des donn´ees de sortie du 1er exemple
Puisqu’il y a 5 colis qui sont livr´es, alors 5 × 50 = 250 points sont gagn´es. Puisqu’il y a 2
collisions, alors 2 × 10 = 20 points sont perdus. Puisque 5 > 2, alors le bonus de 500 points
est accord´e. Donc, le score final est ´egal a 250 − 20 + 500 = 730. **Donn´ees d’entr´ee d’un 2e exemple** 0 10 **Donn´ees de sortie du 2e exemple** -100 Justification des donn´ ees de sortie du 2e exemple Puisqu’il y a 0 colis qui sont livr´es, alors 0 × 50 = 0 points sont gagn´es. Puisqu’il y a 10 collisions, alors 10 × 10 = 100 points sont perdus. Puisque 0 ≤ 10, le bonus de 500 points n’est pas accord´e. Donc, le score final est ´egal a
0 − 100 + 0 = −100.
English version appears before the French version
Problem J2: Chili Peppers
Problem Description 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.
Input Specification The first line of input will contain a positive integer N , representing the number of peppers Ron adds to his chili. The next N lines will each contain the name of a pepper Ron has added. Each pepper name will exactly match a name that appears in the table above. Note that more than one pepper of the same name can be added. Output Specification The output will consist of a positive integer T , representing the total spiciness of Ron’s chili. Sample Input 4 Poblano Cayenne Thai Poblano Output for Sample Input 118000 Explanation of Output for Sample Input A Poblano pepper has an SHU value of 1500. A Cayenne pepper has an SHU value of 40000. A Thai pepper has an SHU value of 75000. The total spiciness of Ron’s chili is therefore 1500 + 40000 + 75000 + 1500 = 118000. La version fran¸caise figure a` la suite de la version anglaise.
Probl`eme J2 : Piments
Enonc´e du probl`eme
Ron pr´epare du chili en utilisant une vari´et´e de piments.
Le piquant d’un piment est mesur´e en unit´es thermiques de Scoville (SHU). Au d´ebut, le
chili de Ron n’est pas du tout ´epic´e. Cependant, a chaque fois qu’il ajoute un piment, le piquant total de son chili augmente d’une valeur ´egale a
celle du SHU de ce piment.
Les valeurs SHU des piments dont dispose Ron sont indiqu´ees dans le tableau suivant :
Vari et es de piment | Unit es thermiques de Scoville |
---|---|
Poblano | 1500 |
Mirasol | 6000 |
Serrano | 15500 |
Cayenne | 40000 |
Thai | 75000 |
Habanero | 125000 |
Votre tˆache consiste ad´eterminer le piquant total du chili de Ron une fois qu’il a termin´e d’ajouter des piments. **Pr´ecisions par rapport aux donn´ees d’entr´ee** La premi
ere ligne des donn´ees d’entr´ee doit contenir un entier strictement positif N , repr´esentant
le nombre de piments que Ron a ajout´e a` son chili. Chacune des N lignes suivantes doit
contenir le nom d’un piment que Ron a ajout´e. Les noms des piments ajout´es doivent correspondre exactement aux noms des piments qui figurent dans le tableau ci-dessus. Remarquez
que n’importe quelle vari´et´e de piment peut ˆetre ajout´ee plus d’une seule fois.
Pr´ecisions par rapport aux donn´ees de sortie
Les donn´ees de sortie devraient afficher un entier strictement positif T , repr´esentant le piquant total du chili de Ron. Exemple de donn´ees d’entr´ee 4 Poblano Cayenne Thai Poblano Exemple de donn´ees de sortie 118000
English version appears before the French version
Justification des donn´ees de sortie Un piment poblano a une valeur SHU de 1500. Un piment de Cayenne a une valeur SHU de
- Un piment tha¨ı a une valeur SHU de 75000. Le chili de Ron a donc un piquant total de 1500 + 40000 + 75000 + 1500 = 118000.
English version appears before the French version
Problem J3: Special Event
Problem Description 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. Input Specification The first line of input will contain a positive integer N , representing the number of people interested in attending your event. The next N lines will each contain one person’s availability using one character for each of Day 1, Day 2, Day 3, Day 4, and Day 5 (in that order). The character 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. |
Output Specification 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). Sample Input 1 3 YY.Y. ...Y. .YYY. Output for Sample Input 1 4 Explanation of Output for Sample Input 1 All three people are able to attend on Day 4, and they are not all available on any other day. La version fran¸caise figure a` la suite de la version anglaise.
Sample Input 2 5 YY..Y .YY.Y .Y.Y. .YY.Y Y...Y Output for Sample Input 2 2,5 Explanation of Output for Sample Input 2 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.
Problem J5: CCC Word Hunt
Problem Description 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. Input Specification The first line of input will contain a string of distinct uppercase letters, W , representing the word you are to search for in the grid. The length of W will be at least two. The second line of input will be an integer R (1 R 100), where R is the number of rows in the grid. The third line of input will be an integer C (1 C 100), where C is the number of columns in the grid. The remaining input will provide the letters in the grid. It will consist of R lines, where each line contains C uppercase letters separated by single spaces. The following table shows how the available 15 marks are distributed: ...