codeforces 158A Next Round (水题)

从零开始:STM32C011开发板的硬件生态与快速验证 本文全面解析STM32C011开发板的硬件生态与快速验证方法,帮助开发者从零开始掌握这款基于ARM Cortex-M0+内核的微控制器。内容涵盖硬件架构解析、开发环境搭建、基础功能验证及性能优化技巧,为嵌入式开发提供实用指导。 阅读详情

题目:

A. Next Round
time limit per test
3 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

"Contestant who earns a score equal to or greater than the k-th place finisher's score will advance to the next round, as long as the contestant earns a positive score..." — an excerpt from contest rules.

A total of n participants took part in the contest (n ≥ k), and you already know their scores. Calculate how many participants will advance to the next round.

Input

The first line of the input contains two integers n and k (1 ≤ k ≤ n ≤ 50) separated by a single space.

The second line contains n space-separated integers a1, a2, ..., an (0 ≤ ai ≤ 100), where ai is the score earned by the participant who got the i-th place. The given sequence is non-increasing (that is, for all i from 1 to n - 1 the following condition is fulfilled: ai ≥ ai + 1).

Output

Output the number of participants who advance to the next round.

Sample test(s)
input
8 5
10 9 8 7 7 7 5 5
output
6
input
4 2
0 0 0 0
output
0
Note

In the first example the participant on the 5th place earned 7 points. As the participant on the 6th place also earned 7 points, there are 6 advancers.

In the second example nobody got a positive score.

题意分析:

有n个数字,计算大于等于第k个数的个数。水题,不解释


代码:

#include<iostream>
int n,k,i,j,a[51];
using namespace std;
int main()
{
    cin>>n>>k;
    while(n>i)  cin>>a[i++];
    while(a[j]&&a[j]>=a[k-1])++j;
    cout<<j;
}


两级运算放大器设计与仿真 运算放大器(简称运放)是许多模拟系统和混合信号系统中的一个完整部分。各种不同复杂程度的运放被用来实现各种功能:从直流偏置的产生到高速放大或滤波。伴随者每一代 CMOS 工艺,由于电源电压和晶体管沟道长度的减小,为运放的设计不断提出复杂的课题。 运算放大器的设计可以分为两个较为独立的步骤,第一步是选择或搭建运放的基本结构,绘出电路结构草图,第二步就要选择直流电流,手工设计管子尺寸,以及设计补偿电路等等,然后在手工计算的基础上,运用模拟电路仿真软件对设计的两级运放进行仿真,并对电路进行后续的调试和修改。.... 阅读详情

相关推荐

华为防火墙USG6600全流量日志配置指南:从流量监控到NAT日志的完整方案

本文详细介绍了华为USG6600防火墙全流量日志配置方案,涵盖流量监控、NAT日志及安全事件溯源等核心功能。通过精细化配置和性能优化技巧,帮助企业构建高效、合规的日志体系,提升网络安全运维效率。文章特别强调了日志采样与字段过滤的实用方法,适用于高流量环境下的资源优化。

gin88的博客 348

A. Next Round

time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output "Contestant who earns a score equal to or greater than the k-th

无知的我 2845

手把手教你用89C52单片机驱动0.96寸OLED(IIC接口,附完整代码)

本文详细介绍了如何使用89C52单片机通过I2C接口驱动0.96寸OLED显示屏,包括硬件连接、I2C通信原理、SSD1306驱动芯片的初始化及显存管理技巧,并提供了完整的代码示例和常见问题排查方法,帮助电子爱好者快速掌握OLED显示技术。

weixin_30781433的博客 369

158A - Next Round

A. Next Round time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output“Contestant who earns a score equal to or greater than the k-th place

Cai_Haiq的博客 743

YT8531 PHY芯片硬件设计与MDIO/RGMII实战指南

以太网PHY芯片是FPGA系统实现网络通信的物理层核心,其关键在于标准接口(如MDIO管理总线和RGMII数据接口)的正确实现与协同。MDIO作为IEEE 802.3定义的低速配置通道,负责寄存器级控制与状态监控;RGMII则通过双沿采样精简引脚,在千兆速率下兼顾性能与PCB布线可行性。技术价值体现在电压兼容性(支持1.8V/2.5V/3.3V)、可编程时序调节(RX_DELAY/TX_DELAY)及多级环回测试能力,显著提升国产FPGA平台(如Xilinx Zynq)的工程鲁棒性。典型应用场景涵盖嵌入式网

weixin_42453228的博客 1337

BQ4050开发进阶(二):Protections参数优化策略与实战解析

本文深入解析了BQ4050电池管理芯片中Protections参数的优化策略与实战方法。针对电压、电流、温度等核心保护功能,详细阐述了如何根据具体电芯特性、负载场景和环境因素,精细调整CUV、COV、OCC/OCD等阈值与延时,以在确保电池绝对安全的前提下,实现极致的用户体验与系统可靠性。

rgv234567的博客 480

A. Next Round【难度: 水题 / 知识点: 模拟】

https://codeforces.com/problemset/problem/158/A #include<bits/stdc++.h> using namespace std; const int N=1e5+10; int n,m,cnt,s[N]; int main(void) { cin>>n>>m; for(int i=1;i<=n;i++) cin>>s[i]; int temp=s[m]; for(int i=1;i<.

bettle_king的博客 239

立创星火计划:基于STM32H743VIH6的Maverick_H743_MK1.0高性能开源飞控硬件全解析

本文详细解析了基于STM32H743VIH6核心的Maverick_H743_MK1.0高性能开源飞控硬件设计。重点阐述了采用双IMU冗余设计、高精度气压计、多路独立电源管理以及丰富接口(如CAN总线)的考量,旨在为穿越机、科研无人机等平台提供强大、可靠的飞行控制解决方案。

weixin_28787801的博客 198

VK Cup 2012 Qualification Round 1 A题

这题要仔细阅读题目的意思!就是这就句话“"Contestant who earns a score equal to or greater than the k-th place finisher's score will advance to the next round, as long as the contestant earns a positive score..." — an e

傻笨 961

【屠龙之术】SAP 欧洲公司 高级合规性报表 FEC

所谓FEC ,其实是法国税务局要求法国的公司,每年要向税务局进行提交的税务报告,这个报告有特殊的格式,进行加密,法国公司要在收到税务局通知以后,及时进行报送,如果不报送,或者报送不合格文件,将面临5000欧的罚款。-----------------------------------------------进入正文----------------------------------------------------------------------有专门的T-code,PPT我就不贴了,我直接截图。

竹大的博客 1960

基于YOLOv8与UI界面的短视频内容审核系统实现与深度学习应用

YOLO(You Only Look Once)是一种用于实时物体检测的深度学习模型,它能在单次前向传播中同时完成物体检测和定位。YOLOv8是YOLO系列中的最新版本,相较于之前的版本,YOLOv8具有更高的检测精度和更快的推理速度,特别适合需要实时检测的应用场景。YOLOv8通过卷积神经网络(CNN)来提取图像中的特征,并通过多个卷积层来预测每个目标的位置和类别。该模型的优势在于其端到端的结构,使得在视频监控、自动驾驶、安防监控等实时应用中,能够实现快速且高效的目标检测。

YOLO 314

codeforces 158A - Next Round (c语言)

158A - Next Round (c语言)

ectfgd的博客 303

12306自动抢票系统:基于DrissionPage的智能购票实战

摘要:本文介绍了一个基于DrissionPage的12306自动抢票系统实现方案。该系统通过模拟真实用户操作,实现了车票查询、登录认证、座位选择和订单提交的全流程自动化。项目采用DrissionPage库替代传统Selenium方案,具有更简洁的API设计和更好的性能表现。核心技术包括数据包监听、动作链模拟和反爬虫应对策略,实现了高效可靠的车票抢购功能。系统包含完整的业务流程设计,从环境初始化到最终订单提交,并提供了清晰的数据展示界面。本文强调该项目仅用于技术研究,在实际使用中应严格遵守12306平台规则

那些看似不起波澜的日复一日,会在某天让你看到坚持的意义 2790

codeforces 158A Next Round(水题)

A. Next Round 点击打开题目 time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output "Contestant who earns a score equal

1460

ssm框架搭建

这个是一个在idea上成功跑起来的ssm框架项目,保存在这里方便以后使用直接下载

Outlook Express 6 (OE6) for Win7/Win8/Win10

英文版 Outlook Express6.0, 兼容Win7/Win10/WinXP,解压就可用。

Codeforces——158A Next Round

小声BB 最近总是状态不好,不管是范围还是特例都有思考不周之处 题干 time limit per test:3 seconds memory limit per test:256 megabytes input:standard input output:standard output “Contestant who earns a score equal to or greater than the k-th place finisher’s score will advance to the next

真田伊廉的博客 531

华为的C语言编程规范.pdf

华为技术有限公司内部技术规范。本规范制定了编写C语言程序的基本原则、规则和建议。从代码的清晰、简洁、可测试、安全、程序效率、可移植各个方面对C语言编程作出了具体指导。

Next Round_Codeforces_158A

原题链接:http://codeforces.com/problemset/problem/158/A A. Next Round time limit per test 3 seconds memory limit per test 256 megabytes input standard input output s

MoogleAndChocobo的博客 229

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

codeforces 158A Next Round

A. Next Round time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output "Contestant who earns a score equal to or greater than

煌的博客 335

【Codeforces 158A】Next Round

【链接】 我是链接,点我呀:) 【题意】 让你找到排名的前k名,并列的话,如果分数大于0那么就算晋级 问你最后有多少人可以晋级. 【题解】 按照题意模拟就好, 先按照a[max] = a[k]的规则找到下标的最大值max 然后依据a[max]==0的规则,一直减小这个max. 直到max变成0为止。 最后输出max就好了 【代码】 import java.util.S...

239

CodeForces.158A Next Round (水模拟)

CodeForces.158A Next Round (水模拟)题意分析校赛水题的英文版,坑点就是要求为正数。代码总览#include <iostream> #include <cstdio> #include <algorithm> #include <cstring> #include <sstream> #include <set> #include <map> #include <queue

Pengwill's Blog 329

Codeforces 158A Next Round

题目链接 http://codeforces.com/problemset/problem/158/A #include<iostream> #include<string> using namespace std; int main() { int n,k; int num=0; int arr[100]={0}; ...

weixin_30532369的博客 151

Codeforces Problem-158A Next Round

Codeforces Problem-158A Next Round 基本思想: 考虑到本题数据样本并不大,可以暴力直接求解。 计数条件:a[i]≠0且a[i]≥a[k-1]。//(从0开始计数) AC代码: #include <bits/stdc++.h> using namespace std; int main() { int n,k; int a[105]; memset(a,0,sizeof(a)); scanf("%d%d",&n,&k); for

BrilliantWilliam的博客 240

Problem——158A. Next Round——Codeforces

time limit per test3 seconds memory limit per test256 megabytes inputstandard input outputstandard output “Contestant who earns a score equal to or greater than the k-th place finisher’s score will ad...

Foolishman的博客 334

Codeforces 158A - Next Round

问题: A. Next Round time limit per test: 3 seconds memory limit per test: 256 megabytes input: standard input output: standard output “Contestant who earns a score equal to or greater than the k-th plac...

Yuhan的博客 283

Codeforces 158A-Next Round

思路:得分非正数直接跳过,因为序列是非增的,所以第k个数及之前的正数直接计算在内,第k个数之后的与第k个数相等的可计算在内。positive 正数的 excerpt 节选 non-increasing 非增。

ywzdcj的博客 198

codeforce158A Next Round

A. Next Round time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output "Contestant who earns a score equal to or gre

保险柜 315
上一篇: Codeforces Round #109 (Div. 2) B (贪心)
下一篇: codeforces 158B Taxi (贪心)
Notdeep__acm
博客等级 码龄12年 20粉丝 53原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值