当前位置:网站首页>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;
}边栏推荐
- Commodity information management system (C language document version)
- Notes on key vocabulary in the English original of the biography of jobs (11) [chapter nine]
- 数学建模——图与网络模型及方法(一)
- NC24325 [USACO 2012 Mar S]Flowerpot
- 送给即将工作的自己
- Market Research - current market situation and future development trend of aircraft audio control panel system
- 建立自己的网站(22)
- UE4 游戏架构 学习笔记
- Oracle-游标
- Market Research - current market situation and future development trend of third-party data platform
猜你喜欢

地方经销商玩转社区团购模式,百万运营分享
![[LeetCode] 数组中的第K个最大元素【215】](/img/72/d3e46a820796a48b458cd2d0a18f8f.png)
[LeetCode] 数组中的第K个最大元素【215】

Socket套接字C/S端流程

大话云原生之负载均衡篇-小饭馆客流量变大了

Jatpack------LiveData

NC50965 Largest Rectangle in a Histogram
![[ODX studio edit PDX] -0.1- how to quickly view the differences in supported diagnostic information between variant variants (service, sub function...)](/img/2b/f31b81cedf37ca187bcaa20dfe0b83.png)
[ODX studio edit PDX] -0.1- how to quickly view the differences in supported diagnostic information between variant variants (service, sub function...)

Leetcode circular linked list (fast and slow pointer) code line by line interpretation

UE4 游戏架构 学习笔记

kubernetes 使用主机名将 pod 分配在指定节点上
随机推荐
NC50965 Largest Rectangle in a Histogram
Storage unit conversion
全面解析分享购商业模式逻辑?分享购是如何赋能企业
【微服务|Sentinel】重写sentinel的接口BlockExceptionHandler
杰理之、产线装配环节【篇】
【板栗糖GIS】arcmap—如何批量修改注记要素的字体,颜色,大小等
Simpleitk use - 4 Strange question
Jatpack------LiveData
Market Research - current market situation and future development trend of intravenous injection (IV) bottles
悬镜安全在RSAC2022上斩获Global InfoSec Awards四项大奖
wait解决僵尸进程
对象与对象变量
基于ASP.net的手机销售管理系统(二手手机销售管理系统)+ASP.NET+C#语言+VS2010+数据库可以用于课设、毕设学习
Market Research - current situation and future development trend of herringbone gear Market
kubernetes 使用主机名将 pod 分配在指定节点上
What is the'function'keyword used in some bash scripts- What is the 'function' keyword used in some bash scripts?
杰理之如何测试按键的误触率【篇】
Unity publishes a method of webgl playing sound
Source code analysis - lightweight asynchronous crawler framework Ruia
钟薛高回应产品1小时不化:含固体成分 融化不能变成水