理解:区域覆盖。注意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. 关于laravel基础知识

    laravel任务管理知识点 1.配置数据库环境 首先要找到congif/app.php,在这里会发现一些全局的系统设置,包括语言,时区等. 重要的是会发现前几个数组都使用了env()这个函数,这个时 ...

  2. Swift语言学习

    因为想要学Mac os x编程,中文教材太少了,看了很多厉害的英文教材,很多都是swift语言的了,所以决定先要大体学一下swift语言. 学习一门语言,第一件事看swift官方文档,这里附上Coco ...

  3. SmallPtAMP: C++ AMP implementation of SmallPt / SmallPtGPU

    前段时间突然对SmallPtGPU很感兴趣,于是自己也照葫芦画瓢搞了一个C++AMP的版本,整体跟SmallPtGPU基本相同,但是去掉了SmallPtGPU中显式计算直接光照的步骤,因而实现更加接近 ...

  4. SQL Server 常用关键字

    SQL 建库 建表 --1.创建一个数据库 create database School; --删除数据库 drop database School; --创建数据库的时候指定一些选项. create ...

  5. cosbench 异常 FreeMarker template error: The following has evaluated to null or missing

    问题现象: 使用Cosbench 0.4.2.c4 版本测试Ceph RGW read test失败,遇到异常如下: FreeMarker template error: The following ...

  6. Java static 静态代码块执行分析

    假设有这样一个类: public class Utils { static { Log.i("static","isLoad!"); } public stat ...

  7. 关于SVN 目录结构

    Subversion有一个很标准的目录结构,是这样的.比如项目是proj,svn地址为svn://proj/,那么标准的svn布局是 svn://proj/   |   +-trunk   +-bra ...

  8. python中引入包的时候报错AttributeError: module 'sys' has no attribute 'setdefaultencoding'解决方法?

    python中引入包的时候报错:import unittestimport smtplibimport timeimport osimport sysimp.reload(sys)sys.setdef ...

  9. gulp-rev-collector自定义修改rev-manifest.json后替换不成功的问题分析

    由于项目需要,我要把common.js替换成build.min.js,接着后面才用到build.min.js=>build-te234ds.min.js这样的形式替换,但是我发现怎么替换都不能把 ...

  10. Alpha阶段第三次Scrum Meeting

    情况简述 Alpha阶段第三次Scrum Meeting 敏捷开发起始时间 2016/10/24 00:00 敏捷开发终止时间 2016/10/25 00:00 会议基本内容摘要 总结了之前学习的内容 ...