Logo
(追記) (追記ここまで)

27038번 - Elite Eating 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB18161386.667%

문제

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.

입력

  • Line 1: Two space-separated integers, N and S

출력

  • Line 1: A single integer that is the number of different possible groups that can line up for elite eating.

제한

예제 입력 1

3 30

예제 출력 1

4

힌트

The sequences of length 3 with sum of squares < 30 are:

  • 1 2 3
  • 1 2 4
  • 2 3 4
  • 1 3 4

The sequence of brands 1 2 5 is not valid since 1 + 4 + 25 = 30 and is not strictly less than 30.

출처

Olympiad > USA Computing Olympiad > 2003-2004 Season > USACO December 2003 Contest > Green 2번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /