当前位置:网站首页>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;
}
边栏推荐
- 杰理之内置短按再长按,不管长按多长时间都是短按【篇】
- 牛客网:龙与地下城游戏
- [LeetCode] 回文数【9】
- uniapp微信登录返显用户名和头像
- 【微服务|Sentinel】重写sentinel的接口BlockExceptionHandler
- go 4種單例模式
- Market Research - current market situation and future development trend of night vision goggles for pilots
- Regular expression (2)
- Commodity information management system (C language document version)
- U++ learning notes - relaxation
猜你喜欢
随机推荐
Golang的学习路线
手写ORM(对象关系映射)增删改查
Leetcode circular linked list (fast and slow pointer) code line by line interpretation
Market Research - current market situation and future development trend of marine wet exhaust hose
What is the'function'keyword used in some bash scripts- What is the 'function' keyword used in some bash scripts?
NC24325 [USACO 2012 Mar S]Flowerpot
Pointer array parameter passing, pointer parameter passing
UE4 UI自适应屏幕
【外刊】睡眠与减肥
Market Research - current situation and future development trend of marine clutch Market
Oracle PL / SQL programming
《乔布斯传》英文原著重点词汇笔记(十)【 chapter eight】
服务器响应状态码
PMP项目整合管理
Methods of adding styles to native JS
[LeetCode] 回文数【9】
图形视图框架
Unity publishes a method of webgl playing sound
杰理之内置关机电流 1.2uA,之后不能长按开机【篇】
uniapp微信登录返显用户名和头像