CodeForces 158 A.Next Round(水~)
来源:互联网 发布:seo搜索引擎是什么 编辑:程序博客网 时间:2024/06/08 15:33
Description
从大到小给出
Input
第一行两个整数
Output
输出晋级人数
Sample Input
8 5
10 9 8 7 7 7 5 5
Sample Output
6
Solution
水题
Code
#include<cstdio>#include<iostream>#include<cstring>#include<algorithm>#include<cmath>#include<vector>#include<queue>#include<map>#include<set>#include<ctime>using namespace std;typedef long long ll;typedef pair<int,int>P;const int INF=0x3f3f3f3f,maxn=100001;int n,k,a[maxn]; int main(){ while(~scanf("%d%d",&n,&k)) { int ans=0; for(int i=1;i<=n;i++)scanf("%d",&a[i]); for(int i=1;i<=n;i++) if(a[i]&&a[i]>=a[k])ans++; printf("%d\n",ans); } return 0;}
阅读全文
0 0
- CodeForces 158 A.Next Round(水~)
- CodeForces.158A Next Round (水模拟)
- codeforces 158A Next Round(水题)
- codeforces 158A Next Round (水题)
- CodeForces 158A Next Round
- codeforces 158A Next Round
- Problem--158A--Codeforces--Next Round
- 158A - Next Round
- 158A Next Round
- Codeforces VK Cup 2012 Qualification Round 1 / 158A Next Round(模拟)
- CF#158A Next Round
- code Forces 158A Next Round
- A. Next Round
- Codeforces Round #298 (Div. 2) A. Exam(水)
- Codeforces Round #275 (Div. 1)A. Diverse Permutation (水)
- Codeforces Round #327 (Div. 2) A. Wizards' Duel(水)
- 【CodeForces】Round #345 (Div. 2) A. Joysticks(水)
- CodeForces - 659A Round House (形成环)水
- 大数据预科班1、2
- 分页详讲
- C#里partial关键字的作用
- Wormholes
- java开发环境jdk的下载和环境变量的配置
- CodeForces 158 A.Next Round(水~)
- maven环境搭建环境变量配置以及结合myeclipse建立工程
- 剐倘卦端狡斡举盼甲芬释瓷崖衣竿
- Python Plot+Bokeh画图并保存为图片或网页
- 暑期项目实训之健康宝APP(一)
- GPS启动流程及数据流向分析
- 美团内推 类似题目
- Cow Contest
- EU4-52: Discussing possible solutions