脑洞题。http://blog.csdn.net/dgq8211/article/details/7748078

#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std; struct abc
{
int A,B;
}x[];
int T,N;
int Max[]; bool cmp(const abc&a,const abc&b)
{
return a.A<b.A;
} int main()
{
scanf("%d",&T);
for(int t=;t<=T;t++)
{
scanf("%d",&N);
for(int i=;i<N;i++)
scanf("%d%d",&x[i].A,&x[i].B);
sort(x,x+N,cmp);
memset(Max,,sizeof Max);
int ans=0x7FFFFFFF;
Max[N-]=x[N-].B;
for(int i=N-;i>=;i--)
Max[i]=max(Max[i+],x[i].B);
for(int i=;i<N;i++)
ans=min(ans,x[i].A+Max[i+]);
printf("Case %d: %d\n",t,ans);
}
return ;
}

HDU 3552 I can do it!的更多相关文章

  1. HDOJ 2111. Saving HDU 贪心 结构体排序

    Saving HDU Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total ...

  2. 【HDU 3037】Saving Beans Lucas定理模板

    http://acm.hdu.edu.cn/showproblem.php?pid=3037 Lucas定理模板. 现在才写,noip滚粗前兆QAQ #include<cstdio> #i ...

  3. hdu 4859 海岸线 Bestcoder Round 1

    http://acm.hdu.edu.cn/showproblem.php?pid=4859 题目大意: 在一个矩形周围都是海,这个矩形中有陆地,深海和浅海.浅海是可以填成陆地的. 求最多有多少条方格 ...

  4. HDU 4569 Special equations(取模)

    Special equations Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u S ...

  5. HDU 4006The kth great number(K大数 +小顶堆)

    The kth great number Time Limit:1000MS     Memory Limit:65768KB     64bit IO Format:%I64d & %I64 ...

  6. HDU 1796How many integers can you find(容斥原理)

    How many integers can you find Time Limit:5000MS     Memory Limit:32768KB     64bit IO Format:%I64d ...

  7. hdu 4481 Time travel(高斯求期望)(转)

    (转)http://blog.csdn.net/u013081425/article/details/39240021 http://acm.hdu.edu.cn/showproblem.php?pi ...

  8. HDU 3791二叉搜索树解题(解题报告)

    1.题目地址: http://acm.hdu.edu.cn/showproblem.php?pid=3791 2.参考解题 http://blog.csdn.net/u013447865/articl ...

  9. hdu 4329

    problem:http://acm.hdu.edu.cn/showproblem.php?pid=4329 题意:模拟  a.     p(r)=   R'/i   rel(r)=(1||0)  R ...

随机推荐

  1. 可以有效防护XSS,sql注射,代码执行,文件包含等多种高危漏洞。

    http://bbs.aliyun.com/read/137391.html <?php /** * 云体检通用漏洞防护补丁v1.1 * 更新时间:2013-05-25 * 功能说明:防护XSS ...

  2. 写一个CGI程序并运行

    准备Linux和Apache我在/var/www/cgi-bin/下建一个文件get.c #include <stdio.h> #include <stdlib.h> int ...

  3. 第19讲 不带参数功能FC的编程与应用

  4. php 分页类(2)

    <?phpinclude("connection.php");$perNumber=10; //每页显示的记录数$page=$_GET['page']; //获得当前的页面值 ...

  5. wireshark 包过滤

    tcp.port == 443 or udp.port==443 or tcp.port==53 or udp.port==53

  6. ios 基础数据类型

    1:NSString http://blog.csdn.net/likendsl/article/details/7417878 http://xys289187120.blog.51cto.com/ ...

  7. TODO:小程序的使用体验

    TODO:小程序的使用体验 2017.01.09小程序如期而至,话说十年前的今天2007.01.09是第一代iPhone发布日期. 清晨朋友圈发了一张小程序的截图,很多朋友问用什么版本的微信才有小程序 ...

  8. android通过代码判断手机是否root

    只要/system/bin/su./system/xbin/su这两个文件中有一个存在,就表明已经具有ROOT权限,如果两个都不存在,则不具有ROOT权限. // 判断是否具有ROOT权限 publi ...

  9. zookeeper入门知识

    ZooKeeper 是什么? ZooKeeper 顾名思义 动物园管理员,他是拿来管大象(Hadoop) . 蜜蜂(Hive) .小猪(Pig)  的管理员, Apache Hbase和 Apache ...

  10. eclipse使用外部maven时multiModuleProjectDirectory错误解决

    错误提醒: -Dmaven.multiModuleProjectDirectory system propery is not set. Check $M2_HOME environment vari ...