50分TLE求助
查看原帖
50分TLE求助
816528
Deity_Satan楼主2022/11/29 19:08
#include<bits/stdc++.h>
using namespace std;
long long top,n,num,z,l;
double w;
bool cmp(int a,int b){
	return a>b;
}
int main(){
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin>>n>>w;
	int a[n];
	for(int i=1;i<=n;i++){
		cin>>a[i-1];	
		z=i*w/100;
		l=1;
		top=max(z,l);
		sort(a,a+i,cmp);
		num=a[top-1];
		cout<<num<<" ";
	}
	return 0;
}
2022/11/29 19:08
加载中...