Booby Prize

AtCoder
IDabc213_b
Time2000ms
Memory256MB
Difficulty
$N$ players, who are numbered $1, \ldots, N$, have played a game. Player $i$ has scored $A_i$, and a player with a **smaller** score ranks higher. The player who ranks the second lowest will receive a booby prize. Who is this player? Answer with an integer representing the player. ## Constraints * $2 \leq N \leq 2\times 10^5$ * $1 \leq A_i \leq 10^9$ * $A_i$ are distinct. * All values in input are integers. ## Input Input is given from Standard Input in the following format: $N$ $A_1$ $\ldots$ $A_N$ [samples]
Samples
Input #1
6
1 123 12345 12 1234 123456
Output #1
3

It is Player $3$ who ranks fifth among the six players.
Input #2
5
3 1 4 15 9
Output #2
5
API Response (JSON)
{
  "problem": {
    "name": "Booby Prize",
    "description": {
      "content": "$N$ players, who are numbered $1, \\ldots, N$, have played a game. Player $i$ has scored $A_i$, and a player with a **smaller** score ranks higher. The player who ranks the second lowest will receive a",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc213_b"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "$N$ players, who are numbered $1, \\ldots, N$, have played a game. Player $i$ has scored $A_i$, and a player with a **smaller** score ranks higher.\nThe player who ranks the second lowest will receive a...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments