当前位置:网站首页>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;
}边栏推荐
- 【AUTOSAR-DCM】-4.3-UDS $22和$2E服务如何读取和写入NVM数据
- kubernetes 使用主机名将 pod 分配在指定节点上
- `${}`的用法
- Market Research - current market situation and future development trend of genome editing mutation detection kit
- [ODX studio edit PDX] -0.1- how to quickly view the differences in supported diagnostic information between variant variants (service, sub function...)
- [QT] QT multithreading development - four methods to realize multithreading design
- Market Research - current market situation and future development trend of high tibial osteotomy plate
- 杰理之如何测试按键的误触率【篇】
- Rails 3 activerecord: sort by association count - rails 3 activerecord: order by count on Association
- 对象与对象变量
猜你喜欢
![[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')

Jatpack------LiveData

PMP项目整合管理

Phpcms realizes the direct Alipay payment function of orders

E-commerce system microservice architecture

Wait to solve the zombie process

Radis:Linux上安装Redis(步骤)

电商系统微服务架构

Dynamic memory allocation (malloc calloc realloc free)

#include errors detected. Please update your includePath.
随机推荐
Market Research - current situation and future development trend of anti-counterfeiting label market
全面解析分享购商业模式逻辑?分享购是如何赋能企业
地方经销商玩转社区团购模式,百万运营分享
Market Research - current market situation and future development trend of total nutrition products
Perceptron model and Application
U++ 原始内存 学习笔记
Market Research - current market situation and future development trend of marine wet exhaust hose
悬镜安全在RSAC2022上斩获Global InfoSec Awards四项大奖
Market Research - current situation and future development trend of environmental friendly fireworks Market
Simpleitk use - 4 Strange question
影视随摘
位的高阶运算
Oracle cursor
JS syntax ES6, ES7, es8, es9, ES10, es11, ES12 new features (Abstract)
牛客网:龙与地下城游戏
kubernetes 使用主机名将 pod 分配在指定节点上
杰理之修改不需要长按开机功能【篇】
Struct, bit segment, enumeration, union
杰理之直接触摸样机的顶针反应不正常【篇】
go 4种单例模式