# Subset-sum problem

Last edited: 2026-02-05

# Statement

Subset-sum problem

Given positive integers $a_1, \ldots, a_n$ and $t$, is there a subset $S \subset \{1, \ldots, n\}$ where

$$\sum_{i \in S} a_i = t$$

If such a subset exists, output it; otherwise, return no.

# Solutions

# Theory

# Related problems