Trifecta

AtCoder
IDabc440_b
Time2000ms
Memory256MB
Difficulty
$N$ horses numbered $1$ to $N$ had a race. All horses started simultaneously, and horse $i$ took $T_i$ seconds from the start to the goal. Find the numbers of the horses that finished in $1$st, $2$nd, and $3$rd places. It is guaranteed that all $T_i$ are distinct. ## Constraints * $3\leq N \leq 32$ * $1\leq T_i \leq 200$ * All $T_i$ are distinct. * All input values are integers. ## Input The input is given from Standard Input in the following format: $N$ $T_1$ $\dots$ $T_N$ [samples]
Samples
Input #1
4
100 110 105 95
Output #1
4 1 3

The horses finished in the order $4, 1, 3, 2$. Output the numbers for $1$st, $2$nd, and $3$rd places, which are $4, 1, 3$, in this order, separated by spaces.
Input #2
8
72 74 69 70 73 75 71 77
Output #2
3 4 7
API Response (JSON)
{
  "problem": {
    "name": "Trifecta",
    "description": {
      "content": "$N$ horses numbered $1$ to $N$ had a race. All horses started simultaneously, and horse $i$ took $T_i$ seconds from the start to the goal. Find the numbers of the horses that finished in $1$st, $2$nd,",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc440_b"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "$N$ horses numbered $1$ to $N$ had a race.\nAll horses started simultaneously, and horse $i$ took $T_i$ seconds from the start to the goal.\nFind the numbers of the horses that finished in $1$st, $2$nd,...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments