33 lines
691 B
C++
33 lines
691 B
C++
#include <algorithm>
|
|
#include <cstdio>
|
|
#include <iostream>
|
|
using namespace std;
|
|
|
|
int n,w;
|
|
const int MaxN = 1e5+5,MaxFs = 600+5;;
|
|
int Arr[MaxN],SortArr[MaxFs];
|
|
|
|
|
|
int main(){
|
|
freopen("P7072.in", "r", stdin);
|
|
freopen("P7072.out", "w", stdout);
|
|
|
|
cin>>n>>w;
|
|
for (int i=1; i<=n; i++) {
|
|
cin>>Arr[i];
|
|
SortArr[Arr[i]]++;
|
|
int pelopleLine = max(1,i*w/100);
|
|
int fsLine = 0;
|
|
int nowPeopleNum = 0;
|
|
for (int j=MaxFs-1; j>0; j--) {
|
|
nowPeopleNum+=SortArr[j];
|
|
if (nowPeopleNum>=pelopleLine) {
|
|
fsLine=j;
|
|
break;
|
|
}
|
|
}
|
|
cout<<fsLine<<" ";
|
|
}
|
|
cout<<endl;
|
|
|
|
} |