You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
521 B

2 years ago
#include <bits/stdc++.h>
using namespace std;
const int N = 200010;
int n, cnt;
int a[N];
bool st[N];
int main() {
scanf("%d", &n);
for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
while (cnt < n) {
int last = 2;
for (int i = 1; i <= n; i++) {
if (!st[i] && a[i] != last) {
last = a[i];
st[i] = true;
printf("%d ", i);
cnt++;
}
}
puts("");
}
return 0;
}