Mock CCC '20 Contest 1 J4 - Immobile Phones

View as PDF

Submit solution

Points: 5 (partial)
Time limit: 1.0s
Memory limit: 128M

Author:
Problem type

There are N phones numbered from 1 to N lined up in a row. The i^\text{th} phone is a distance of i kilometres away from the cell tower. Each phone is communicating with the tower on a frequency of f_i.

Some phones will intefere if with another phone if they are on the same frequency. In particular, a phone's signal will not get through to the cell tower if there is a phone closer communicating at the same frequency.

Given a row of phones, can you determine which phone's signal goes through?

Input Specification

The first line will contain the integer N (1 \le N \le 10^5), the numbr of phones.

The second line will contain N integers, f_1, f_2, \ldots, f_N (1 \le f_i \le 10^9), the frequency that the i^\text{th} phone is communicating on.

Output Specification

Output the phone indices of the phones whose signal goes through, separated by spaces.

Subtasks

For 5/15 of the marks, f_i \le 100.

Sample Input

6
1 3 2 3 1 4

Sample Output

1 2 3 6

Comments

There are no comments at the moment.