Capacity of an aircraft is K, you have N people with weights Wi. Find minimum number of air-crafts to transport all these people.
n <= 10^5 and k <= 10^9
How to approach this problem.
# | User | Rating |
---|---|---|
1 | tourist | 3803 |
2 | Benq | 3783 |
3 | Radewoosh | 3602 |
4 | maroonrk | 3575 |
5 | fantasy | 3526 |
6 | ko_osaga | 3500 |
7 | ksun48 | 3491 |
8 | Um_nik | 3486 |
9 | jiangly | 3474 |
10 | orzdevinwang | 3461 |
# | User | Contrib. |
---|---|---|
1 | awoo | 180 |
2 | -is-this-fft- | 177 |
3 | nor | 169 |
4 | Um_nik | 168 |
5 | SecondThread | 164 |
6 | maroonrk | 163 |
7 | adamant | 161 |
8 | kostka | 160 |
9 | YouKn0wWho | 158 |
10 | errorgorn | 153 |
Capacity of an aircraft is K, you have N people with weights Wi. Find minimum number of air-crafts to transport all these people.
n <= 10^5 and k <= 10^9
How to approach this problem.
Name |
---|
I think this problem is worth 1 million dollars.
It is a variation of the NP-complete Bin Packing problem.
Thanks!
As long as $$$K \geq \max{W_i}$$$ you can use one aircraft and then come back for more people
that's brilliant, but what if it's a one time use aircraft ?