In one unremarkable collection of tasks for training programmers I found as many as 7 problems about a saber character, especially for fans, apparently) ... From graph theory and SS to TV and combinatorics
Graph theory. 1st Harry Potter Challenge. Harry Potter and Hermione Granger are competing to eat chocolate frogs laid out on a chessboard. The board is turned to Harry by the angle with A1 cell, and to Hermione - by the angle with H8 cell. At the expense of 3, they begin to eat frogs. The first frog eaten by a player will take as many milliseconds as the cells make up the shortest path (not diagonally!) To it from the player’s corner, and the next one, if it lies next to the first, to the left, to the right, above, below, or diagonally 1 cell away - 1 millisecond. Find at least 1 sequence of moves of Harry and Hermione, the result of which would be Harry’s victory on the N-th millisecond after eating K frogs.
')
Combinatorics. The 2nd Harry Potter Challenge. Harry Potter unraveled what the abbreviation "RAB" could mean. For this, he has compiled a list of all the names of wizards he knows, starting with these letters. Find the total number of possible name combinations and a list of the 10 shortest abbreviations.
Number systems The 3rd Harry Potter Challenge. Harry Potter believes in the unknown Magic Number System. Thus, the number 100 recorded on the ARIA is equal to 289 in the 10-day SS. Convert the number N from the 10-time SS to the BCC.
Number systems 4th Harry Potter Problem. Ron in the class of magical mathematics added 2 numbers to the BCC, but he made a mistake and got the number C in the value of the sum. Harry corrected him, saying that C should be 10cc more because the sum of the last digits of the terms is a two-digit number with the high order of 1. Find 2 any such A and B, the sum of which is equal to the true value of C.
Measuring information. 5th Harry Potter Problem. How many magic bytes will be required for the Magic Telegraph to encode the message “Save yourself who can!” As short as possible. The ministry has fallen, Scrimgeour is murdered! ” 1 magic byte = N normal.
Algebra of logic. 6th Harry Potter Challenge. Volan de Mort has learned from Snape that now: Harry Potter is in Godrikova Hollow, with Harry Ron and Hermione, Ron is in Nora, Hermione is with Ron, Hermione is in Godrikova Hollow. At least one of the news is false, and at least two are true. Find with Volan de Mort all possible combinations of true and false statements that give a consistent picture.
Probability theory. The 7th Harry Potter Challenge. On the eve of the elections in Hogwarts, Harry Potter registered as a candidate for the school’s director and instructed his assistants, Ron and Hermione, to distribute leaflets “Potter’s Plan - a victory for magic!” In the corridors of the school. In total, N leaflets were distributed to male students, and M leaflets to female students. Each i-th leaflet given to the boy increases the percentage of voting for Harry among boys by i% of those who vote against him at the moment, and each i-th leaflet given to the girl increases the percentage of voting for Harry among girls by i times. Initially, only 1% of boys and 1% of girls voted for Harry. How many% of votes will a candidate Potter pick up after distributing flyers?
UPD: I combed some text to make it easier to read and the text of the tasks did not merge)