for(int i=1,j=1;i<=N;i++){//离散化映射 // if(srt[i]!=srt[i-1]) mp[srt[i]]=j++; if(srt[i]!=srt[i-1]||i==1) mp[srt[i]]=j++; }
千万不要忘了数据可以是0