Codeforces 496E. Distributing Parts 排序+贪心

You are an assistant director in a new musical play. The play consists ofnmusical parts, each part must be performed by exactly one actor. After the casting the director chosemactors who can take part in the play. Your task is to assign the parts to actors. However, there are several limitations.

First, each actor has a certain voice range and there are some parts that he cannot sing. Formally, there are two integers for each actor,()— the pitch of the lowest and the highest note that the actor can sing. There also are two integers for each part—()— the pitch of the lowest and the highest notes that are present in the part. Thei-th actor can perform thej-th part if and only if≤, i.e. each note of the part is in the actor’s voice range.

According to the contract, thei-th actor can perform at mostkiparts. Besides, you are allowed not to give any part to some actors (then they take part in crowd scenes).

The rehearsal starts in two hours and you need to do the assignment quickly!

,如果说人生啊,尝过一回痛快淋漓的风景,

Codeforces 496E. Distributing Parts 排序+贪心

相关文章:

你感兴趣的文章:

标签云: