摘要: A common pastime for poker players at a poker table is to shuffle stacks of chips. Shuffling chips is performed by starting with two stacks of poker c 阅读全文
posted @ 2017-08-08 14:10 euzmin 阅读(201) 评论(0) 推荐(0) 编辑
摘要: There is a strange lift.The lift can stop can at every floor as you want, and there is a number Ki(0 <= Ki <= N) on every floor.The lift have just two 阅读全文
posted @ 2017-08-08 13:45 euzmin 阅读(214) 评论(0) 推荐(0) 编辑
摘要: Rectangle frog has a piece of paper divided into nn rows and mm columns. Today, she would like to draw a rectangle whose perimeter is not greater than 阅读全文
posted @ 2017-08-06 17:02 euzmin 阅读(356) 评论(0) 推荐(0) 编辑
摘要: 1281: 邪能炸弹 题目描述 正在入侵艾泽拉斯的古尔丹偶然间得到了一颗邪能炸弹,经过研究,他发现这是一颗威力极其巨大且难以控制的炸弹。但是精通邪能的古尔丹突然有了一个大胆的想法,他对炸弹进行了一些小小的改造。这使得炸弹需要n天的充能才能爆炸,在这n天中,每天炸弹的邪能值都会产生波动,波动值为xi, 阅读全文
posted @ 2017-08-04 21:05 euzmin 阅读(221) 评论(0) 推荐(0) 编辑
摘要: ]Edward has an array A with N integers. He defines the beauty of an array as the summation of all distinct integers in the array. Now Edward wants to 阅读全文
posted @ 2017-08-03 21:32 euzmin 阅读(205) 评论(0) 推荐(0) 编辑
摘要: For an upcoming programming contest, Edward, the headmaster of Marjar University, is forming a two-man team from N students of his university. Edward 阅读全文
posted @ 2017-08-03 18:42 euzmin 阅读(239) 评论(0) 推荐(0) 编辑
摘要: A. Unimodal Array time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output A. Unimodal Array time 阅读全文
posted @ 2017-07-31 21:43 euzmin 阅读(269) 评论(0) 推荐(0) 编辑
摘要: A. The Meaningless Game time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output A. The Meaningles 阅读全文
posted @ 2017-07-31 16:32 euzmin 阅读(265) 评论(0) 推荐(0) 编辑
摘要: dijkstra的代码思想网上各路高手所述备矣。这里只是存下用邻接矩阵和邻接表实现的dijkstra。(白书代码) 邻接矩阵 1 void dijkstra(int s){ 2 int dis[s]=0; 3 while(1){ 4 int v=0; //从尚未使用过的顶点中选择一个距离最小的顶点 阅读全文
posted @ 2017-07-11 10:40 euzmin 阅读(259) 评论(0) 推荐(0) 编辑
摘要: 堆最重要的性质就是儿子的值一定不小于父亲的值。 堆的push与pop操作的时间复杂度都是O(logn) 堆也是二叉树,所以满足: 左儿子的编号是自己编号*2+1; 右儿子的编号是自己编号*2+2; (左儿子与右儿子没有对应的大小关系) 堆还是很好理解的,能理解树就能理解堆。 附代码: 1 int h 阅读全文
posted @ 2017-07-10 11:22 euzmin 阅读(157) 评论(0) 推荐(0) 编辑