当前位置:网站首页>P7072 [CSP-J2020] 直播获奖
P7072 [CSP-J2020] 直播获奖
2022-07-02 22:07:00 【Evil_boy__】
题目链接:
P7072 [CSP-J2020] 直播获奖 - 洛谷 | 计算机科学教育新生态 (luogu.com.cn)
题面:
题目描述:
输入描述:
输出描述:
样例:

解释:

提示:
思路:
分数的最大情况为600,我们可以开一个605的数组存目前为止每个分数段的人数.每加入一个人就去判断分数线即可
#include<bits/stdc++.h>
using namespace std;
int arr[605] = {0};
int main(){
int n, w;
cin >> n >> w;
for(int i = 1; i <= n; i++){
int a;
cin >> a;
arr[a]++;
int num = i * w / 100;
if(num == 0){
num = 1;
}
int cnt = 0;
for(int j = 600; j >= 0; j--){
cnt += arr[j];
if(cnt >= num){
if(i != 1){
cout << " ";
}
cout << j;
break;
}
}
}
cout << endl;
return 0;
}边栏推荐
- PHP wechat red packet grabbing algorithm
- 傑理之修改不需要長按開機功能【篇】
- [LeetCode] 存在重复元素【217】
- NC50965 Largest Rectangle in a Histogram
- 电商系统微服务架构
- Radis:Linux上安装Redis(步骤)
- 建立自己的网站(22)
- Market Research - current market situation and future development trend of aircraft front wheel steering system
- 高并发介绍及应对
- Notes on key vocabulary in the English original of the biography of jobs (10) [chapter eight]
猜你喜欢

附加:【登录信息存储】与【登录状态校验】;(包括:总结了到目前为止,有关【登录信息存储】与【登录状态校验】的所有内容;)

Commodity information management system (C language document version)
![[LeetCode] 数组中的第K个最大元素【215】](/img/72/d3e46a820796a48b458cd2d0a18f8f.png)
[LeetCode] 数组中的第K个最大元素【215】

#include errors detected. Please update your includePath.

Based on asp Net (used mobile phone sales management system) +asp Net+c # language +vs2010+ database can be used for course design and post design learning

数学建模——图与网络模型及方法(一)

牛客网:龙与地下城游戏

Objects and object variables

小鹏P7出事故,安全气囊未弹出,这正常吗?

【外刊】睡眠与减肥
随机推荐
数据库系统概论第一章简答题-期末考得怎么样?
佩服,竟然有人把高等数学这么晦涩难懂的科目,讲解得如此通俗易懂
原生js添加样式的方法
Market Research - current market situation and future development trend of aircraft front wheel steering system
PHP optimizes SQL queries in foreach
U++ learning notes - relaxation
杰理之样机在多次触摸后会触发关机【篇】
解决 excel 文件上传时更改选中的文件出现错误net::ERR_UPLOAD_FILE_CHANGED
Rails 3 activerecord: sort by association count - rails 3 activerecord: order by count on Association
[LeetCode] 反转字符串中的单词 III【557】
【外刊】睡眠与减肥
附加:【登录信息存储】与【登录状态校验】;(包括:总结了到目前为止,有关【登录信息存储】与【登录状态校验】的所有内容;)
Graphic view frame
kubernetes 使用主机名将 pod 分配在指定节点上
[micro service sentinel] rewrite Sentinel's interface blockexceptionhandler
UE4 UI adaptive screen
Task and privilege level protection
【ODX Studio编辑PDX】-0.1-如何快速查看各Variant变体间的支持的诊断信息差异(服务,Sub-Function...)
全面解析分享购商业模式逻辑?分享购是如何赋能企业
Market Research - current situation and future development trend of marine clutch Market