DescriptionXX星有许多城市,城市之间通过一种奇怪的高速公路进行交流,每条SARS都对行驶在上面的Flycar限制了固定的Speed,同时XX星人对 Flycar的“舒适度”有特殊要求,即乘坐过程中最高速度与最低速度的差越小乘坐越舒服 ,但XX星人对时间却没那么多要求。要你找出一条城市间的...
分类:
其他好文 时间:
2014-08-13 03:29:25
阅读次数:
261
二维 map map >map.find(x) 查找,如果没有返回值是 map.end()bool(map[x]) 查找,但是一旦访问下标那么就会产生一个节点map.empty() 判空map.size() 大小
分类:
其他好文 时间:
2014-08-13 00:44:54
阅读次数:
206
题目链接题意 : 给你N,然后再给M个数,让你找小于N的并且能够整除M里的任意一个数的数有多少,0不算。思路 :用了容斥原理 :ans = sum{ 整除一个的数 } - sum{ 整除两个的数 } + sum{ 整除三个的数 }………………所以是奇加偶减,而整除 k 个数的数可以表示成 lcm(A...
分类:
其他好文 时间:
2014-08-13 00:34:54
阅读次数:
336
// 0-1背包问题的普通递归算法#include #define M 10int w[M]={5,3,2,1},v[M]={4,4,3,1};int limit_w=7,maxv=0,n=4; void find(int i,int tw,int tv) //从第i种物品开始,当前已有的...
分类:
其他好文 时间:
2014-08-12 21:24:54
阅读次数:
173
Description
YH gave Qz an odd matrix consists of one or zero. He asked Qz to find a square that has the largest area. The problem is not so easy, that means the square you find must not contai...
分类:
其他好文 时间:
2014-08-12 19:11:04
阅读次数:
208
http://acm.hdu.edu.cn/showproblem.php?pid=4941
比赛的时候现学的map的find...以前都是用下标做的,但是map用下标查询的话,如果查询的元素不存在,会插入一个新的元素。
贴一个map查找元素找到和找不到的模板
map,int>::iterator it=poshash.find(tmppos);//pai...
分类:
其他好文 时间:
2014-08-12 19:09:24
阅读次数:
262
find 命令eg:一般文件查找方法:1. find /home -name file , 在/home目录下查找文件名为file的文件2. find /home -name '*file*' , 在/home目录下查找文件名包含file的文件3. find /home -name 'file*' ...
分类:
系统相关 时间:
2014-08-12 18:37:24
阅读次数:
270
$('.F_box_2').hover( function(){ $(this).find(".make_reply").css({"color":"#c00","text-decoration":"underline","background-position":"12px -147px"}); ...
分类:
其他好文 时间:
2014-08-12 18:29:54
阅读次数:
189
Given an array of integers, every element appears twice except for one. Find that single one.Note:Your algorithm should have a linear runtime complexi...
分类:
其他好文 时间:
2014-08-12 18:29:14
阅读次数:
231
Given an array of integers, every element appears three times except for one. Find that single one.Note:Your algorithm should have a linear runtime co...
分类:
其他好文 时间:
2014-08-12 18:26:14
阅读次数:
280