Files
python/TangDou/CSP-J/J2-2021/4_BruteForce.cpp

26 lines
521 B
C++
Raw Normal View History

2025-08-30 18:35:01 +08:00
#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;
}