[2016-03-23][codeforces][580][A][Kefa and First Steps]

  • 时间:2016-03-23 13:04:56 星期三

  • 题目编号:[2016-03-23][codeforces][580][A][Kefa and First Steps]

  • 题目大意:求最长上升子串

  1. #include <cstdio>
  2. using namespace std;
  3. int a[100000 + 100];
  4. int main(){
  5. int n;
  6. scanf("%d",&n);
  7. for(int i = 0 ;i < n ;++i)
  8. scanf("%d",&a[i]);
  9. int cur = 1,ans = 0;
  10. for(int i = 1;i < n ;++i){
  11. if(a[i] >= a[i - 1]) ++cur;
  12. else{
  13. if(ans < cur) ans = cur;
  14. cur = 1;
  15. }
  16. }
  17. printf("%d\n", cur>ans?cur:ans);
  18. return 0;
  19. }

来自为知笔记(Wiz)

时间: 2024-08-14 04:17:40

[2016-03-23][codeforces][580][A][Kefa and First Steps]的相关文章

分布式技术一周技术动态 2016.03.20

分布式系统实践 1. 基于Mesos和Docker的分布式计算平台 https://mp.weixin.qq.com/s?__biz=MzAxMDgzOTA2Mw==&mid=402769128&idx=1&sn=cea3ad1357bd9312acf1768c0a493bfd&scene=1&srcid=0318BTuxT0fsFYwPjpeyuDOa&key=710a5d99946419d90fbc1e7600cce055b6e997d6afafc74c

codeforces 580A Kefa and First Steps

A. Kefa and First Steps Kefa decided to make some money doing business on the Internet for exactly n days. He knows that on the i-th day (1 ≤ i ≤ n) he makes ai money. Kefa loves progress, that's why he wants to know the length of the maximum non-dec

Codeforces 841A - Generous Kefa

题目链接:http://codeforces.com/problemset/problem/841/A One day Kefa found n baloons. For convenience, we denote color of i-th baloon as si — lowercase letter of the Latin alphabet. Also Kefa has k friends. Friend will be upset, If he get two baloons of

2016.10.23大型在职研究生招生说明会

气温骤降,金秋已值,一年一度的十月攻坚战开始了.伴随着在职研究生新政的颁布,北京地区各大院校在职研究生的新简章轮番更新,给很多准备报考在职研究生的学员带来了各种混乱以及忐忑. 正巧,2016年秋季大型在职研究生招生说明会即将在北京国家图书馆召开.不管你对在职研究生有多少疑问,这次会议都会给你一个完美的解释. 10月23日北京地区大型在职研究生招生说明会有必要去吗?去了以后真的能解决所有疑惑吗? 其实啊,我们在9月17日已经成功举办了一次北京大型在职研究生说明会,通过9.17说明会的完美收官总结一

codeforces 580D:Kefa and Dishes

Description When Kefa came to the restaurant and sat at a table, the waiter immediately brought him the menu. There were n dishes. Kefa knows that he needs exactly m dishes. But at that, he doesn't want to order the same dish twice to taste as many d

codeforces水题100道 第十四题 Codeforces Round #321 (Div. 2) A. Kefa and First Steps (brute force)

题目链接:http://www.codeforces.com/problemset/problem/580/A题意:求最长连续非降子序列的长度.C++代码: #include <iostream> using namespace std; const int maxn = 100100; int n, a[maxn], tmp, ans; int main() { cin >> n; for (int i = 0; i < n; i ++) cin >> a[i]

OneZero第三次站立会议(2016.3.23)

会议时间:2016年3月23日 13:00~13:15 会议成员:冉华,张敏,王巍,夏一鸣. 会议目的:汇报前一天工作,全体成员评论并修改. 会议内容:以下为会议插图 1.界面原型方面,夏在统计界面中添加了“圆饼图”界面,在主界面添加了“摇一摇”按钮并添加了摇一摇界面.如下图: 2.冉已经确定开发环境.如第一张图所示.随后便会让所有成员拷贝,安装,配置.冉写出了开发环境的安装配置文档,十分之赞. 3.需求图,张已经修改完毕.接下来是需求列表的整理,张正在进行中. 会议体会:团队交流流畅.当一个成

uboot.2016.03 在mini2440上norfalsh启动

本人有点懒惰,直接在smdk2410的基础上进行修改 (note :红色字体表示修改内容,蓝色字体表示增加内容) 1. 顶层的makefile 在247行 添加如下两条语句 :   ARCH :=arm     CROSS_COMPILE :=arm-linux- 2 修改始终频率 打开 u-boot-2016.03/arch/arm/cpu/arm920t/start.S 第77行 #if defined(CONFIG_S3C2410) #if defined(CONFIG_S3C2440)

switch结构2016/03/08

Switch  03/08 一.结构 switch(){  case *: ;break;……default: ;brek;} 练习:输入一个日期,判断这一年第几天? Console.Write("请输入月份"); int m = int.Parse(Console.ReadLine()); Console.Write("请输入几号"); int d = int.Parse(Console.ReadLine()); int m1 = 31, m2 = 28, m3