Partition Equal Subset Sum Challenge LeetCode
No need for full matrix
Although your dynamic programming solution works, you are using a matrix of size [sum/2][n] when you only need to allocate a single vector of size [sum/2].  Not only are you using more memory than necessary, but this could also affect performance because of caching.
Use a quick return
Your solution runs the full double loop to completion before determining whether the answer is possible.  It is possible to create a solution that returns as soon as it finds a valid solution.  This could potentially cut down on the time by a lot for inputs that have solutions.
Additionally, I found that sorting the inputs and looping through them from largest to smallest works best in conjunction with the quick return.
Sample rewrite
Here is how I would write the program, using only a single dimensional vector for the DP part, sorting the inputs, and allowing for a quick return:
#include &lt;iostream&gt;
#include &lt;vector&gt;
#include &lt;algorithm&gt;

int main(void)
{
    int n;
    int sum = 0;

    // Read in numbers.
    std::cin &gt;&gt; n;
    std::vector&lt;int&gt; nums(n);
    for (int i=0; i&lt;n; i++) {
        int num;
        std::cin &gt;&gt; num;
        nums[i] = num;
        sum    += num;
    }

    // Quick check to see if sum is even.
    if (sum &amp; 1) {
        std::cout &lt;&lt; &quot;false&quot; &lt;&lt; std::endl;
        return 0;
    }
    // Cut sum in half.  Sum is now the target to reach.
    sum &gt;&gt;= 1;

    // Sort numbers so we can use the largest ones first.
    sort(nums.begin(), nums.end());

    // Iterate through each number from largest to smallest, updating the
    // possible array and trying to find out if [sum] is possible.
    std::vector&lt;bool&gt; possible(sum);
    possible[0] = true;
    for (int i=n-1; i&gt;=0; i--) {
        int val = nums[i];
        // Quick return if we find we can reach [sum].
        if (sum - val &gt;= 0 &amp;&amp; possible[sum - val]) {
            std::cout &lt;&lt; &quot;true&quot; &lt;&lt; std::endl;
            return 0;
        }
        for (int j=sum-val-1; j &gt;= 0; j--) {
            if (possible[j])
                possible[j + val] = true;
        }
    }

    std::cout &lt;&lt; &quot;false&quot; &lt;&lt; std::endl;
    return 0;
}