int temp[N],a[N]; int main(){ int n; cin>>n; for(int i=1;i<=n;i++){ cin>>a[i]; temp[i]=a[i]; } sort(temp+1,temp+n+1); int len=unique(temp+1,temp+n+1)-temp-1; for(int i=1;i<=n;i++)// a[i]=lower_bound(temp+1,temp+len+1,a[i])-temp; }
标签:二分,temp,int,离散,查找,排序 From: https://www.cnblogs.com/towboa/p/17064619.html