随笔分类 -  线段树 & 树状数组 & RMQ

摘要:JapanTime Limit:1000MSMemory Limit:65536KTotal Submissions:16682Accepted:4467DescriptionJapan plans to welcome the ACM ICPC World Finals and a lot of roads must be built for the venue. Japan is tall island with N cities on the East coast and M cities on the West coast (M <= 1000, N <= 1000). K 阅读全文
posted @ 2013-04-24 09:37 Jack Ge 阅读(521) 评论(0) 推荐(0)
摘要:Buy TicketsTime Limit:4000MSMemory Limit:65536KTotal Submissions:9712Accepted:4679DescriptionRailway tickets were difficult to buy around the Lunar New Year in China, so we must get up early and join a long queue…The Lunar New Year was approaching, but unluckily the Little Cat still had schedules go 阅读全文
posted @ 2013-04-24 09:20 Jack Ge 阅读(274) 评论(0) 推荐(0)
摘要:PictureTime Limit:2000MSMemory Limit:10000KTotal Submissions:9024Accepted:4762DescriptionA number of rectangular posters, photographs and other pictures of the same shape are pasted on a wall. Their sides are all vertical or horizontal. Each rectangle can be partially or totally covered by the other 阅读全文
posted @ 2013-04-24 09:03 Jack Ge 阅读(383) 评论(0) 推荐(0)
摘要:AtlantisTime Limit:1000MSMemory Limit:10000KTotal Submissions:13873Accepted:5339DescriptionThere are several ancient Greek texts that contain descriptions of the fabled island Atlantis. Some of these texts even include maps of parts of the island. But unfortunately, these maps describe different reg 阅读全文
posted @ 2013-04-24 08:35 Jack Ge 阅读(596) 评论(0) 推荐(0)
摘要:Mobile phonesTime Limit:5000MSMemory Limit:65536KTotal Submissions:12238Accepted:5617DescriptionSuppose that the fourth generation mobile phone base stations in the Tampere area operate as follows. The area is divided into squares. The squares form an S * S matrix with the rows and columns numbered 阅读全文
posted @ 2013-04-24 07:31 Jack Ge 阅读(289) 评论(0) 推荐(0)
摘要:MatrixTime Limit:3000MSMemory Limit:65536KTotal Submissions:14123Accepted:5337DescriptionGiven an N*N matrix A, whose elements are either 0 or 1. A[i, j] means the number in the i-th row and j-th column. Initially we have A[i, j] = 0 (1 1、1->0,Q:(x,y)就是问这个点是什么。#include#include#includeusing namesp 阅读全文
posted @ 2013-04-23 23:18 Jack Ge 阅读(388) 评论(0) 推荐(0)
摘要:FlowersTime Limit: 4000/2000 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1733Accepted Submission(s): 858Problem DescriptionAs is known to all, the blooming time and duration varies between different kinds of flowers. Now there is a garden planted full of flowers. Th 阅读全文
posted @ 2013-04-23 23:03 Jack Ge 阅读(272) 评论(0) 推荐(0)
摘要:QueryTime Limit: 20000/10000 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1922Accepted Submission(s): 654Problem DescriptionYou are given two strings s1[0..l1], s2[0..l2] and Q - number of queries.Your task is to answer next queries:1) 1 a i c - you should set i-th c 阅读全文
posted @ 2013-04-23 19:57 Jack Ge 阅读(249) 评论(0) 推荐(0)
摘要:Who Gets the Most Candies?Time Limit:5000MSMemory Limit:131072KTotal Submissions:7388Accepted:2184Case Time Limit:2000MSDescriptionNchildren are sitting in a circle to play a game.The children are numbered from 1 toNin clockwise order. Each of them has a card with a non-zero integer on it in his/her 阅读全文
posted @ 2013-04-23 19:33 Jack Ge 阅读(2101) 评论(0) 推荐(0)
摘要:Stars in Your WindowTime Limit:1000MSMemory Limit:65536KTotal Submissions:8175Accepted:2246DescriptionFleeting time does not blur my memory of you. Can it really be 4 years since I first saw you? I still remember, vividly, on the beautiful Zhuhai Campus, 4 years ago, from the moment I saw you smile, 阅读全文
posted @ 2013-04-23 09:50 Jack Ge 阅读(957) 评论(0) 推荐(0)
摘要:Sequence operationTime Limit: 10000/5000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4357Accepted Submission(s): 1256Problem Descriptionlxhgww got a sequence contains n characters which are all '0's or '1's.We have five operations here:Change operati 阅读全文
posted @ 2013-04-23 09:05 Jack Ge 阅读(425) 评论(0) 推荐(0)
摘要:A Simple Problem with IntegersTime Limit:5000MSMemory Limit:131072KTotal Submissions:41842Accepted:12156Case Time Limit:2000MSDescriptionYou haveNintegers,A1,A2, ... ,AN. You need to deal with two kinds of operations. One type of operation is to add some given number to each number in a given interv 阅读全文
posted @ 2013-04-17 17:57 Jack Ge 阅读(465) 评论(0) 推荐(0)
摘要:SubsequenceTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3132Accepted Submission(s): 1020Problem DescriptionThere is a sequence of integers. Your task is to find the longest subsequence that satisfies the following condition: the difference betwe 阅读全文
posted @ 2013-04-15 18:22 Jack Ge 阅读(267) 评论(0) 推荐(0)
摘要:Paint The WallTime Limit: 20000/10000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 120Accepted Submission(s): 22Problem DescriptionAs a amateur artist, Xenocide loves painting the wall. The wall can be considered as a line consisting of n nodes. Each node has its ow 阅读全文
posted @ 2013-04-11 13:40 Jack Ge 阅读(347) 评论(0) 推荐(0)
摘要:Lost CowsTime Limit : 2000/1000ms (Java/Other)Memory Limit : 131072/65536K (Java/Other)Total Submission(s) : 4Accepted Submission(s) : 1Problem DescriptionN (2 #include#includeusing namespace std;const int N=8010;#define L(rt) (rt>1; build(L,mid,L(rt)); build(mid+1,R,R(rt));}int query(int id,i... 阅读全文
posted @ 2013-03-26 23:05 Jack Ge 阅读(1036) 评论(0) 推荐(0)
摘要:BillboardTime Limit: 20000/8000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5951Accepted Submission(s): 2707Problem DescriptionAt the entrance to the university, there is a huge rectangular billboard of size h*w (h is its height and w is its width). The board is the 阅读全文
posted @ 2013-03-10 12:42 Jack Ge 阅读(228) 评论(0) 推荐(0)
摘要:Minimum Inversion NumberTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5950Accepted Submission(s): 3625Problem DescriptionThe inversion number of a given number sequence a1, a2, ..., an is the number of pairs (ai, aj) that satisfy i < j and ai 阅读全文
posted @ 2013-03-10 12:17 Jack Ge 阅读(229) 评论(0) 推荐(0)
摘要:Just a Hookhttp://acm.hdu.edu.cn/showproblem.php?pid=1698Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 10448 Accepted Submission(s): 5161 Problem DescriptionIn the game of DotA, Pudge’s meat hook is actually the most horrible thing for most of 阅读全文
posted @ 2013-01-06 10:44 Jack Ge 阅读(233) 评论(0) 推荐(0)
摘要:Billboardhttp://acm.hdu.edu.cn/showproblem.php?pid=2795Time Limit: 20000/8000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 5633 Accepted Submission(s): 2580 Problem DescriptionAt the entrance to the university, there is a huge rectangular billboard of size h*w (h i 阅读全文
posted @ 2013-01-06 10:22 Jack Ge 阅读(215) 评论(0) 推荐(0)
摘要:Mobile phoneshttp://poj.org/problem?id=1195Time Limit: 5000MSMemory Limit: 65536KTotal Submissions: 11696Accepted: 5369DescriptionSuppose that the fourth generation mobile phone base stations in the Tampere area operate as follows. The area is divided into squares. The squares form an S * S matrix w 阅读全文
posted @ 2013-01-04 13:17 Jack Ge 阅读(210) 评论(0) 推荐(0)