QOJ.ac

QOJ

Limite de temps : 4 s Limite de mémoire : 512 MB Points totaux : 100

#1264. 低等アルゴリズム学

Statistiques

$1$ 以上 $1000$ 以下の整数からなる集合 $A$ が与えられます。$A$ の要素を $\ell$ 個以上 $r$ 個以下足し合わせることで表せる正の整数が、いくつあるかを求めてください。同じ要素を何度足してもかまいません。 表し方が複数ある数も、1 回だけ数えることに注意してください。

入力

入力の最初の行には、空白で区切られた 3 つの整数が与えられます。最初は $A$ の要素数 $n$($1 \le n \le 1000$)、続いて足し合わせる要素数の下限と上限 $\ell$、$r$($1 \le \ell \le r \le 2000$)です。2 行目には、集合 $A$ の要素を昇順に並べた、空白で区切られた $n$ 個の整数 $a_1, a_2, \ldots, a_n$($1 \le a_1 < a_2 < \cdots < a_n \le 1000$)が与えられます。

出力

$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.