2012年9月30日

SRM 556 DIV2

摘要: 1、我去,这个竟然是前两天百度的面试题,不是最优就挂掉,看来面试官也在网上搜新题啊。#include <iostream>#include <queue>#include <algorithm>#include <vector>using namespace std;class ChocolateBar {public: int maxLength(string letters) { int res = 0; vector<int> last(256,-1); int l_size = letters.size(); int cur. 阅读全文

posted @ 2012-09-30 16:07 kakamilan 阅读(193) 评论(0) 推荐(0) 编辑

2012年9月20日

螺旋输出N*N矩阵

摘要: 1 #include <iostream> 2 #include <vector> 3 using namespace std; 4 int main() { 5 int x[] = { 0, 1, 0, -1 }; 6 int y[] = { 1, 0, -1, 0 }; 7 int n; 8 int pos_x = 0; 9 int pos_y = 0;10 cin >> n;11 int counter = 1;12 vector<vector<int> > A(n, vector<int>(n, 0));13 i. 阅读全文

posted @ 2012-09-20 21:30 kakamilan 阅读(330) 评论(0) 推荐(0) 编辑

2012年9月8日

SRM 555 DIV2

摘要: 第一次做出来第二道题,真不容易啊第一道题比较水,穷举各种情况就可以了 1 #include <iostream> 2 #include <string> 3 #include <vector> 4 #include <cstdlib> 5 #include <cmath> 6 #include <map> 7 #include <algorithm> 8 #include <list> 9 #include <ctime> 10 #include <set> 11 #incl 阅读全文

posted @ 2012-09-08 23:43 kakamilan 阅读(181) 评论(0) 推荐(0) 编辑

2012年8月24日

pagerank 算法入门

摘要: http://blog.csdn.net/midgard/article/details/7061721这篇文章很不错。 1 #include <vector> 2 #include <set> 3 #include <string> 4 #include <iostream> 5 6 using namespace std; 7 8 // use graph store webpage, weight representlink times 9 class Node {10 public:11 explicit Node(string name 阅读全文

posted @ 2012-08-24 15:11 kakamilan 阅读(339) 评论(0) 推荐(0) 编辑

2012年8月23日

SRM 553 DIV2

摘要: 第三次出现二分法了,崩溃,还是当时没有想到,伤不起啊第一个很简单,解方程的题。 1 #include <iostream> 2 #include <string> 3 #include <vector> 4 #include <cstdlib> 5 #include <cmath> 6 #include <map> 7 #include <algorithm> 8 #include <list> 9 #include <ctime>10 #include <set>11 #i 阅读全文

posted @ 2012-08-23 16:10 kakamilan 阅读(190) 评论(0) 推荐(0) 编辑

2012年8月19日

修改网页排名

摘要: 很久以前就听说过“竞价排名”,今天基于TSE也写了一个自己理解的竞价排名雏形,满有意思的。现在必须手动加入排名靠前的url。要在CQuery模块中加入一个方法 1 bool CQuery::Get_url_weight(set<string>& weight_set) const { 2 ifstream ifs(Url_Weight_NAME.c_str(), ios::binary); 3 if (!ifs) { 4 cerr << "Cannot open " << Url_Weight_NAME << &quo 阅读全文

posted @ 2012-08-19 14:32 kakamilan 阅读(246) 评论(0) 推荐(0) 编辑

2012年8月17日

srm537 div1-3 最小费用最大流

摘要: 看了很多人讲解的最小费用最大流,但是讲的都太不清楚了,感觉还是这个清楚http://www.strongczq.com/2012/03/srm537-div1-3-princexdominoes.html看了一个星期,把其中的各种变量都拆了出来,终于把最小费用最大流的各种细节明白了,我认为理解这个算法的还是理解剩余网络 1 #include <iostream> 2 #include <string> 3 #include <vector> 4 #include <cstdlib> 5 #include <cmath> 6 #incl 阅读全文

posted @ 2012-08-17 16:46 kakamilan 阅读(357) 评论(0) 推荐(0) 编辑

SRM 552 DIV2

摘要: 比较悲催,第二道题没调出来,被long long的乘法越界坑了。第一道题比较水一些,求四个矩阵中的F数目 1 #include <iostream> 2 #include <string> 3 #include <vector> 4 #include <cstdlib> 5 #include <cmath> 6 #include <map> 7 #include <algorithm> 8 #include <list> 9 #include <ctime>10 #include < 阅读全文

posted @ 2012-08-17 15:46 kakamilan 阅读(191) 评论(0) 推荐(0) 编辑

2012年8月11日

最大流算法

摘要: 链接http://www.cnblogs.com/longdouhzt/archive/2012/05/20/2510753.html 1 #include <iostream> 2 #include <string> 3 #include <vector> 4 #include <cstdlib> 5 #include <cmath> 6 #include <map> 7 #include <algorithm> 8 #include <list> 9 #include <ctime> 阅读全文

posted @ 2012-08-11 22:21 kakamilan 阅读(265) 评论(0) 推荐(0) 编辑

Bellman-Ford算法到SPFA算法

摘要: 引用链接http://www.cnblogs.com/north_dragon/archive/2010/05/30/1747697.html http://www.cnblogs.com/AbandonZHANG/archive/2012/07/26/2610833.html 1 #include <iostream> 2 #include <string> 3 #include <vector> 4 #include <cstdlib> 5 #include <cmath> 6 #include <map> 7 #in 阅读全文

posted @ 2012-08-11 14:54 kakamilan 阅读(298) 评论(0) 推荐(0) 编辑

导航