85pts求助
查看原帖
85pts求助
681351
Tobiichi_Origami楼主2022/9/9 11:17
#include<bits/stdc++.h>
using namespace std;
int t[610];
int main()
{
    int n;
    double w;
    cin>>n>>w;
    for(int i=1;i<=n;i++)
    {
        int x,sum=0,tmp=i*(w/100.00);
        cin>>x;
        t[x]++;
        for(int j=600;j>=0;j--)
        {
            if(t[j]>=1)
            {
                sum+=t[j];
                if(sum>=max(1,tmp))
                {
                    cout<<j<<' ';
                    break;
                }
            }
        }
    }
    return 0;
}
2022/9/9 11:17
加载中...