解题报告
题目传送门
题意:
n只地鼠,m个洞,老鹰的到达地面的时间s,地鼠的移动速度v,求多少只地鼠会被老鹰吃了。
思路:
地鼠和洞看成两集合,建立二分图。只有当地鼠到洞的时间少于老鹰到地面的时间才连边。
#include
#include
#include
#include
using namespace std;
int n,m,s,v,mmap[500][500],v...
分类:
其他好文 时间:
2014-07-27 11:23:02
阅读次数:
240
汉诺塔II
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 4799 Accepted Submission(s): 2362
Problem Description
经典的汉诺塔问题经常作为一个递归的经典例...
分类:
其他好文 时间:
2014-07-27 11:15:52
阅读次数:
209
题目:Follow up for N-Queens problem.Now, instead outputting board configurations, return the total number of distinct solutions.题解:这道题跟NQueens的解法完全一样(具....
分类:
编程语言 时间:
2014-07-27 11:00:42
阅读次数:
241
一、下载工具Html Help worksshop二、安装并打开三、文件-》新建:方案四、编辑 1)目录创建新的目录 a) 插入文件夹或文件。 I)文件夹可以有关联的网页,也可以没有。 II)文件必须有关联的网页。 b) 编辑 c) 删除 2) 关联...
分类:
其他好文 时间:
2014-07-27 10:46:22
阅读次数:
200
题目:Given an array of integers, every element appears three times except for one. Find that single one.Note:Your algorithm should have a linear runtim....
分类:
编程语言 时间:
2014-07-27 10:46:02
阅读次数:
294
im=imread('C:\Documents and Settings\Administrator\桌面\2.jpg');Subplot(231);imshow(im);title('原始图像');ii=rgb2gray(im);%ii=im2double(ii);Subplot(232);ims...
分类:
其他好文 时间:
2014-07-27 09:43:42
阅读次数:
475
题意:一个机器人在n * m的网格里面捡垃圾,机器人只能向右或向下走,求出能捡到的垃圾数量的最大值,有多少条路径可以达到最大值,以及输出其中一条路径。
思路:按照题意可以看出,因为机器人只能向右和向下走,所以纵坐标就不重要的,而横坐标是递增的。当将所有拥有垃圾的格子经过计算得到它的一维值(唯一的),得到一组的数组。那就可以转化为求最长上升子序列。但这个LIS的条件是mod(m)要大于前一...
分类:
其他好文 时间:
2014-07-26 17:22:22
阅读次数:
282
Compared with I version, the tree could be incomplete. The only difference is that, we connect current node's child to next non-childrenless' node's f...
分类:
其他好文 时间:
2014-07-26 17:02:11
阅读次数:
316
Leetcode Combination Sum II,略有疑惑求讨论...
分类:
其他好文 时间:
2014-07-26 15:30:12
阅读次数:
155
Problem DescriptionPermutation plays a very important role in Combinatorics. For example ,1 2 3 4 5 and 1 3 5 4 2 are both 5-permutations. As everyone...
分类:
其他好文 时间:
2014-07-26 14:15:48
阅读次数:
237