N - 1

AtCoder
IDabc429_b
Time2000ms
Memory256MB
Difficulty
You are given an integer sequence of length $N$, $A=(A_1,A_2,\ldots,A_N)$, and an integer $M$. Determine whether it is possible to remove one of the $N$ elements of $A$ so that the sum of the remaining $(N-1)$ elements is exactly $M$. ## Constraints * $2\le N\le 100$ * $0\le M\le 10000$ * $0\le A_i\le 100$ * All input values are integers. ## Input The input is given from Standard Input in the following format: $N$ $M$ $A_1$ $A_2$ $\ldots$ $A_N$ [samples]
Samples
Input #1
4 10
3 2 3 4
Output #1
Yes

If you choose $A_1,A_3,A_4$, the sum is $3+3+4=10$. Therefore, print `Yes`.
Input #2
5 16
3 3 4 2 5
Output #2
No

No matter how you choose four elements, their sum is not equal to $16$. Therefore, print `No`.
Input #3
6 16
0 8 0 2 6 8
Output #3
Yes
API Response (JSON)
{
  "problem": {
    "name": "N - 1",
    "description": {
      "content": "You are given an integer sequence of length $N$, $A=(A_1,A_2,\\ldots,A_N)$, and an integer $M$. Determine whether it is possible to remove one of the $N$ elements of $A$ so that the sum of the remainin",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc429_b"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "You are given an integer sequence of length $N$, $A=(A_1,A_2,\\ldots,A_N)$, and an integer $M$.\nDetermine whether it is possible to remove one of the $N$ elements of $A$ so that the sum of the remainin...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments