Cinema Theatre Problem
All submissions for this problem are available.
Assume PVR has introduced ‘1-Day premium’ tickets. With a ticket, you can see all the movies that PVR is showing on the day you are going. Assume the movies are non-overlapping in a day. You have different levels of interest towards each movie (which is treated as an integer called benefit value). You are also given the time period a movie is shown(from which day to which day, incl. both). Your aim is to maximize the net worth,(i.e., the sum of the benefit value of all the movies shown on that day) by choosing an appropriate day to go to PVR. Let M be the number of Movies, and N be the total number of days. You are given (starting_day, ending_day, benefit_val) for all M movies (all are positive integers). M can go up to 10^5, N up to 10^13 and B values up to 10^9. i/p format: N M S1 E1 B1 S2 E2 B2 .. Sn En Bn o/p format: Net worth followed by a newline Sample Input: 20 3 1 10 100 9 20 100 15 17 100 Sample Output: 200 Reason: day & score [1,8] - 100 [9,10] - 200 [11,14] - 100 [15,17] - 200 [18, 20] - 100
|Time Limit:||2 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, SCM chicken, PYP3, CLOJ, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.