听说灌水区大佬多
  • 板块灌水区
  • 楼主When_can_I_be
  • 当前回复1
  • 已保存回复1
  • 发布时间2023/8/12 19:02
  • 上次更新2023/11/3 04:14:00
查看原帖
听说灌水区大佬多
756900
When_can_I_be楼主2023/8/12 19:02

RT,p7072,WA一个,TLE一半

#include<iostream>
#include<math.h>
#include<iomanip>
#include<cstring>
#include<algorithm>
#include<string>
using namespace std;

double w;
long long n,s[1000005];

bool cmp(int a,int b){
	return a>b;
}

int main(){
	
	cin>>n>>w;
	w/=100;
	
	for(long long p=1;p<=n;p++){
		
		cin>>s[p];
		sort(s+1,s+p+1,cmp);
		int m=max(1,(int)(p*w));
		
		cout<<s[m]<<' ';
	}
	
	return 0;
}
2023/8/12 19:02
加载中...