Problem Summary
Given M types of coins in infinite quantities where the value of each type of coin is given in array C, determine the number of ways to make change for N units using these coins.
Given a map with N shopping centers and M bidirectional roads. Each road connects two distinct shopping centers and has a travel time. There are K different kinds of fish sold in these centers, and each center may have different kinds of fish.
Two cats travel from center 1 to center N, and they want to collectively purchase all K types of fish in a minimal amount of time. Any purchase costs no time. Their paths are not necessarily the same. The total shopping time is the maximum of two cats’ shopping times. Find the minimal total shopping time.
(2 ≤ N ≤ 1000 , 1 ≤ M ≤ 2000 , 0 ≤ K ≤ 10)
Alice and Bob play a game.
Given a tree with N nodes, two integers G and K, and G guesses (u1,v1),…,(ug,vg). (1<=N,G,K<=100000)
(ui,vi) means Alice guesses that ui is the parent of vi.
When a node of the tree is randomly selected (with equal probability) to be root by Bob, and Alice does not know, find the probability that the number of right guesses is greater than or equal to K.