1 条题解

  • 0
    @ 2024-12-5 18:12:19

    C++ :

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

    信息

    ID
    9123
    时间
    1000ms
    内存
    256MiB
    难度
    (无)
    标签
    递交数
    0
    已通过
    0
    上传者