【玄关】O(600n)代码求调
查看原帖
【玄关】O(600n)代码求调
1267405
StarsTwinkle楼主2024/9/19 22:40
#include<bits/stdc++.h>
using namespace std;
int tong[609];
int main(){
    int n,w;
    cin>>n>>w;
    for(int i=1;i<=n;i++){
        int x;
        cin>>x;
        tong[x]++;
        for(int p=600;p>=0;p--){
            int num=0;
            if(tong[p]!=0){
                num+=tong[p];
                if(num>=max(1,i*w/100)){
                    cout<<p<<" ";
                    continue;
                }
            }
        }
    }
}

帮个忙呗

2024/9/19 22:40
加载中...