90分求助
查看原帖
90分求助
160150
WxjzKK楼主2020/11/8 12:05
#include<bits/stdc++.h>
using namespace std;
int book[1001];
int main()
{
	freopen("live.in","r",stdin);
	freopen("live.out","w",stdout);
	int n,w,num,p;
	cin>>n>>w;
	double d=w/100.0;
	for (int i=1;i<=n;++i)
	{
		cin>>num;++book[num];
		p=max(1,(int)(floor(d*i)));
		int j;
		for (j=600;j>=0&&p>0;--j) p-=book[j];
		++j;
		cout<<j<<' ';
	}
	return 0;
}

2020/11/8 12:05
加载中...