社区讨论
45,#9WA,#6~10TLE
P7072[CSP-J 2020] 直播获奖参与者 2已保存回复 1
讨论操作
快速查看讨论及其快照的属性,并进行相关操作。
- 当前回复
- 1 条
- 当前快照
- 1 份
- 快照标识符
- @lo1vt0gs
- 此快照首次捕获于
- 2023/10/23 03:48 2 年前
- 此快照最后确认于
- 2023/11/03 04:17 2 年前
RT,
CPP#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;
}
回复
共 1 条回复,欢迎继续交流。
正在加载回复...