#include<bits/stdc++.h>
using namespace std;
struct s
{
int d;
int ci;
int shun;
}p[10005];
map<int,int>w;
int g[10005];
int main()
{
int n,c;
cin>>n>>c;
for(int i=1;i<=n;i++)
{
int x;
cin>>x;
if(w.find(x)==w.end())
{
p[i].shun=i;
g[x]=i;
}
else
{
p[i].shun=g[x];
}
w[x]++;
p[i].d=x;
}
for(auto x:w)
{
for(int i=1;i<=n;i++)
{
if(x.first==p[i].d)
p[i].ci=x.second;
}
}
for(int i=1;i<=n;i++)
{
cout<<p[i].d<<" "<<p[i].ci<<" "<<p[i].shun<<endl;
}
return 0;
}
为什么过不了?