QOJ.ac

QOJ

Time Limit: 2 s Memory Limit: 256 MB Total points: 100

#22682. 精英进食

Statistics

FJ 为 1,000 头奶牛打上了互不相同的烙印,每个烙印都是范围 $1..1,000$ 内的一个整数。

FJ 还制定了一项精英进食计划,让恰好 $N$($1 \le N \le 250$)头带有特定烙印的奶牛先进入牛棚。对这组精英奶牛的限制是:它们的烙印的平方和必须严格小于给定整数 $S$($1 \le S \le 10{,}100$)。

求能够被选入精英进食计划的不同奶牛组数。

输入格式

  • 第 1 行:两个用空格分隔的整数 $N$ 和 $S$。

输出格式

  • 第 1 行:一个整数,表示能够排队参加精英进食的不同组的数量。

样例

输入格式 1

3 30

输出格式 1

4

说明

长度为 3 且平方和 $< 30$ 的序列如下:

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

烙印序列 1 2 5 不合法,因为 $1 + 4 + 25 = 30$,并不严格小于 30。

题目来源:Bulgarian Winter 2002;经 Nikolay Valtchanov 提供,2003

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.