[虚拟机OA]Team Formation 2 团队构成

Posted liuliu5151

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[虚拟机OA]Team Formation 2 团队构成相关的知识,希望对你有一定的参考价值。


FC Codelona is trying to assemble a team from a roster of available players. They have a minimum number of players they want to sign and each player needs to have a skill rating within a certain range. Given a list of players‘ skill levels with desired upper and lower bounds, determine how many teams can be created from the list.


For example, the list includes players with skill levels [12, 4, 6, 13, 5, 10]. They want to hire at least 3 players with skill revels between 4 and 10, inclusive.
Four of the players meet the criteria, giving them a selection set of 4, 5, 6,10.


Teams could be the following:
4, 5, 6, 4,6,10, 4,5,10, 5,6,10 and 4,5,6,10.
There are 5 ways to satisfy the criteria.


Function Description
Complete the function countTeams in the editor below. The function must return the total number of teams that can to formed per the criteria.


CountTeams has the following parameters:
Skills[skills[0], ... skills[n-1]]:  an array of integers that represent the skill level per player
k: the minimum number of team members required
t: the lower limit for skill level, inclusive
r: the upper limit for skill level inclusive

 

题意:

 

思路:

 

代码:

 

 

 

以上是关于[虚拟机OA]Team Formation 2 团队构成的主要内容,如果未能解决你的问题,请参考以下文章

ZOJ 3870 Team Formation

TZOJ--4986: Team Formation(二进制枚举)

ZOJ - 3870 Team Formation(异或)

[虚拟机OA]Climb the hill 爬山

[虚拟机OA]Break a Palindrome 破坏回文串

[虚拟机OA]Fun with Anagrams 玩转同构词