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 = ;
int n, a[maxn], tmp, ans;
int main()
{
cin >> n;
for (int i = ; i < n; i ++)
cin >> a[i];
tmp = ans = ;
for (int i = ; i <= n; i++)
if (a[i] >= a[i-])
{
tmp ++;
if (tmp > ans) ans = tmp;
}
else
tmp = ;
cout << ans;
return ;
}
C++
codeforces水题100道 第十四题 Codeforces Round #321 (Div. 2) A. Kefa and First Steps (brute force)的更多相关文章
- codeforces水题100道 第二十四题 Codeforces Beta Round #85 (Div. 2 Only) A. Petya and Strings (strings)
题目链接:http://www.codeforces.com/problemset/problem/112/A题意:忽略大小写,比较两个字符串字典序大小.C++代码: #include <cst ...
- Codeforces Round #321 (Div. 2) A. Kefa and First Steps 水题
A. Kefa and First Steps Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/58 ...
- Codeforces Round #321 (Div. 2)-A. Kefa and First Steps,暴力水过~~
A. Kefa and First Steps time limit per test 2 seconds memory limit per test 256 megabytes input stan ...
- codeforces水题100道 第二十六题 Codeforces Beta Round #95 (Div. 2) A. cAPS lOCK (strings)
题目链接:http://www.codeforces.com/problemset/problem/131/A题意:字符串大小写转换.C++代码: #include <cstdio> #i ...
- codeforces水题100道 第二十五题 Codeforces Round #197 A. Helpful Maths (Div. 2) (strings)
题目链接:http://www.codeforces.com/problemset/problem/339/A题意:重新组合加法字符串,使得按照1,2,3的顺序进行排列.C++代码: #include ...
- codeforces水题100道 第二十二题 Codeforces Beta Round #89 (Div. 2) A. String Task (strings)
题目链接:http://www.codeforces.com/problemset/problem/118/A题意:字符串转换……C++代码: #include <string> #inc ...
- codeforces水题100道 第十九题 Codeforces Round #109 (Div. 2) A. I_love_%username% (brute force)
题目链接:http://www.codeforces.com/problemset/problem/155/A题意:找到当前最大值或者最小值出现的次数.“当前”的意思差不多是a[i]大于所有a[j]( ...
- codeforces水题100道 第十八题 Codeforces Round #289 (Div. 2, ACM ICPC Rules) A. Maximum in Table (brute force)
题目链接:http://www.codeforces.com/problemset/problem/509/A题意:f[i][1]=f[1][i]=1,f[i][j]=f[i-1][j]+f[i][j ...
- codeforces水题100道 第十六题 Codeforces Round #164 (Div. 2) A. Games (brute force)
题目链接:http://www.codeforces.com/problemset/problem/268/A题意:足球比赛中如果主场球队的主场球衣和客队的客队球衣颜色一样,那么要求主队穿上他们的可对 ...
随机推荐
- PoseNet: A Convolutional Network for Real-Time 6-DOF Camera Relocalization
用卷积神经网络对相机位置和角度进行回归.
- discuz 手机上看帖子图片显示“[viewimg]”如何修改?
手机bbs上看帖子,如果帖子中有外网图片显示的是“[viewimg]”,而不是图片pre_forum_thread 主题表pre_forum_post 帖子表 库表pre_forum_post中字段m ...
- discuz X论坛技术架构 MVC结构浅析
摘自:http://yeyuan.iteye.com/blog/930727 PS:本人刚接触discuz论坛,php水平有限,当中的理解,如有不正确之处,欢迎指出 ----------------- ...
- (转)tcp和udp能否发送0字节的数据包
版权声明:本文为博主原创文章,未经博主允许不得转载. 转自:http://blog.csdn.net/wzx19840423/article/details/6643094 最近去一家牛逼的公司面试 ...
- SQLException: Column count doesn't match value count at row 1
INSERT INTO table_name(col_name1, col_name2, col_name3) VALUES('value1','value2'); 语句中,前后列数不等造成的 转自: ...
- int[,] 和 int[][] 有什么区别
int[,] 是二维数组,它就是传统意义上 n x m 的表,和 C++ 里的 int[][] 是一个意思. int[][] 是交错数组,与 C++ 里的 int[][] 不同.它其实是一个 int[ ...
- IntelliJ IDEA 终极破解
1. 下载破解补丁(JetbrainsCrack-2.6.10-release-enc.jar): http://idea.lanyus.com/jar/JetbrainsCrack-2.6.10-r ...
- eclipse 访问 hive1.2.1
参考链接1.http://www.iteblog.com/archives/846 操作实际参考代码:http://sunhs.sinaapp.com/?p=343 配置eclipse 搞1天, 不管 ...
- Thinkphp5笔记四:设置模板路径
默认的模板路径在模块/view文件里面.如果你觉得这样不太方便管理,想要把他设置Template目录下,可以这样做. 模板参数 ,能够影响的它参数,是当前模块下config.php template- ...
- 【LFM】隐语义模型
模型解释: http://blog.csdn.net/harryhuang1990/article/details/9924377