MissingNo.

AtCoder
IDabc317_b
Time2000ms
Memory256MB
Difficulty
Naohiro had $N+1$ consecutive integers, one of each, but he lost one of them. The remaining $N$ integers are given in arbitrary order as $A_1,\ldots,A_N$. Find the lost integer. The given input guarantees that the lost integer is uniquely determined. ## Constraints * $2 \leq N \leq 100$ * $1 \leq A_i \leq 1000$ * All input values are integers. * The lost integer is uniquely determined. ## Input The input is given from Standard Input in the following format: $N$ $A_1$ $A_2$ $\ldots$ $A_N$ [samples]
Samples
Input #1
3
2 3 5
Output #1
4

Naohiro originally had four integers, $2,3,4,5$, then lost $4$, and now has $2,3,5$.
Print the lost integer, $4$.
Input #2
8
3 1 4 5 9 2 6 8
Output #2
7
Input #3
16
152 153 154 147 148 149 158 159 160 155 156 157 144 145 146 150
Output #3
151
API Response (JSON)
{
  "problem": {
    "name": "MissingNo.",
    "description": {
      "content": "Naohiro had $N+1$ consecutive integers, one of each, but he lost one of them. The remaining $N$ integers are given in arbitrary order as $A_1,\\ldots,A_N$. Find the lost integer. The given input guaran",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc317_b"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "Naohiro had $N+1$ consecutive integers, one of each, but he lost one of them.\nThe remaining $N$ integers are given in arbitrary order as $A_1,\\ldots,A_N$. Find the lost integer.\nThe given input guaran...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments