hdu5443(2015长春网络赛G题)
2015-09-14 10:17
429 查看
题意:
一个数列,求从L到R的最大值。
思路:
不多说。。。
代码:
一个数列,求从L到R的最大值。
思路:
不多说。。。
代码:
#include<cstdio> #include<cstring> int a[20000]; int main() { int t; scanf("%d",&t); while(t--) { int n; scanf("%d",&n); for(int i=1;i<=n;i++) { scanf("%d",&a[i]); } int m; scanf("%d",&m); while(m--) { int l,r; scanf("%d%d",&l,&r); int maxx=-1; for(int i=l;i<=r;i++) if(a[i]>maxx) maxx=a[i]; printf("%d\n",maxx); } } return 0; }
相关文章推荐
- iOS--判断网络是否可用-(本地判断)
- Android判断网络状态方法详解
- hdu5438(2015长春网络赛B题)
- ACM Computer Factory 网络流
- 网络连接之——谷歌提供的通信框架Volley【避免创建多个线程对象】
- iOS符号表 http://help.bugtags.com/hc/kb/article/68470/
- hdu5437(2015长春网络赛A题)
- Android-Async-Http & 开源框架
- httpd-2.2版本安装及配置
- BP神经网络能做什么?
- 神经网络FAQ简介
- 设置iOS9网络安全传输
- 深度学习(DL)与卷积神经网络(CNN)学习笔记随笔-03-基于Python的LeNet之LR
- git设置HTTP代理
- 《Linux内核编程》第四章:proc文件系统 http://blog.csdn.net/tankai19880619/article/details/8032204
- linux 学习笔记-------CentOS网络设置方法
- Linux编程学习笔记--proc文件系统 http://www.cnblogs.com/weichsel/archive/2012/06/23/2559613.html
- proc编程的一个简单例子 http://blog.csdn.net/mailbox2005/article/details/3881538
- mysql:Can’t create TCP/IP socket (10106)”
- iOS开发网络数据之AFNetworking使用