数据结构
文章平均质量分 70
tokers
所有的魅力在“习惯”面前都将无色。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
POJ2492---A Bug's Life
A Bug's LifeTime Limit: 10000MS Memory Limit: 65536KTotal Submissions: 29209 Accepted: 9528DescriptionBackgroundProfessor Hopper is researching the sexual behavio原创 2015-01-22 13:36:54 · 1252 阅读 · 0 评论 -
Codeforces Beta Round #57 (Div. 2)E---Enemy is weak(树状数组+离散化)
The Romans have attacked again. This time they are much more than the Persians but Shapur is ready to defeat them. He says: “A lion is never afraid of a hundred sheep”.Nevertheless Shapur has to find w原创 2015-03-23 21:22:22 · 984 阅读 · 0 评论 -
POJ3321---Apple Tree(树状数组)
DescriptionThere is an apple tree outside of kaka’s house. Every autumn, a lot of apples will grow in the tree. Kaka likes apple very much, so he has been carefully nurturing the big apple tree.The tre原创 2015-03-05 16:39:24 · 1079 阅读 · 0 评论 -
hdu4267---A Simple Problem with Integers(线段树)
Problem Description Let A1, A2, … , AN be N elements. You need to deal with two kinds of operations. One type of operation is to add a given number to a few numbers in a given interval. The other is t原创 2015-02-26 21:05:27 · 944 阅读 · 0 评论 -
hdu5172---GTY's gay friends
Problem Description GTY has n gay friends. To manage them conveniently, every morning he ordered all his gay friends to stand in a line. Every gay friend has a characteristic value ai , to express how原创 2015-02-14 13:26:20 · 1850 阅读 · 0 评论 -
POJ3074----Sudoku
SudokuTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 8575 Accepted: 3074DescriptionIn the game of Sudoku, you are given a large 9 × 9 grid divided into原创 2015-01-06 19:53:54 · 970 阅读 · 0 评论 -
POJ1733---Parity game
Parity gameTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 6595 Accepted: 2562DescriptionNow and then you play the following game with your friend. Your f原创 2015-01-22 22:34:47 · 1014 阅读 · 0 评论 -
hdu5176---The Experience of Love
Problem Description A girl named Gorwin and a boy named Vivin is a couple. They arrived at a country named LOVE. The country consisting of N cities and only N−1 edges (just like a tree), every edge ha原创 2015-02-14 21:34:46 · 1000 阅读 · 0 评论 -
hdu3911---Black And White
Black And White Time Limit: 9000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 3971 Accepted Submission(s): 1183Problem Description There are a bunch of原创 2015-02-21 14:19:23 · 1093 阅读 · 0 评论 -
Codeforces Beta Round #75 (Div. 1 Only)---B.Queue
There are n walruses standing in a queue in an airport. They are numbered starting from the queue’s tail: the 1-st walrus stands at the end of the queue and the n-th walrus stands at the beginning of t原创 2015-03-24 20:10:14 · 1120 阅读 · 0 评论 -
Codeforces Round #291 (Div. 2)---C. Watto and Mechanism
Watto, the owner of a spare parts store, has recently got an order for the mechanism that can process strings in a certain way. Initially the memory of the mechanism is filled with n strings. Then the原创 2015-02-15 13:34:02 · 1642 阅读 · 0 评论 -
hdu3038--How Many Answers Are Wrong
How Many Answers Are WrongTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2829 Accepted Submission(s): 1084Problem DescriptionTT原创 2015-01-21 23:03:23 · 857 阅读 · 0 评论 -
POJ1177----Picture
PictureTime Limit: 2000MS Memory Limit: 10000KTotal Submissions: 10727 Accepted: 5662DescriptionA number of rectangular posters, photographs and other pictures of t原创 2015-01-15 16:23:45 · 1125 阅读 · 0 评论 -
hdu1255-----覆盖的面积
覆盖的面积Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3870 Accepted Submission(s): 1906Problem Description给定平面上若干矩形,求出被这些矩形覆盖过至少两原创 2015-01-15 19:27:56 · 853 阅读 · 0 评论 -
hdu1542----Atlantis
AtlantisTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 7541 Accepted Submission(s): 3318Problem DescriptionThere are several anc原创 2015-01-15 14:54:02 · 786 阅读 · 0 评论 -
Codeforces Round #271 (Div. 2)——E. Pillars
E. Pillarstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputMarmot found a row with n pillars. The i-th pillar has th原创 2014-12-10 19:57:21 · 978 阅读 · 0 评论 -
ZOJ1610——Count the Colors
Count the ColorsTime Limit: 2 Seconds Memory Limit: 65536 KB Painting some colored segments on a line, some previously painted segments may be covered by some the subsequent ones.Your原创 2014-12-10 18:44:41 · 965 阅读 · 0 评论 -
FZU2136--取糖果 (线段树+RMQ)
Problem Description有N个袋子放成一排,每个袋子里有一定数量的糖果,lzs会随机选择连续的几个袋子,然后拿走这些袋子中包含最多糖果的袋子。现问你,在选择x个袋子的情况下,lzs最坏情况下,也就是最少会拿到多少个糖果?对于x取值为1到n都分别输出答案。 Input第一行一个整数T,表示有T组数据。每组数据先输入一行一个整数N(1<=N<=100000),表示袋子数,接下来一行输入N原创 2015-04-23 19:20:54 · 838 阅读 · 0 评论 -
hdu4825---Xor Sum(Trie + 贪心)
Problem Description Zeus 和 Prometheus 做了一个游戏,Prometheus 给 Zeus 一个集合,集合中包含了N个正整数,随后 Prometheus 将向 Zeus 发起M次询问,每次询问中包含一个正整数 S ,之后 Zeus 需要在集合当中找出一个正整数 K ,使得 K 与 S 的异或结果最大。Prometheus 为了让 Zeus 看到人类的伟大,随即同意原创 2015-05-25 14:59:25 · 1002 阅读 · 0 评论 -
hdu2227---Find the nondecreasing subsequences(dp+树状数组)
Problem Description How many nondecreasing subsequences can you find in the sequence S = {s1, s2, s3, …., sn} ? For example, we assume that S = {1, 2, 3}, and you can find seven nondecreasing subseque原创 2015-06-02 18:52:33 · 815 阅读 · 0 评论 -
hdu5249---KPI(二分+树状数组)
Problem Description 你工作以后, KPI 就是你的全部了. 我开发了一个服务,取得了很大的知名度。数十亿的请求被推到一个大管道后同时服务从管头拉取请求。让我们来定义每个请求都有一个重要值。我的KPI是由当前管道内请求的重要值的中间值来计算。现在给你服务记录,有时我想知道当前管道内请求的重要值得中间值。Input 有大约100组数据。每组数据第一行有一个n(1≤n≤10000)原创 2015-05-31 13:10:41 · 1024 阅读 · 0 评论 -
Codeforces Round #305 (Div. 2)D---Mike and Feet(单调栈)
Mike is the president of country What-The-Fatherland. There are n bears living in this country besides Mike. All of them are standing in a line and they are numbered from 1 to n from left to right. i-t原创 2015-05-27 20:09:25 · 1040 阅读 · 0 评论 -
Codeforces Round #227 (Div. 2)---E. George and Cards(贪心, 树状数组+set维护, 好题!)
George is a cat, so he loves playing very much.Vitaly put n cards in a row in front of George. Each card has one integer written on it. All cards had distinct numbers written on them. Let’s number the原创 2015-04-29 18:34:07 · 1086 阅读 · 0 评论 -
NOJ1560---Let Slimes Grow Up(线段树)
问题描述 You know 8Mao has his own Slime Team. But he soon found that let the Slimes stand in a line and make them from low to high is a such stupid thing since the Slimes are so f[bi][bi]king stupid! As原创 2015-04-16 21:05:31 · 835 阅读 · 0 评论 -
POJ3368---Frequent values(分组处理+RMQ)
Language: Frequent values Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 14377 Accepted: 5244DescriptionYou are given a sequence of n integers a1 , a2 , … , an in non-decreas原创 2015-04-24 15:16:50 · 795 阅读 · 0 评论 -
POJ3784---Running Median(树状数组+二分)
Description For this problem, you will write a program that reads in a sequence of 32-bit signed integers. After each odd-indexed value is read, output the median (middle value) of the elements receiv原创 2015-04-14 12:18:09 · 977 阅读 · 0 评论 -
hdu4553----约会安排
约会安排Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 402 Accepted Submission(s): 127Problem Description 寒假来了,又到了小明和女神们约会的季节。 小原创 2015-01-14 16:57:45 · 927 阅读 · 0 评论 -
SPOJ687---REPEATS - Repeats(后缀数组+RMQ)
A string s is called an (k,l)-repeat if s is obtained by concatenating k>=1 times some seed string t with length l>=1. For example, the strings = abaabaabaabais a (4,3)-repeat with t = aba as its seed原创 2015-04-07 19:43:33 · 968 阅读 · 0 评论 -
sdut2610---Boring Counting(离线+树状数组+离散化)
Boring Counting Time Limit: 3000ms Memory limit: 65536K 有疑问?点这里^_^ 题目描述 In this problem you are given a number sequence P consisting of N integer and Pi is the ith element in the sequence. No原创 2015-04-06 20:21:48 · 1187 阅读 · 1 评论 -
NBU1449---删除数字(加强版) (贪心+线段树优化)
Description在给定的n个数字的数字串中,删除其中k(k< n)个数字后,剩下的数字按原次序组成一个新的正整数。请确定删除方案,使得剩下的数字组成的新正整数最大。Input输入一个由n个数字组成的正整数(1< n<=100000),再输入一个整数k(0<=k < n),输入的数字保证没有前导0。Output输出删除k位后的最大整数Sample Input102 1Sample Output原创 2015-04-18 20:51:22 · 1005 阅读 · 0 评论 -
Codeforces Round #225 (Div. 2)---E. Propagating tree(时间戳+线段树)
Iahub likes trees very much. Recently he discovered an interesting tree named propagating tree. The tree consists of n nodes numbered from 1 to n, each node i having an initial value ai. The root of th原创 2015-04-22 11:14:38 · 1123 阅读 · 0 评论 -
Codeforces Round #170 (Div. 2)---C. Learning Languages(并查集)
The “BerCorp” company has got n employees. These employees can use m approved official languages for the formal correspondence. The languages are numbered with integers from 1 to m. For each employee w原创 2015-04-03 12:35:54 · 1238 阅读 · 0 评论 -
Codeforces Round #172 (Div. 2)---D. Maximum Xor Secondary(RMQ + 二分)
Bike loves looking for the second maximum element in the sequence. The second maximum element in the sequence of distinct numbers x1, x2, …, xk (k > 1) is such maximum element xj, that the following in原创 2015-04-03 14:17:50 · 1221 阅读 · 0 评论 -
Codeforces Round #296 (Div. 1)B---Clique Problem
The clique problem is one of the most well-known NP-complete problems. Under some simplification it can be formulated as follows. Consider an undirected graph G. It is required to find a subset of vert原创 2015-03-18 21:24:04 · 981 阅读 · 0 评论 -
POJ2236——Wireless Network
DescriptionAn earthquake takes place in Southeast Asia. The ACM (Asia Cooperated Medical team) have set up a wireless network with the lap computers, but an unexpected aftershock attacked, all compu原创 2014-09-03 13:46:55 · 546 阅读 · 0 评论 -
POJ3171——Cleaning Shifts
Cleaning ShiftsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 2813 Accepted: 976DescriptionFarmer John's cows, pampered since birth, have reached new hei原创 2014-12-16 20:50:34 · 1017 阅读 · 0 评论 -
POJ2528——Mayor's posters
Mayor's postersTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 44910 Accepted: 13059DescriptionThe citizens of Bytetown, AB, could not stand that the cand原创 2014-12-01 17:54:30 · 744 阅读 · 0 评论 -
hdu2795——Billboard
BillboardTime Limit: 20000/8000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 11900 Accepted Submission(s): 5240Problem DescriptionAt the entrance to原创 2014-11-30 14:42:55 · 886 阅读 · 0 评论 -
POJ1655——Balancing Act
Balancing ActTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 9143 Accepted: 3797DescriptionConsider a tree T with N (1 <= N <= 20,000) nodes numbered 1...原创 2014-11-03 11:48:35 · 905 阅读 · 0 评论 -
POJ2029——Get Many Persimmon Trees
Get Many Persimmon TreesTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 3656 Accepted: 2378DescriptionSeiji Hayashi had been a professor of the Nisshinkan原创 2014-10-30 17:11:57 · 1271 阅读 · 0 评论
分享