The Water Problem(排序)
The Water Problem
Time Limit: 1500/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)
Total Submission(s): 816 Accepted Submission(s): 657
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
const int MAXN=;
int cmp(const void *a,const void *b){
if(*(int *)a<*(int *)b)return ;
else return -;
}
int main(){
int m[MAXN],T,N,q,l,r,n[MAXN];
scanf("%d",&T);
while(T--){
scanf("%d",&N);
for(int i=;i<=N;i++)
scanf("%d",m+i),n[i]=m[i];
scanf("%d",&q);
while(q--){
scanf("%d%d",&l,&r);
for(int i=;i<=N;i++)
m[i]=n[i];
qsort(m+l,r-l+,sizeof(m[]),cmp);
printf("%d\n",m[l]);
}
}
return ;
}
The Water Problem(排序)的更多相关文章
- HDU 5832 A water problem(某水题)
p.MsoNormal { margin: 0pt; margin-bottom: .0001pt; text-align: justify; font-family: Calibri; font-s ...
- hdu5832 A water problem
A water problem Time Limit: 5000/2500 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)T ...
- hdu 5443 The Water Problem
题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=5443 The Water Problem Description In Land waterless, ...
- HDU 5867 Water problem (模拟)
Water problem 题目链接: http://acm.split.hdu.edu.cn/showproblem.php?pid=5867 Description If the numbers ...
- HDU 5832 A water problem
A water problem Time Limit: 5000/2500 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)T ...
- HDU 5832 A water problem (带坑水题)
A water problem 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5832 Description Two planets named H ...
- hdu 5443 The Water Problem 线段树
The Water Problem Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php? ...
- HDU-4974 A simple water problem
http://acm.hdu.edu.cn/showproblem.php?pid=4974 话说是签到题,我也不懂什么是签到题. A simple water problem Time Limit: ...
- HDU 4974 A simple water problem(贪心)
HDU 4974 A simple water problem pid=4974" target="_blank" style="">题目链接 ...
随机推荐
- 异步操作AsycnTask类
1. 首先执行onPreExecute方法,进行UI的初步设置 2. 其次执行doInBackground方法,此时将不在UI中线程中进行了 3. 然后如果要进行中的数据的话可以通过publis ...
- firemonkey打开子窗体(匿名回调函数)
procedure TForm1.Button1Click(Sender: TObject);varChildForm: TForm2;beginChildForm := TForm2.Create( ...
- CSS实现页面背景自动切换功能
From here:http://xiaomiya.iteye.com/blog/2047728 请看效果图: 完整代码如下: <!DOCTYPE HTML> <html> & ...
- XMPP iOS开发(IM开发,转)
搭建完本地服务器之后,我们便可以着手客户端的工作,这里我们使用XMPPFramework这个开源库,安卓平台可以使用Smack(最好使用4.1以及之后的版本,支持流管理),为了简单起见这里只实现登陆. ...
- Web前端性能优化——高频触发事件的防抖
JS 提供了行为层的支持,为用户提供了交互的操作性. 然而,部分事件却常常有意无意的被频繁触发.比方浏览器窗体的 resize 事件.某个元素的 mouseover 事件,假设处理触发事件的回调函数过 ...
- javascript动态改变iframe的src
页面中需要动态的改变iframe的地址,方法有: 1. window.frames["chartFrame"].document.location = "<%=ba ...
- 第四章SignalR自托管主机
第四章SignalR自托管主机 SignalR服务器通常在IIS的Asp.Net应用程序上承载,但它也可以使用自托管库来作为自托管的主机来运行(就像控制台应用程序或Windows服务那样)与Signa ...
- Can't load IA 32-bit .dll on a AMD 64-bit platform
在myeclipse中使用的,tomcat异常:java.lang.UnsatisfiedLinkError: D:\JAVA\ApacheTomcat\bin\tcnative-1.dll: Can ...
- Maximum & Minimum Depth of Binary Tree
Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the long ...
- 谁能告诉我为什么sum_area输出总是0(多边形重心问题)
多边形重心问题 时间限制:3000 ms | 内存限制:65535 KB 难度:5 描述 在某个多边形上,取n个点,这n个点顺序给出,按照给出顺序将相邻的点用直线连接, (第一个和最后一个连接 ...