Week 5Workshop
CP - Session 5
Session 5 Contest: Greedy Algorithm
COMP6226001 Competitive Programming
How to Join
- Open the contest: https://vjudge.net/contest/856438
- Log in to Vjudge (or create a free account if you do not have one).
- When asked, enter the access code:
LA01-CP-005 - Open a problem from the contest list, write your solution in C++, and click Submit.
- Check the verdict (Accepted, Wrong Answer, and so on), then fix and resubmit if needed.
Tips: start with the easy problems, read the input format carefully, and use long long when numbers can be large.
Problems
| # | Problem | Idea in one line |
|---|---|---|
| 1 | Hit the Lottery (Codeforces 996A) | Pay a given amount using the fewest bills of 1, 5, 10, 20, and 100. |
| 2 | Array Rearrangement (Codeforces 1445A) | Can you reorder array b so that a[i] + b[i] <= x for every i? |
| 3 | Twins (Codeforces 160A) | Take the fewest coins so that their sum is strictly larger than the sum of the rest. |
| 4 | Busy Man (SPOJ BUSYMAN) | Choose the maximum number of activities that do not overlap in time. |
| 5 | Queue (Codeforces 545D) | Reorder the queue so that the most people wait no longer than their own service time. |
| 6 | Minimum Spanning Tree (SPOJ MST) | Find the minimum total weight of edges that connect all nodes of a graph. |
| Bonus | Dragons (Codeforces 230A) | Can you defeat all dragons in some order, gaining strength after each win? |