给出K*K的矩阵,每一行取一个数,构成K个数的和,总共有 k^k种可能,从中取出前k个最小的。一开始犯了错,因为只要对每行排序,最小的必定是第一列的和,然后我当时就想着,逐步推进,每次将某行的那个数变成其下一列那个数,当然间距要最小。我这样明显是不对的,这样的话每个数只用了一次,而题目的意思明显是可...
分类:
其他好文 时间:
2014-07-07 20:58:44
阅读次数:
188
一个单词单词字母交换,可得另一个单词,如army->mary,成为兄弟单词。提供一个单词,在字典中找到它的兄弟。描述数据结构和查询过程。#include #include #include using namespace std;void add(unsigned int count[],char ...
分类:
其他好文 时间:
2014-07-07 20:57:31
阅读次数:
244
一、如何用AJAX调用JsonResult方法比如FuckController中添加有个返回JsonResult类型的方法FuckJson():public JsonResult FuckJson(){ return new JsonResult() { Data = n...
分类:
Web程序 时间:
2014-07-07 20:53:31
阅读次数:
367
After a perfect inning from Farnsworth in the eighth, the Yankees would have Alex Rodriguez coming to the plate to lead off the inning. Guillen left C...
分类:
其他好文 时间:
2014-07-07 20:49:01
阅读次数:
260
最简单的迭代器: 1 a=$i*3;20 $a->b=$i*4;21 $a->c=$i*5;22 $this->_items[]=$a;23 }24 }25 26 27 28 // ...
分类:
其他好文 时间:
2014-07-07 20:39:14
阅读次数:
161
/////////////////////////////////////////////////////////////////////////////////// FileName : bool_value.cc// Version : 0.10 created ...
分类:
其他好文 时间:
2014-07-07 20:32:46
阅读次数:
143
#include using namespace std;int main(){#if 0 //devide by 0 int i = 1; int j = 0; double d = i/j;#endif #if 1 //allocate large memor...
分类:
其他好文 时间:
2014-07-07 20:29:40
阅读次数:
181
1.http://www.kernel.org,linux内核(源码)下载2.http://www.oldlinux.org/index_cn.html,《Linux内核0.11(0.95)完全注释》3.书籍列表:101-深入理解Linux内核(第三版 英文版)-1030页.pdf102-深入分析L...
分类:
系统相关 时间:
2014-07-07 20:26:59
阅读次数:
333
通过做这题,发现了自己的问题很大,做题不是贴代码,而是要了解思想;这题考的是有一个起点的集合,求起点集合到一个终点的最短距离,本来想用Floy的但一看map[1000][1000]超时,有向图,逆序建邻接矩阵,这样就成了一个终点到所有点的最短路了。 1 #include 2 #include ...
分类:
其他好文 时间:
2014-06-29 18:40:11
阅读次数:
170