当前位置:网站首页>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;
}边栏推荐
- Dahua cloud native load balancing article - the passenger flow of small restaurants has increased
- [foreign journal] sleep and weight loss
- 百度智能云-创建人脸识别应用
- Get off work on time! Episode 6 of Excel Collection - how to split and count document amounts
- 牛客网:龙与地下城游戏
- PHP微信抢红包的算法
- 数据库系统概论第一章简答题-期末考得怎么样?
- [micro service sentinel] rewrite Sentinel's interface blockexceptionhandler
- Market Research - current situation and future development trend of anterior cruciate ligament (ACL) reconstruction Market
- I admire that someone explained such an obscure subject as advanced mathematics so easily
猜你喜欢

kubernetes 使用主机名将 pod 分配在指定节点上

图形视图框架

牛客网:龙与地下城游戏

Phpcms realizes the direct Alipay payment function of orders
![[error record] the flutter reports an error (could not read script 'xxx\flutter\u tools\gradle\app\u plugin\u loader.gradle')](/img/02/67448df1817e8b34b654722df8ecd4.jpg)
[error record] the flutter reports an error (could not read script 'xxx\flutter\u tools\gradle\app\u plugin\u loader.gradle')

【板栗糖GIS】arcmap—为什么使用自定义捕捉的时候,经典捕捉的勾要去掉呢?

Task and privilege level protection

Socket socket c/s end process

【ODX Studio编辑PDX】-0.1-如何快速查看各Variant变体间的支持的诊断信息差异(服务,Sub-Function...)

地方经销商玩转社区团购模式,百万运营分享
随机推荐
Baidu AI Cloud - create a face recognition application
牛客网:龙与地下城游戏
How can I use knockout's $parent/$root pseudovariables from inside a . computed() observable?
手写ORM(对象关系映射)增删改查
[QT] QT multithreading development - reentrancy and thread safety
【板栗糖GIS】arcmap—如何批量修改注记要素的字体,颜色,大小等
[foreign journal] sleep and weight loss
Market Research - current market situation and future development trend of marine wet exhaust hose
傑理之修改不需要長按開機功能【篇】
Market Research - current situation and future development trend of cell-based seafood market
Market Research - current market situation and future development trend of handheld wound imaging equipment
Socket套接字C/S端流程
go 条件变量
杰理之修改不需要长按开机功能【篇】
PHP微信抢红包的算法
JS syntax ES6, ES7, es8, es9, ES10, es11, ES12 new features (Abstract)
Get off work on time! Episode 6 of Excel Collection - how to split and count document amounts
全面解析分享购商业模式逻辑?分享购是如何赋能企业
Oracle-PL/SQL编程
Market Research - current situation and future development trend of marine clutch Market