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.