提交时间:2023-07-16 17:55:09

运行 ID: 23795

#include"bits/stdc++.h" using namespace std; int s[1005]; int main(){ int n,w,x; cin>>n>>w; for(int i=1;i<=n;i++){ cin>>x; s[x]++; int t=w*i/100; t=max(1,t); int z=0; for(int j=600;j>=0;j--){ z+=s[j]; if(z>=t){ cout<<j<<' '; break; } } } }