Mock CCC '19 Contest 1 S1 - A Complete Problem

View as PDF

Submit solution

Points: 5 (partial)
Time limit: 2.0s
Memory limit: 64M

Author:
Problem type

Given a set a of N elements, print the number of nonempty subsets where the maximum element is less than or equal to V.

Two subsets are considered different if an element at index i for some 1 \le i \le N exists in the first subset but not in the second subset, or vice versa.

Input Specification

The first line will contain two integers N, V (1 \le N \le 50, 1 \le V \le 100), the number of elements.

The second line will contain N integers, a_1, a_2, a_3, \ldots, a_N (1 \le a_i \le 100).

Output Specification

The number of nonempty subsets where the max element is less than or equal to V.

Subtasks

For 1/15 of the points, N \le 15, V = 100.

For 5/15 of the points, N \le 15

Sample Input

4 100
2 3 100 2

Sample Output

15

Comments

There are no comments at the moment.