随笔分类 -  数据结构

线段树、平衡树(Splay , treap)、可持久化数据结构、块状链表(莫队算法)、树链剖分算法
摘要:BNUOJ 51636 最近,无聊的过河船同学在玩一种奇怪的名为“小Q的恶作剧”的纸牌游戏。 现在过河船同学手有张牌,分别写着,打乱顺序之后排成一行,位置从左往右按照标号。 接下来小Q同学会给出个操作,分为以下两种: 1.给定,交换从左往右数的第和第张牌, 2.给定,对从左往右数的第张牌,记下位置是 阅读全文
posted @ 2016-05-16 11:24 茶飘香~ 阅读(270) 评论(0) 推荐(0)
摘要:POJ 1743 Description A musical melody is represented as a sequence of N (1<=N<=20000)notes that are integers in the range 1..88, each representing a k 阅读全文
posted @ 2016-05-12 19:41 茶飘香~ 阅读(367) 评论(0) 推荐(0)
摘要:51Nod 在一个排列中,如果一对数的前后位置与大小顺序相反,即前面的数大于后面的数,那么它们就称为一个逆序。一个排列中逆序的总数就称为这个排列的逆序数。 如2 4 3 1中,2 1,4 3,4 1,3 1是逆序,逆序数是4。给出一个整数序列,求该序列的逆序数。 在一个排列中,如果一对数的前后位置与 阅读全文
posted @ 2016-05-06 20:09 茶飘香~ 阅读(243) 评论(0) 推荐(0)
摘要:Description Today is Christmas day. There are n single boys standing in a line. They are numbered form 1 to n from left to right. The i-th single boy 阅读全文
posted @ 2016-05-03 17:49 茶飘香~ 阅读(186) 评论(0) 推荐(0)
摘要:HDU 3613 Description After an uphill battle, General Li won a great victory. Now the head of state decide to reward him with honor and treasures for h 阅读全文
posted @ 2016-04-24 12:03 茶飘香~ 阅读(221) 评论(0) 推荐(0)
摘要:HDU 3068 Description 给出一个只由小写英文字符a,b,c...y,z组成的字符串S,求S中最长回文串的长度. 回文就是正反读都是一样的字符串,如aba, abba等 HDU 3068 Description 给出一个只由小写英文字符a,b,c...y,z组成的字符串S,求S中最长 阅读全文
posted @ 2016-04-24 11:42 茶飘香~ 阅读(217) 评论(0) 推荐(0)
摘要:HDU 5371 Description Hotaru Ichijou recently is addicated to math problems. Now she is playing with N-sequence. Let's define N-sequence, which is comp 阅读全文
posted @ 2016-04-19 20:00 茶飘香~ 阅读(303) 评论(0) 推荐(0)
摘要:HDU 3294 Problem Description One day, sailormoon girls are so delighted that they intend to research about palindromic strings. Operation contains two 阅读全文
posted @ 2016-04-17 17:56 茶飘香~ 阅读(177) 评论(0) 推荐(0)
摘要:POJ 3974 Description Andy the smart computer science student was attending an algorithms class when the professor asked the students a simple question 阅读全文
posted @ 2016-04-17 11:55 茶飘香~ 阅读(220) 评论(0) 推荐(0)
摘要:台州学院 2924 描述 Tiger最近被公司升任为营业部经理,他上任后接受公司交给的第一项任务便是统计并分析公司成立以来的营业情况。Tiger拿出了公司的账本,账本上记录了公司成立以来每天的营业额。分析营业情况是一项相当复杂的工作。由于节假日,大减价或者是其他情况的时候,营业额会出现一定的波动,当 阅读全文
posted @ 2016-04-16 21:40 茶飘香~ 阅读(166) 评论(0) 推荐(0)
摘要:HDU 1908 Description The new founded Balkan Investment Group Bank (BIG-Bank) opened a new office in Bucharest, equipped with a modern computing enviro 阅读全文
posted @ 2016-04-12 21:43 茶飘香~ 阅读(250) 评论(0) 推荐(0)
摘要:HDU 1754 Description 很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。 这让很多学生很反感。 不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时候需要更新某位同学的成绩。 Description 很多 阅读全文
posted @ 2016-04-12 19:40 茶飘香~ 阅读(345) 评论(0) 推荐(0)
摘要:POJ 3468 Description 给出了一个序列,你需要处理如下两种询问。 "C a b c"表示给[a, b]区间中的值全部增加c (-10000 ≤ c ≤ 10000)。 "Q a b" 询问[a, b]区间中所有值的和。 Description 给出了一个序列,你需要处理如下两种询问 阅读全文
posted @ 2016-04-12 17:12 茶飘香~ 阅读(174) 评论(0) 推荐(0)
摘要:POJ 2761 Description Wind loves pretty dogs very much, and she has n pet dogs. So Jiajia has to feed the dogs every day for Wind. Jiajia loves Wind, b 阅读全文
posted @ 2016-04-08 18:41 茶飘香~ 阅读(244) 评论(0) 推荐(0)
摘要:Description Shaolin temple is very famous for its Kongfu monks.A lot of young men go to Shaolin temple every year, trying to be a monk there. The mast 阅读全文
posted @ 2016-04-07 19:47 茶飘香~ 阅读(235) 评论(0) 推荐(0)
摘要:HDU 4333 Description One day Silence is interested in revolving the digits of a positive integer. In the revolving operation, he can put several last 阅读全文
posted @ 2016-04-03 17:19 茶飘香~ 阅读(187) 评论(0) 推荐(0)
摘要:HDU 2778 Description LCR is a simple game for three or more players. Each player starts with three chips and the object is to be the last person to ha 阅读全文
posted @ 2016-04-02 12:36 茶飘香~ 阅读(521) 评论(0) 推荐(0)
摘要:ZOJ 3228 题目网址:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=16401 Description Little jay really hates to deal with string. But moondy li 阅读全文
posted @ 2016-04-01 18:42 茶飘香~ 阅读(242) 评论(0) 推荐(0)
摘要:HDU 3065 题目网址: http://acm.hust.edu.cn/vjudge/contest/view.action?cid=110773#problem/C Description 小t非常感谢大家帮忙解决了他的上一个问题。然而病毒侵袭持续中。在小t的不懈努力下,他发现了网路中的“万恶 阅读全文
posted @ 2016-03-29 21:18 茶飘香~ 阅读(210) 评论(0) 推荐(0)
摘要:HDU 2896 题目网址: http://acm.hust.edu.cn/vjudge/contest/view.action?cid=110773#problem/B Description 当太阳的光辉逐渐被月亮遮蔽,世界失去了光明,大地迎来最黑暗的时刻。。。。在这样的时刻,人们却异常兴奋―― 阅读全文
posted @ 2016-03-29 20:06 茶飘香~ 阅读(252) 评论(0) 推荐(0)