Skip to main content

Table 6 Programming contest problems. All problems are available from https: //github.com/AI-comp/Problems2017 (in Japanese)

From: Student placement and skill ranking predictors for programming classes using class attitude, psychological scales, and code metrics

No.

Description sentence

1

There are three kinds of menus in a certain oil soba shop: regular bowl, large bowl, and god bowl. The regular bowl is a grams, the large bowl is more than b grams from the regular bowl, and the god bowl is c grams more than the large bowl. Kato-kun ate a regular size bowl, a large size bowl, and a god size bowl. How many grams Kato-kun did eat?

2

Kato-kun is trying to make doujinshi as a hobby. Progressing smoothly, a total of x pages have been completed so far. Since the exhibition and sale are close, Kato-kun asked the printing company to bind, but according to a complicated situation, the printing company asked him to make the number of pages a multiple of 4. If x is a multiple of 4, the doujinshi is completed. If not a multiple, it is necessary to add a page so that it is a multiple of 4. In addition, Kato-kun does not want to reduce the number of pages of doujinshi because it would be a waste of his time and effort. Since the number of pages already created by Kato-kun is given, output the minimum number of newly created pages for printing.

3

Kato-kun decided to clean his room because it was too dirty. However, Kato-kun is lazy, and he found that the room looks clean if things are on the right side of the room. Thus, he decided to clean his room by moving all items to the right side of the room. The state of the room is given as a one-line character string S. String S consists of only characters o, where o indicates the location of items and. indicates a place a location without an item. Output a character string representing the state of the room with all items on the right. For example, if S is o.ooo.., the answer is...oooo.

4

World Nokémon Championship (WNCS) is a world competition to determine the Nokémon Master. This tournament consists of a qualifying round and a main battle. Top N people in the qualifying round play in the main battle, which is a round-robin tournament. As the result of this round-robin battle is given as a table, display the ranking of the main battle in order from the top. In the win/loss table, ci,j represents the result of the person in ith place in qualifying against the person in jth place. o represents the winning of the person in ith place, and x represents the losing of the person in ith place. Since people cannot compete against themselves, − representing ci,i appears in the table, but a battle does not occur. People with the most wins will be at the top of the ranking. If there is tie for the number of wins, the one with a higher ranking in the qualifying round wins.

5

Character string S consists of the letters A, N, P. Output YES if the given string S can be generated from the string PPAP using the replacement of P = NP, NO if it is impossible. P = NP replaces P with NP or NP with P. For example, the character string NPPAP can be generated by replacing P at the head of PPAP with NP.

6

Kato-kun, who has a strong appetite but does not exercise, decides to squat N! times after eating N grams of oiled ramen noodles. However, the intelligent Kato-kun realized that N! becomes an explosive number and cannot handle the squats. Thus, he decides to complete only the remainder of N divided by 2017 times because this year is 2017. Calculate the number of times Kato-kun squats, when N is given. (a×b) mod p=((a mod p)×b) mod p for the integers a,b and p.

7

A video game called Nokémon GO catches on with the public. Nokémon GO players move through places called NokéStops to collect and try to collect a lot of Nokémons. One day, Ashe, who is a main protagonist, visited N NokéStops. The ith of these NokéStops exists at coordinates (pi,qi). In addition, there are M Nokémons on the field, and they are at coordinates (xi,yi). While staying at a NokéStop, Ashe can collect all Nokémons within a radius of L miles from the NokéStop. Due to social demands, it is forbidden to catch Nokémons while moving. Calculate the maximum number of Nokémons that Ashe can collect on this day.

8

Professionals Pass All Problems (PPAP) is a ritual handed down in the Kingdom of Hylule from the old days. This ritual requires two pens, one apple, and one pineapple. This ceremony has been keeping peace in the kingdom of Hylule at the one shrine maiden. Zerda is the heir of the shrine maiden and practices this ritual every day. The ritual is practiced x times to master. In other words, Zerda buys more than 2x pens, x apples, and x pineapples to acquire the PPAP. There are N Telly’s shops in the kingdom, and ai pens, bi apples, and ci pineapples are sold in one set. All Telly’s shops sell the set. Calculate the minimum amount required for Zerda to master PPAP. Answer -1 if it is impossible to buy the quantity necessary.