0278

command
v0.0.0-...-0b623e9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 14, 2022 License: MIT Imports: 0 Imported by: 0

README

278. 数字组合

题目

给定 $N$ 个正整数 $A_1,A_2,…,A_N$,从中选出若干个数,使它们的和为 $M$,求有多少种选择方案。

输入格式

第一行包含两个整数 $N$ 和 $M$。

第二行包含 $N$ 个整数,表示 $A_1,A_2,…,A_N$。

输出格式

包含一个整数,表示可选方案数。

数据范围

$1 \le N \le 100$,

$1 \le M \le 10000$,

$1 \le A_i \le 1000$,

答案保证在 int 范围内。

输入样例:

4 4
1 1 2 2

输出样例:

3

题解

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL