上一页 1 2 3 4 5 6 7 8 9 10 ··· 14 下一页

2013年10月6日

HDU 1024 Max Sum Plus

摘要: Max Sum Plus PlusTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 13897Accepted Submission(s): 4569Problem DescriptionNow I think you have got an AC in Ignatius.L's "Max Sum" problem. To be a brave ACMer, we always challenge ourselves 阅读全文

posted @ 2013-10-06 21:14 天使是一个善良的神 阅读(188) 评论(0) 推荐(0) 编辑

HDU 1024 Max Sum Plus Plus

摘要: Max Sum Plus PlusTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 13897Accepted Submission(s): 4569Problem DescriptionNow I think you have got an AC in Ignatius.L's "Max Sum" problem. To be a brave ACMer, we always challenge ourselves 阅读全文

posted @ 2013-10-06 21:06 天使是一个善良的神 阅读(202) 评论(0) 推荐(0) 编辑

HDU 1698 Just a Hook

摘要: Just a HookTime Limit: 4000/2000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 13564Accepted Submission(s): 6755Problem DescriptionIn the game of DotA, Pudge’s meat hook is actually the most horrible thing for most of the heroes. The hook is made up of several consecu 阅读全文

posted @ 2013-10-06 18:53 天使是一个善良的神 阅读(285) 评论(0) 推荐(0) 编辑

2013年10月5日

HDU 1049 Climbing Worm

摘要: Climbing WormTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 10288Accepted Submission(s): 6815Problem DescriptionAn inch worm is at the bottom of a well n inches deep. It has enough energy to climb u inches every minute, but then has to rest a minu 阅读全文

posted @ 2013-10-05 23:50 天使是一个善良的神 阅读(172) 评论(0) 推荐(0) 编辑

HDU 3386 Reversi

摘要: ReversiTime Limit: 5000/2000 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1065Accepted Submission(s): 435Problem DescriptionReversi, also called Othello, is a two-sided game.Each of the two sides corresponds to one player; they are referred to here as light and dark 阅读全文

posted @ 2013-10-05 21:11 天使是一个善良的神 阅读(377) 评论(0) 推荐(0) 编辑

树状数组总结

摘要: 树状数组总结问题:已知数组 a[],元素个数为n,现在更改数组中某些元素的值,求更改后a数组中i到j区间内元素的和(1= 1;i -= lowbit(i)) sum += c[i]; return sum;}例如:HDU 1556Color the ballTime Limit: 9000/3000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 6412Accepted Submission(s): 3385Problem DescriptionN个气球排成一排,从左... 阅读全文

posted @ 2013-10-05 19:38 天使是一个善良的神 阅读(227) 评论(0) 推荐(0) 编辑

HDU 1556 Color the ball

摘要: Color the ballTime Limit: 9000/3000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 6412Accepted Submission(s): 3385Problem DescriptionN个气球排成一排,从左到右依次编号为1,2,3....N.每次给定2个整数a b(a #include #include #include #include #include using namespace std;int map[100010];int n;int a 阅读全文

posted @ 2013-10-05 19:06 天使是一个善良的神 阅读(136) 评论(0) 推荐(0) 编辑

树形数组

摘要: 如果给定一个数组,要你求里面所有数的和,一般都会想到累加。但是当那个数组很大的时候,累加就显得太耗时了,时间复杂度为O(n),并且采用累加的方法还有一个局限,那就是,当修改掉数组中的元素后,仍然要你求数组中某段元素的和,就显得麻烦了。所以我们就要用到树状数组,他的时间复杂度为O(lgn),相比之下就快得多。下面就讲一下什么是树状数组: 一般讲到树状数组都会少不了下面这个图: 下面来分析一下上面那个图看能得出什么规律: 据图可知:c1=a1,c2=a1+a2,c3=a3,c4=a1+a2+a3+a4,c5=a5,c6=a5+a6,c7=a7,c8=a1+a2+a3+a4+a5+a6+a7... 阅读全文

posted @ 2013-10-05 17:26 天使是一个善良的神 阅读(331) 评论(0) 推荐(0) 编辑

HDU 1188 敌兵布阵

摘要: 敌兵布阵Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 32178Accepted Submission(s): 13823Problem DescriptionC国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数C国都掌握的一清二楚,每个工兵营地的人 阅读全文

posted @ 2013-10-05 00:14 天使是一个善良的神 阅读(176) 评论(0) 推荐(0) 编辑

2013年10月4日

ACM模板 线段树

摘要: //线段树的节点//节点包括两部分信息,基本域,和信息域//基本域:左右边界leftboundary,rightboundary. 左右孩子:liftchild,rightchild //信息域:value值,如RMQ问题中,信息域中存储的是区间最大值struct Node { int leftboundary,rightboundary; Node *leftchild,*rightchild; typedef value;};//空树的建立,内含value值的初始化;//一般在主函数中首先调用 Node* root= buildtree(1,n);建立一棵新树Node *buildtree 阅读全文

posted @ 2013-10-04 17:00 天使是一个善良的神 阅读(415) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 7 8 9 10 ··· 14 下一页

导航