POJ 1083(水题)
来源:互联网 发布:华为p9 plus优化 编辑:程序博客网 时间:2024/06/06 04:46
一开始思路错了,用个数组装corridor,找最大的,就是交集。
poj的分类的水题,都做这么长时间,自己太菜了。。。
代码如下
#include<cstdio>#include<iostream>#include<algorithm>#include<cstring>using namespace std;int main(){int T;scanf("%d",&T);while(T--){int a[205];memset(a,0,sizeof(a));int n;scanf("%d",&n);for(int i=0;i<n;i++){int s,t;scanf("%d %d",&s,&t);int mi=min(s,t), ma=max(s,t);if(mi%2==1) mi++;if(ma%2==1) ma++;for(int i=mi/2;i<=(ma/2);i++)a[i]++;}int maxn=-1;for(int i=1;i<=200;i++) maxn=max(maxn,a[i]);printf("%d\n",maxn*10);} }
阅读全文
0 0
- POJ 1083(水题)
- POJ 1083 Moving Tables(水题)
- POJ 1083 Moving Tables (水题)
- POJ 1083 水题
- POJ 2027(水题)
- poj 3829(水题)
- POJ 1663(水题)
- POJ 1003 (水题)
- POJ 1250 (水题)
- POJ 1493(水题)
- POJ 3673(水题)
- poj 3006(水题)
- poj 1083 & poj 1328
- Moving Tables(POJ 1083)
- poj 2000 水题(JAVA)
- POJ 1837(Dp水题)
- POJ 3299 Humidex(水题)
- POJ 1003 Hangover (水题)
- mysql cluster
- Android中RadioGroup的多行多列,以及互斥监听
- 028_实战EXE和SYS通信-28课(缓冲模式)_exe_控制台
- 图像处理基本算法 车牌识别与定位
- javascript——移动端input,textarea输入框获得焦点页面上移
- POJ 1083(水题)
- c++电话薄
- QT学习笔记(1)
- 名企笔试:2016网易笔试题(奖学金)2017-05-12 算法爱好者
- springboot 添加静态页面
- 激光雷达学习笔记(一)数据采集
- 通过jQuery动态提交表单,解决一些避免get方式传值问题
- Redis源码剖析和注释(二十二)--- Redis 复制(replicate)源码详细解析
- Android对返回键进行处理的方式