当前位置:网站首页>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;
}
边栏推荐
- Radis:Linux上安装Redis(步骤)
- #include errors detected. Please update your includePath.
- Zhong Xuegao responded that the product will not melt for 1 hour: it contains solid components and cannot melt into water
- 数组进阶提高
- Il n'est pas nécessaire d'appuyer longtemps sur la fonction de démarrage pour modifier Jelly [chapitre]
- U++ 原始内存 学习笔记
- 影视随摘
- 《乔布斯传》英文原著重点词汇笔记(十)【 chapter eight】
- Market Research - current market situation and future development trend of aircraft front wheel steering system
- 大话云原生之负载均衡篇-小饭馆客流量变大了
猜你喜欢
E-commerce system microservice architecture
牛客网:最大子矩阵
Developers share | HLS and skillfully use Axi_ Customize the master bus interface instructions and improve the data bandwidth - area exchange speed
【板栗糖GIS】arcmap—如何批量修改注记要素的字体,颜色,大小等
Graphic view frame
Perceptron model and Application
It's not easy to say I love you | use the minimum web API to upload files (swagger support) # yyds dry inventory #
Radis:Linux上安装Redis(步骤)
数组进阶提高
Oracle cursor
随机推荐
Notes on key vocabulary in the English original of the biography of jobs (10) [chapter eight]
[LeetCode] 回文数【9】
悬镜安全在RSAC2022上斩获Global InfoSec Awards四项大奖
分享 10 个 JS 闭包面试题(图解),进来看看你能答对多少
Simpleitk use - 4 Strange question
Market Research - current situation and future development trend of environmental friendly fireworks Market
加油站[问题分析->问题转换->贪心]
Server response status code
Market Research - current market situation and future development trend of marine wet exhaust hose
杰理之快速触摸不响应问题【篇】
图形视图框架
[QT] QT multithreading development - four methods to realize multithreading design
Niuke: Dragon and dungeon games
JS syntax ES6, ES7, es8, es9, ES10, es11, ES12 new features (Abstract)
Pointer array parameter passing, pointer parameter passing
[QT] Q multithreaded development - Analysis of multithreaded application examples (Mandelbrot)
钟薛高回应产品1小时不化:含固体成分 融化不能变成水
[LeetCode] 存在重复元素【217】
杰理之直接触摸样机的顶针反应不正常【篇】
uniapp微信登录返显用户名和头像