CodeForces.158A Next Round (水模拟)
来源:互联网 发布:摄影网络销售技巧 编辑:程序博客网 时间:2024/06/01 09:42
CodeForces.158A Next Round (水模拟)
题意分析
校赛水题的英文版,坑点就是要求为正数。
代码总览
#include <iostream>#include <cstdio>#include <algorithm>#include <cstring>#include <sstream>#include <set>#include <map>#include <queue>#include <stack>#include <cmath>#define INF 0x3f3f3f3f#define nmax 200#define MEM(x) memset(x,0,sizeof(x))using namespace std;int a[nmax];int main(){ //freopen("in.txt","r",stdin); int n,k; while(scanf("%d %d",&n,&k)!= EOF){ for(int i = 0; i<n;++i) scanf("%d",&a[i]); int tar = a[k-1]; int ans = 0; for(int i = 0;i<n;++i){ if(a[i] <=0) break; if(a[i] < tar) break; if(a[i] >= tar) ans++; } printf("%d\n",ans); } return 0;}
0 0
- CodeForces.158A Next Round (水模拟)
- CodeForces 158 A.Next Round(水~)
- CodeForces 158A Next Round
- codeforces 158A Next Round
- Codeforces VK Cup 2012 Qualification Round 1 / 158A Next Round(模拟)
- codeforces 158A Next Round(水题)
- codeforces 158A Next Round (水题)
- Problem--158A--Codeforces--Next Round
- 158A - Next Round
- 158A Next Round
- CF#158A Next Round
- Codeforces Round #297 (Div. 2) A(模拟)
- Educational Codeforces Round 1 (A)模拟
- Educational Codeforces Round 5(A) 模拟
- Codeforces Round #340 (Div. 2)(A) 模拟
- Educational Codeforces Round 10(A)模拟
- Codeforces 659A Round House (模拟)
- Codeforces Round #360 A 简单模拟
- 秒杀多线程第九篇 经典线程同步总结 关键段 事件 互斥量 信号量
- 【 网络爬虫】java 使用Socket, HttpUrlConnection方式抓取数据
- 最近在学泛型,头有点大
- 集合框架-Map集合功能概述
- 秒杀多线程第十篇 生产者消费者问题
- CodeForces.158A Next Round (水模拟)
- python字符串索引
- wp-auto post pro插件【自动采集】
- POJ 2186 popular cows (tarjan + 缩点)
- [LeetCode]405. Convert a Number to Hexadecimal
- java线程池-1
- 【Java8源码分析】集合框架-ArrayList
- 数学函数
- led驱动