시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 | 1024 MB | 12 | 10 | 7 | 77.778% |
FJ has uniquely branded 1,000 cows, each with an integer in the range (1..1,000).
FJ has also created an elite eating program where exactly N (1 ≤ N ≤ 250) cows with specific brands get to enter the barn first. The restriction on this elite group of cows is that the sum of the squares of the cows' brands must be strictly less than a given integer S (1 ≤ S < = 10,100).
Determine the number of different groups of cows that can be selected for the elite eating program.
3 30
4
The sequences of length 3 with sum of squares < 30 are:
The sequence of brands 1 2 5 is not valid since 1 + 4 + 25 = 30 and is not strictly less than 30.