标签:
代码:
#include<cstdio> #include<iostream> using namespace std; int reader[20100],tong[20100]={0}; int main(){ int n,m,i; cin>>n>>m; for(i=1;i<=n;i++)cin>>reader[i]; for(i=1;i<=n;i++)tong[reader[i]]++; for(i=1;i<=n;i++){ if(tong[reader[i]]==1)cout<<"BeiJu"<<endl; else cout<<tong[reader[i]]-1<<endl; } }
思路:类似桶排
标签:
原文地址:http://www.cnblogs.com/liuxinyu/p/5387992.html