#include <bits/stdc++.h>
using namespace std;
int n,w,temp[602],pts,nownum;
int main(){
cin>>n>>w;
for(int i=1;i<=n;i++){
cin>>pts;
temp[pts]++;
nownum=max(1,i*w/100);
int ans=0,j=600;
for(;j>=0;j--){
ans+=temp[j];
if(ans>=nownum)break;
}
cout<<j<<" ";
}
return 0;
}
听说,此题正解是对顶堆。那能不能把计数排序算法进行常数优化,以达到最佳时间复杂度?