Solutions are presented as using the least memory and the fastest execution time. It also takes the top 10 most recent solutions from each language. If you want to limit to a specific index, click the "Solved" button and go to that problem.
ContestId |
Name |
Phase |
Frozen |
Duration (Seconds) |
Relative Time |
Start Time |
|---|---|---|---|---|---|---|
| 802 | Helvetic Coding Contest 2017 online mirror (teams allowed, unrated) | FINISHED | False | 16200 | 280446923 | May 28, 2017, 8:05 a.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 1486 ) | M2 | April Fools' Problem (medium) | PROGRAMMING | binary search flows graphs | 2400 |
The marmots need to prepare k problems for HC 2 over n days. Each problem, once prepared, also has to be printed. The preparation of a problem on day i (at most one per day) costs a i CHF, and the printing of a problem on day i (also at most one per day) costs b i CHF. Of course, a problem cannot be printed before it has been prepared (but doing both on the same day is fine). What is the minimum cost of preparation and printing? The first line of input contains two space-separated integers n and k ( 1 ≤ k ≤ n ≤ 2200 ). The second line contains n space-separated integers a 1 , ..., a n ( ) — the preparation costs. The third line contains n space-separated integers b 1 , ..., b n ( ) — the printing costs. Output the minimum cost of preparation and printing k problems — that is, the minimum possible sum a i 1 + a i 2 + ... + a i k + b j 1 + b j 2 + ... + b j k , where 1 ≤ i 1 < i 2 < ... < i k ≤ n , 1 ≤ j 1 < j 2 < ... < j k ≤ n and i 1 ≤ j 1 , i 2 ≤ j 2 , ..., i k ≤ j k . In the sample testcase, one optimum solution is to prepare the first problem on day 1 and print it on day 1 , prepare the second problem on day 2 and print it on day 4 , prepare the third problem on day 3 and print it on day 5 , and prepare the fourth problem on day 6 and print it on day 8 . |
| helvetic-coding-contest-2017-editorial.pdf |
No solutions yet.