Moovie Mooving
의견: 0
Bessie wants to hide from Farmer John for L (1 <= L <= 100,000,000) minutes, during which she wants to watch movies continuously. She has N (1 <= N <= 20) movies to choose from, each with a certain duration and a set of showtimes during the day. Bessie may enter and exit a movie at any time during one of its showtimes, but she does not want to ever visit the same movie twice, and she cannot switch to another showtime of the same movie that overlaps the current showtime.
Determine if it is possible for her to watch movies continuously from time 0 through time L. If it is, determine the minimum number of movies she needs to see.
Line 1: N and L.
The next N lines each describe a movie: its integer duration D (1 <= D <= L) and the number of showtimes C (1 <= C <= 1000), followed by C integers in the range 0..L giving the start times of the showings (distinct, in increasing order).
A single integer indicating the minimum number of movies Bessie needs to see to achieve her goal. If this is impossible, output -1.
movie.inmovie.out4 100
50 3 15 30 55
40 2 0 65
30 2 20 90
20 1 03Output details: Watch movie 4 (0-20), movie 1 (20-65), then movie 2 (65-100).
평가 및 의견
Moovie Mooving
Log in to rate problems.
아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.
풀이 제출
Moovie Mooving