世界第一
2025-07-03 10:56:38
发布于:北京
4阅读
0回复
0点赞
#include <iostream>
#include <algorithm>
using namespace std;
int a[610];
int main(){
int n, w;
cin >> n >> w;
for (int i = 0; i < n; ++i) {
int tmp;
cin >> tmp;
a[tmp] += 1;
int p = max(1, (i + 1) * w / 100);
int x = 0;
for (int j = 600; j >= 0; --j){
x += a[j];
if (x >= p) {
cout << j << " ";
break;
}
}
}
return 0;
}
这里空空如也
有帮助,赞一个