报错```cpp
#include<bits/stdc++.h>
using namespace std;
struct node{
int type;
int next;
int last;
};
node List[5001];
int main()
{
cin>>sum;
for(int i=1;i<=sum;i++)
{
cin>>List[i].type;
List[i].next=i+1;
List[i].last=i-1;
}
int s=0;
while(s<sum)
{
int nex=1;//迭代器
while(nex!=sum+1)
{
if(List[nex].type!=List[List[nex].next].type)
{
List[List[nex].last].next=List[List[nex].next];
List[List[nex].next].last=List[List[nex].last];
cout<<i<<" ";
}
nex=List[nex].next;
}
cout<<endl;
}
return 0;
}