提交时间:2023-10-03 10:34:19

运行 ID: 28824

#include "iostream" #include "algorithm" #define int long long using namespace std; int s,t[1000000]; signed main(){ int n,w; cin>>n>>w; int a=0; for(int i=1;i<=n;i++){ cin>>s; t[s]++; for(int j=600;j>=0;j--){ a+=t[j]; if(a>=max(1,i*w/100)){ cout<<j<<' '; break; } } } return 0; }