hdu 1050 (preinitilization or postcleansing, std::fill)
来源:互联网 发布:用python编写99乘法表 编辑:程序博客网 时间:2024/06/13 15:56
errors, clauses in place, logical ones, should be avoided.
#include <cstdio>#include <cstring>#include <algorithm>int main() { //freopen("input.txt","r",stdin); const int CorNum=201; int ncase, npair, to,from, first,last, res; int shared[CorNum]={0}; if(scanf("%d",&ncase)!=1) return -1; while(ncase-- && scanf("%d",&npair)==1) { first=CorNum, last=0; while(npair--) { scanf("%d%d",&from,&to); from=(from-1)>>1; to=(to-1)>>1; if(from>to) std::swap(from,to); first=std::min(first,from); last=std::max(last,to); for(;from<=to;++from) ++shared[from]; } for(res=0,from=first;from<=last;++from) res=std::max(res,shared[from]); std::fill(&shared[first],&shared[last+1],0); printf("%d\n",res*10); } return 0;}
0 0
- hdu 1050 (preinitilization or postcleansing, std::fill)
- 1033. To Fill or Not to Fill
- 1033. To Fill or Not to Fill
- 1033. To Fill or Not to Fill
- To Fill or Not to Fill
- 1033. To Fill or Not to Fill
- 1033. To Fill or Not to Fill
- pat1033To Fill or Not to Fill (25)
- 1033. To Fill or Not to Fill
- 1033. To Fill or Not to Fill
- *1033. To Fill or Not to Fill
- 1033. To Fill or Not to Fill
- To Fill or Not to Fill
- PAT_1033. To Fill or Not to Fill
- C++中std::fill/std::fill_n的使用
- To Fill or Not to Fill (九度贪心题目)
- 题目25:To Fill or Not to Fill
- 1033. To Fill or Not to Fill (25)
- html的编辑器 sublimetext2的使用及插件安装
- 认识自己——我的恐惧和悲观
- Android-对话框
- ThinkPHP 使用 PHPMaileer
- logger框架
- hdu 1050 (preinitilization or postcleansing, std::fill)
- MFC复习
- JFinal功能浅析
- 一元线性回归模型与最小二乘法及其C++实现
- LinkedIn Cubert安装指南
- Java程序员的好工具:通过json生成javabean(pojo)
- win7下获取进程CPU,内存,IO等信息
- Magento 在 Onepage Checkout 页面添加自定义 Fields
- android布局学习--嵌套布局