Hi guys! I have found this problem frot main.edu.pl, it seems quite interesting and I can't come up with some solution. http://main.edu.pl/en/archive/oi/19/hur Can you help me?
# | User | Rating |
---|---|---|
1 | Benq | 3783 |
2 | jiangly | 3666 |
3 | tourist | 3611 |
4 | Um_nik | 3536 |
5 | inaFSTream | 3477 |
6 | fantasy | 3468 |
7 | maroonrk | 3464 |
8 | QAQAutoMaton | 3428 |
9 | ecnerwala | 3427 |
10 | Ormlis | 3396 |
# | User | Contrib. |
---|---|---|
1 | Um_nik | 184 |
2 | adamant | 178 |
3 | awoo | 177 |
4 | nor | 169 |
5 | maroonrk | 165 |
6 | -is-this-fft- | 163 |
7 | antontrygubO_o | 152 |
8 | ko_osaga | 151 |
9 | dario2994 | 150 |
10 | SecondThread | 149 |
Hi guys! I have found this problem frot main.edu.pl, it seems quite interesting and I can't come up with some solution. http://main.edu.pl/en/archive/oi/19/hur Can you help me?
Name |
---|
Sell the planks greedily: if there are enough planks simply give it to the customer. If there's not enough planks you can "unsell" the heaviest demand you have served so far and see if it's a better option. Code: http://ideone.com/PZXImm