Google-Developer-Student-Club-CCOEW / Competitive-Programming-2023-GDSC-CUMMINS-X-GDSC-MMCOE

Welcome to the Hacktoberfest 2023 Competitive-Programming Cohort for Cummins College and MMCOE students! To request issue assignment, create a pull request, providing: 1. Full Name 🧑‍🎓 2.Email 📧 3.College ID (RNO) 🔢 4.Branch of Study.📚 5. Year 📆 .The Cummins College and MMCOE students' PRs will be considered only. Thank you!
9 stars 69 forks source link

Projects #152

Closed suryaprakashpandey closed 11 months ago

suryaprakashpandey commented 1 year ago

Write code in the preferred language and attach output with it.

There are n projects you can attend. For each project, you know its starting and ending days and the amount of money you would get as reward. You can only attend one project during a day.

What is the maximum amount of money you can earn?

Input The first input line contains an integer n: the number of projects.

After this, there are n lines. Each such line has three integers ai, bi, and pi: the starting day, the ending day, and the reward.

Output Print one integer: the maximum amount of money you can earn.

Example: Input: 4 2 4 4 3 6 6 6 8 2 5 7 3 Output: 7

akanksha1131 commented 11 months ago

Can you please assign this to me? Akanksha Kale TY IT, Cummins