시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
5 초 | 512 MB | 48 | 25 | 25 | 53.191% |
Seeking to cash in on the lucrative private education business, EduCorp recently established the prestigious ”Bootcamp Academy of Economics” and, counter to their early projections, is growing rapidly.
So rapidly, in fact, that the student body is already overflowing the small (but prestigious) campus building and now needs to be contained somewhere else while more new (and prestigious) buildings are built.
Each department will sell off its original space and then move into its own new rented building. As departments are deeply territorial, buildings must not be shared. Because this is an economics academy, the capacities and rents of each of all the local available buildings were easy to find by disguising the task as homework.
However, it still remains to choose which buildings to rent so as to minimise total budget. This is where you can help.
If it is not possible to rent enough buildings for all the departments, output impossible.
Otherwise, output n unique, space-separated integers v1. . . vn, where the i-th number is the building to be rented by the i-th department so as to minimise the total spend on rent. If there are multiple equally good answers, you may print any.
2 5 40 200 1000 199 201 10 50 600 300 400 200 800
2 3
3 5 10 20 30 30 25 20 15 10 30 25 20 15 10
5 3 1
1 1 20 10 1
impossible
ICPC > Regionals > Europe > Northwestern European Regional Contest > The UK & Ireland Programming Contest > UKIEPC 2017 E번