标签: DP

「CF1263F」Economic Difficulties

An electrical grid in Berland palaces consists of 2 grids: main and reserve. Wires in palaces are made of expensive material, so selling some of them would be a good idea!

Each grid (main and reserve) has a head node (its number is 1). Every other node gets electricity from the head node. Each node can be reached from the head node by a unique path. Also, both grids have exactly n nodes, which do not spread electricity further.

「CodeForces 1236E」Alice and the Unfair Game

Alice is playing a game with her good friend, Marisa.

There are 𝑛 boxes arranged in a line, numbered with integers from 1 to 𝑛 from left to right. Marisa will hide a doll in one of the boxes. Then Alice will have 𝑚 chances to guess where the doll is. If Alice will correctly guess the number of box, where doll is now, she will win the game, otherwise, her friend will win the game.