Removal of billboards from given ones

前端 未结 7 1934
Happy的楠姐
Happy的楠姐 2020-12-14 11:46

I came across this question

ADZEN is a very popular advertising firm in your city. In every road you can see their advertising billboards. Recentl

7条回答
  •  忘掉有多难
    2020-12-14 12:19

    This looks like a linear programming problem. This problem would be linear, but for the requirement that no more than K adjacent billboards may remain.

    See wikipedia for a general treatment: http://en.wikipedia.org/wiki/Linear_programming

    Visit your university library to find a good textbook on the subject.

    There are many, many libraries to assist with linear programming, so I suggest you do not attempt to code an algorithm from scratch. Here is a list relevant to Python: http://wiki.python.org/moin/NumericAndScientific/Libraries

提交回复
热议问题