QOJ.ac

QOJ

Límite de tiempo: 4 s Límite de memoria: 512 MB Puntuación total: 100

#1264. אלגוריתמיקה נמוכה

Estadísticas

נתונה קבוצה $A$ של מספרים שלמים מ־$1$ עד $1000$, כולל. עליכם למצוא כמה מספרים שלמים חיוביים ניתנים להצגה כסכום של כמה איברים של $A$, כאשר מספר המחוברים הוא בין $\ell$ ל־$r$, כולל. מותר להשתמש במחוברים שווים. שימו לב שכל מספר נספר פעם אחת בלבד, גם אם יש לו כמה הצגות כאלה.

קלט

השורה הראשונה של הקלט מכילה שלושה מספרים שלמים המופרדים ברווחים: $n$, מספר האיברים ב־$A$ ($1 \le n \le 1000$), ואחריו $\ell$ ו־$r$, החסמים על מספר המחוברים ($1 \le \ell \le r \le 2000$). השורה השנייה מכילה $n$ מספרים שלמים המופרדים ברווחים $a_1,a_2,\ldots,a_n$ ($1 \le a_1 < a_2 < \cdots < a_n \le 1000$): איברי הקבוצה $A$ בסדר עולה.

פלט

הדפיסו את מספר המספרים השלמים הניתנים להצגה כסכום של איברי $A$, כאשר מספר המחוברים הוא בין $\ell$ ל־$r$.

דוגמאות

קלט 1

2 1 2
1 2

פלט 1

4

קלט 2

3 1 3
1 3 10

פלט 2

18

קלט 3

6 3 5
1 2 3 4 5 6

פלט 3

28

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.