from atcoder
Problem Statement
Time Limit: 2 sec / Memory Limit: 1024 MB
Score : 300300 points
Takahashi is a martial artist. There are NN moves that a martial artist can learn, called Move 11, 22, \ldots…, NN. For each 1 \leq i \leq N1≤i≤N, it takes T_iTi minutes of practice to learn Move ii. Additionally, at the beginning of that practice, all of the Moves A_{i,1}Ai,1, A_{i,2}Ai,2, \ldots…, A_{i,K_i}Ai,Ki must be already learned. Here, it is guaranteed that A_{i,j} < iAi,j<i for each 1 \leq j \leq K_i1≤j≤Ki.
Takahashi has not learned any move at time 00. He cannot practice for more than one move simultaneously, nor can he stop a practice he has already started. Find the minimum number of minutes needed for Takahashi to learn Move NN.
Constraints
5507




被折叠的 条评论
为什么被折叠?



