cswork / OA打开练习工作台

IBMOA #17

Count Teams

估计中等可在线判题

考点(AI 标注)位运算

From the given players choose at least minPlayers people whose skills all lie in [minLevel,maxLevel]; find the number of teams, counted as distinct index sets. No modulo is taken.

输入格式

The first line contains n minPlayers minLevel maxLevel, and the second line contains the skills. On this site 1≤n≤10000, 1≤minPlayers≤n, −10^9≤skills and both bounds≤10^9, and minLevel≤maxLevel.

输出格式

Output one integer, the answer.

样例 1

输入:

3 2 1 3
1 2 3

输出:

4

样例 2

输入:

3 1 5 5
5 5 5

输出:

7

样例 3

输入:

2 2 3 4
1 2

输出:

0

样例说明

The examples give 4, 7 and 0 respectively. Different players with the same skill count as different individuals.