提交时间:2023-10-03 10:59:15

运行 ID: 28834

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