Task There are n informational Olympiads you can participate in. For each Olympiad, you know the start and end dates and

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Task There are n informational Olympiads you can participate in. For each Olympiad, you know the start and end dates and

Post by answerhappygod »

Task There Are N Informational Olympiads You Can Participate In For Each Olympiad You Know The Start And End Dates And 1
Task There Are N Informational Olympiads You Can Participate In For Each Olympiad You Know The Start And End Dates And 1 (144.78 KiB) Viewed 36 times
c++ programing
use dynamic programming. the perfect algorithm;s this complexity
is O(n logn)
Task There are n informational Olympiads you can participate in. For each Olympiad, you know the start and end dates and how much you will be rewarded. You can only attend one Olympiad during a day. Input The first input line is the integer n: number of informational Olympiads. Then, there are n lines. Each line has three integers s, e, r: starting day, ending day, reward Output Print only one integer x : the maximum amount of reward you can earn. (You can freely set the variable name.) Constraints Time limit : 1.00 Memory limit : 512MB 1 <n< 2*10^5 1 ssses 10^9 1 <r < 10^9 Example input: output: explain: 1 2 3 4 5 6 7 8 reward 4 4 2 4 4 6 2 3 6 6 6 8 2 5 7 3 7 3 First, Last Olympiads
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply