BNU OJ 50999 BQG's Approaching Deadline
#include<cstdio>
#include<algorithm>
using namespace std; const int maxn=+;
struct Homework
{
long long st;
long long len;
}h[maxn];
int n; bool cmp(const Homework&a,const Homework&b)
{
return a.st<b.st;
} int main()
{
int T;
scanf("%d",&T);
while(T--)
{
scanf("%d",&n);
for(int i=;i<=n;i++)
scanf("%lld%lld",&h[i].st,&h[i].len);
long long ans=;
sort(h+,h++n,cmp);
for(int i=;i<=n;i++)
{
ans=max(ans,h[i].st);
ans=ans+h[i].len;
}
printf("%lld\n",ans); }
return ;
}
BNU OJ 50999 BQG's Approaching Deadline的更多相关文章
- BNU OJ 51005 BQG's Quadrilateral Bricks
#include<cstdio> #include<cstring> #include<cmath> #include<vector> #include ...
- BNU OJ 51000 BQG's Random String
#include<cstdio> #include<cstring> #include<algorithm> using namespace std; +; cha ...
- BNU OJ 51003 BQG's Confusing Sequence
二进制++高精度取模 #include<cstdio> #include<cstring> #include<algorithm> using namespace ...
- BNU OJ 50998 BQG's Messy Code
#include <cstdio> #define _(l) int l #define ___(l,L) for (_(o)=0,x=l o*2;o<x;o++)O= L o; # ...
- BNU OJ 50997 BQG's Programming Contest
#include<cstdio> #include<cstring> #include<cmath> #include<algorithm> using ...
- BNU OJ 33691 / LA 4817 Calculator JAVA大数
留着当个模板用,在BNU上AC,在LA上RE……可能是java的提交方式不同??? 数和运算符各开一个栈. 表达式从左到右扫一遍,将数存成大数,遇到数压在 数的栈,运算符压在 运算符的栈,每当遇到右括 ...
- BNU OJ 1027 金币系统
金币系统 Time Limit: 1000ms Memory Limit: 65535KB 64-bit integer IO format: %lld Java class name: ...
- bnu oj 13288 Bi-shoe and Phi-shoe
题目链接: http://www.bnuoj.com/contest/problem_show.php?pid=13288 题目大意: 给出一个n,然后给出n个幸运数([1,m]中不能被m整除的数的数 ...
- ACM数据结构相关资料整理【未完成,待补充】
在网上总是查不到很系统的练ACM需要学习的数据结构资料,于是参考看过的东西,自己整理了一份. 能力有限,欢迎大家指正补充. 分类主要参考<算法竞赛入门经典训练指南>(刘汝佳),山东大学数据 ...
随机推荐
- Linux Ubuntu 内核升级
方法一 : 1 更新系统源 apt-get update 2 搜索内核文件 apt-cache search linux-image 3 安装 apt-get install -y linux-im ...
- JVM 设置
按照基本回收策略分 引用计数(Reference Counting) 标记-清除(Mark-Sweep) 复制(Copying) 标记-整理(Mark-Compact) 按分区对待的方式分 增量收集( ...
- TypeConverter的使用
我们知道,C#中有int.Parse,int.TryParse这样神奇的功能,那它们又是如何做到的呢?我们试着自己也来自定义一个“转换器”. 首先,定义一个类: public class Human ...
- eclipse添加桌面快捷方式
linuxmint系统 输入sudogedit /usr/share/applications/eclipse.desktop,在打开的文件中输入以下参数: [Desktop Entry] Encod ...
- Inno Setup入门(十)——操作注册表
有些程序需要随系统启动,或者需要建立某些文件关联等问题,这些都是通过在安装程序中对注册表进行操作的结果.Inno Setup中通过[registry]段实现对注册表的操作. 本段说明: 参数列表: 参 ...
- adb端口被占用
程序不能执行,kill掉任务管理器里面adb服务,重新连接设备仍然有错 查到可能是adb端口被占用 查看adb用的是哪个端口:C:\Users\wanglin>adb nodaemon serv ...
- Mybatis——helloWorld级程序
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE configuration PUBLIC & ...
- 事件委托小demo(jq版)
<style type="text/css"> * { margin:; padding:; } .box1 { width: 200px; height: 60px; ...
- 查找List中的最大最小值
以下实例演示了如何使用 Collections 类的 max() 和 min() 方法来获取List中最大最小值: import java.util.*; public class Main { pu ...
- php 编程效率(1)
用单引号代替双引号来包含字符串,这样做会更快一些.因为PHP会在双引号包围的字符串中搜寻变量,单引号则 不会,注意:只有echo能这么做,它是一种可以把多个字符串当作参数的“函数”(译注:PHP手册中 ...