理解:区域覆盖。注意1,属于的区间有大小颠倒的情况:注意2,看图 ,两排房间公用一条走廊(for instance 1->3  4->6 不可公用)

#include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;
int num[1005];
int main()
{
int t;
cin>>t; while(t--)
{
int n;
cin>>n;
int maxn=0;
memset(num,0,sizeof(num));
for(int i=0; i<n; i++)
{
int x,y;
cin>>x>>y;
if(x>y)
swap(x,y);
if(x%2==1)
x++;
if(y%2==1)
y++;
for(int i=x; i<=y; i++)
{
num[i]++;
maxn=max(maxn,num[i]);
} }
cout<<maxn*10<<endl;
}
}

  //学校里的学长||学姐写的,看别人的代码 还是能学到++

UVa2326的更多相关文章

随机推荐

  1. Linux 进程间通讯详解六

    ftok()函数 key_t ftok(const char *pathname, int proj_id); --功能:创建系统建立IPC通讯 (消息队列.信号量和共享内存) 时key值 --参数 ...

  2. 基于thrift的微服务框架

    前一阵开源过一个基于spring-boot的rest微服务框架,今天再来一篇基于thrift的微服务加框,thrift是啥就不多了,大家自行百度或参考我之前介绍thrift的文章, thrift不仅支 ...

  3. AngularJS 之 Factory vs Service vs Provider【转】

    英文原文:AngularJS: Factory vs Service vs Provider 当你初试 Angular 时,很自然地就会往 controller 和 scope 里堆满不必要的逻辑.一 ...

  4. Matlab && C-Mex Round 1

    前言:本篇文章主要通过一个简单的例子程序对C-Mex进行一个初步的说明.前期的环境搭建(包括安装Matlab和gcc编译器)就不在这里赘述了. 在看文章之前,建议初学者先检查一下Matlab的mex配 ...

  5. title与alt的区别

    html中的title属性和alt属性让人有些混淆. 以前不知道有title这个属性,第一次用到它时,就和alt产生了混淆.一位朋友告诉我说,alt是图片img标签里用的,title是超链接里用的, ...

  6. Query节点操作,jQuery插入节点,jQuery删除节点,jQuery Dom操作

    一.创建节点 var box = $('<div>节点</div>'); //创建一个节点,或者var box = "<div>节点</div> ...

  7. 【Python】[模块]使用模块,安装第三方模块

    一个.py文件就称之为一个模块(Model)按目录来组织模块的方法,称为包(Package)每一个包目录下面都会有一个__init__.py的文件内置函数1.使用模块 导入模块 import sys ...

  8. Filter(过滤器)学习

    一.Filter简介 Filter也称之为过滤器,它是Servlet技术中最激动人心的技术,WEB开发人员通过Filter技术,对web服务器管理的所有web资源:例如Jsp, Servlet, 静态 ...

  9. 滑动控件-FlipView

    <Grid>            <FlipView>                <FlipView.Items>                    &l ...

  10. 解决:error: .repo/manifests/: contains uncommitted changes

    repo sync同步时提示出错:          error: .repo/manifests/: contains uncommitted changes 解决方法: 1.cd 进入.repo/ ...