摘要:
这是Titan Ruins系列第一道题,以后慢慢更新。赤裸裸滴阅读理解题,大意就是找到三个连在一起的数,使其之和最大,输出的第一个数是这三个数的和,第二个数是中间那个数所在的位置。水题一道,很简单。 1 #include <iostream> 2 #include <vector> 3 using namespace std; 4 int main() 5 { 6 int n; 7 cin >> n; 8 int *a = new int[n+1]; 9 for (int i = 1; i <= n; ++i)10 cin >> a[i]; 阅读全文
posted @ 2013-04-20 17:10
PegasusWang
阅读(459)
评论(0)
推荐(0)
摘要:
第一次写这种题,参考一下网上的代码。 1 #include <iostream> 2 #include <cstring> 3 #include <cstdio> 4 #include <queue> 5 int dir[][2] = {{-1,0}, {0,1}, {1,0}, {0,-1}}; //四个方向 6 int n, m; 7 const int MAXN = 105; 8 struct Node 9 {10 int x, y, time;11 friend bool operator<(Node a, Node b) //重载 阅读全文
posted @ 2013-04-20 15:04
PegasusWang
阅读(178)
评论(0)
推荐(0)
摘要:
今天又重新回顾了一下忘得差不多的并查集:下边是转的,再加上一道hdu的并查集入门题。文章作者:yx_th000文章来源:Cherish_yimi(http://www.cnblogs.com/cherish_yimi/) 转载请注明,谢谢合作。 [本文新址:http://www.ahathinking.com/archives/10.html]昨天和今天学习了并查集和trie树,并练习了三道入门题目,理解更为深刻,觉得有必要总结一下,这其中的内容定义之类的是取自网络,操作的说明解释及程序的注释部分为个人理解。并查集学习:l并查集:(union-find sets)一种简单的用途广泛的集合. 并 阅读全文
posted @ 2013-04-20 00:02
PegasusWang
阅读(599)
评论(0)
推荐(1)
浙公网安备 33010602011771号