自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(110)
  • 资源 (3)
  • 收藏
  • 关注

原创 hdu 4699 Editor

Double StackFlexible application.Splay is ok too.(Compile with C++....)

2013-08-22 18:08:47 1143

原创 hdu 4677 Query on Graph

Blocking.#include #include #include #include #include #include using namespace std;const int N = 3e4+10;const int B = 181;namespace graph { struct edge_t { int v, to; }; vector E

2013-08-21 19:49:46 867

原创 hdu 4691 Front compression

Concatenate the long string and itself.Then construct SuffixArray, rmq.Easy.#include #include #include #include using namespace std;const int N = 3e5+10;typedef long long LL;void sa_da(i

2013-08-20 19:16:29 1011

原创 hdu 4687 Boke and Tsukkomi

Dancing link

2013-08-20 18:07:17 1276

原创 NBUT 1457 Sona

Thinking in Blocking

2013-08-19 20:05:57 826

原创 HDU 4679 Terrorist’s destroy

for each tree u, maintain five stuff:  p: the longest upper path start from u .  h: the diameter of the global tree after cut tree u.  f: the diameter of tree u.  d[0]: the longest lower path

2013-08-16 14:05:40 631

原创 HDU 4670 Cube number on a tree

divide and conquer on tree.#include #include #include #include #include #include using namespace std;const int N = 5e4+10;const int K = 32;typedef long long LL;struct edge_t { int v, to

2013-08-16 13:50:19 760

原创 HDU 4625 JZPTREE

蛋疼的,斯特林数优化+小树形递推

2013-08-04 20:45:19 2545

原创 hdu 4409 Family Name List

/* Three operations L : the same as input, correspond to Preorder traversal. b x : correspond to ask how many sons does x's father have. c x y : LCA(x, y), there is a trick, if LCA(x, y)

2012-09-24 12:48:15 733

原创 hdu 4292 Food

/* Maximum-stream again. We can divide the graph into 5 part. super-source -----> food -----> customer -----> drink -----> super-sink fi 1 1 dj

2012-09-17 20:21:49 625

原创 hdu 4289 Control

/* This problem corrspond to kind of Minimum-Cut staff Split a city into two node(I'd love to call it input-node and output-node). Connect them with a directed edge and the edge's capacity as th

2012-09-17 20:07:12 702

原创 hdu 4288 Coder

/* Maintain two domain when we update the splay tree. x->s[i] as the sum of aj which j mod 5 == i in subtree x x->sz as the size of subtree x Then, Root->s[3] is the sum of whole set. k = t

2012-09-17 19:53:47 654

原创 hdu 4267 A Simple Problem with Integers

/* Intuitively, we can solve this problem by using segment-tree. As points we deal with are discrete, we should do some specail judge. Notice that k <= 10, so we can build 10 SGT or one SGT

2012-09-16 09:35:28 649

原创 hdu 4286 Data Handler

/* I can hardly belive that I hadn't read this problem clearly. It's Fu*king easy!!!!! Sh*t, we could got the ticket to Tianjin if I had fu*k this fu*king problem! Clam down..... L/R as a poi

2012-09-13 15:01:16 632

原创 hdu 4280 Island Transport

/* This Problem beat me completely. Beat my template completely. Beat my funtion comletely. Waste my time comletely. It's a naked maximum-stream problem. The main point is your tem

2012-09-13 09:35:05 621

原创 hdu 4285 circuits

/* Damn it! I should deal with this SCDP instead of Problem 1003, And I make a big mistake, I should read all the problem first! Errrr........... According to the statement, we can only have K-l

2012-09-13 09:06:10 677

原创 hdu 4258 Covered Walkway

/*Intuitively, according to the declaration of the problem, we haveDefinition s[i] as the coordinate ith point need to be covered. dp[i] as the minimum cost to cover the walkway within [0, i],

2012-09-06 17:19:36 620

原创 hdu 2518 Dominoes

/* What a TROUBLESOME Problem!!! Obviously, we should construct a sparse table which has 60 * 63 rows and 60 + 12 colums. 60 * 63 rows 60 means we can place the "center" of a block on a spec

2012-09-05 15:25:35 760

原创 pku 2096 Collecting Bugs

/* Definition: 1. st[i, j] as we have found i categories and j subsystems. 2. ev[i, j] as the expected move from st[i, j] to st[n, s]. According to the statement of the problem, we can get ev[

2012-09-05 15:07:39 547

原创 UVALive 4370 A Day at the Races

/* Apparently, it's kind of simulation stuff. I think It's easy until i find a little trick, which gave me 6wa as gifts :( The trick is that the driver may join anthor team while his current scor

2012-08-29 00:02:16 547

原创 UVALive 4361 Tobo or not Tobo

/* As it's only 9^9 status at most(in fact, it's not that much), We can calculate all the status, which can be reached from initial status 123456789 and the number of steps not larger than

2012-08-28 23:01:33 639

原创 hdu 4031 Divide Chocolate

Dynamic Programming again!There are a lot of state, so, the main point is how to classify them clearly.dp[i][j][0]: as the number of different methods to divide 2 * i chocolate grid into j part an

2012-08-23 13:18:55 548

原创 hdu 4219 Randomization?

What a disgusting tree type probability dp!But it cant annoy me anymore hoho :).dp[u][i] as the probability that (1) The height of subtree u is i (2)  The distance between any two nodes do not exc

2012-08-22 12:09:02 655

原创 Hdu 4302 Holedox Eating

Binary-index-array + binary search and slight simulation. (of course seg-tree would be more effcient)For the simulation, I will record the current position(cp) and current direction(cd) of Holedox.

2012-08-22 11:18:24 627

原创 Zoj 3195 Design the city

Obviously, it's kind of LCA problem.I assume that you guys have already learned about LCA stuff :).So I just talk about the main idea of my method.Our goal is to connect three specific node by u

2012-08-22 10:53:06 601

原创 hdu 4366 Successor

Interesting, I haven't seen this kind of transform before(it proves that i am remain a newbie).I try to slove it by using sorts of brute-force seg-tree-update method.Of course I would get a TLE.

2012-08-21 01:45:05 553

原创 hdu 3397 Sequence operation

a disgusting seg-tree problemi have to maintain 6 varible for each nodecc: cover colorrv: reverse taglc[i]: longgest cover length from left side of color irc[i]: longgest cover length from r

2012-08-19 11:01:39 530

原创 hdu 4340 Capturing a country

f for Af[u][0] as the min-time to conquer subtree u, u-th city is conquered by A and the start node of all the most nearly continuous-conquer path from each son had not been considered yetf[u][1]

2012-08-19 10:39:16 442

原创 UVALive 4614 Moving to Nuremberg

http://livearchive.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2615DFS twicethe first DFSthe dp[u] as the time that edge[father][u] had been usedsum

2012-08-19 10:13:42 714

原创 UVALive 4302 Toll Road

http://livearchive.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2303dp[u]: as the maximum value connected component include usoif (dp[v] + w > 0) dp[u]

2012-08-19 09:42:24 792 1

原创 UVALive 4236 Text Messaging Improvement?

http://livearchive.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2237dp[i as i-th frequency(or letter)][j as we had used j key][k as the k-th position in

2012-08-19 09:31:48 1133 3

原创 UVALive 4235 Recursively Palindromic Partitions

http://livearchive.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2236dp[i]: as i has dp[i] RPPand dp[i] = dp[i / 2] + $\sum_{j = 1}^{i}dp[(n - i) / 2]$

2012-08-19 09:13:24 766

原创 Ural 1519 Formula 1

1519. Formula 1Time Limit: 1.0 secondMemory Limit: 16 MBBackgroundRegardless of the fact, that Vologda could not get rights to hol

2011-10-05 20:10:16 1510

原创 最潮最短路算法:SPFA

首先理解单源最短路一滴概念(以下概念不作证明,证明自行baidu): V:点集 E:边集 s:源点 u:当前起始定点 v:当前目标顶点 u->v:表示顶点u直接到达顶点v(经过边数==1) u~>v:表示顶点u通过某一路径到

2011-08-14 11:40:55 986

原创 HDU 1075 What Are You Talking About

What Are You Talking AboutTime Limit: 10000/5000 MS (Java/Others)    Memory Limit: 102400/204800 K (Java/Others)Total Submission(s): 453

2011-08-04 11:00:30 673

HDU 1075 What Are You Talking About

What Are You Talking AboutTime Limit: 10000/5000 MS (Java/Others)Memory Limit: 102400/204800 K (Java/Others)Total Submission(s): 4539Accepted Submission(s): 1368Problem DescriptionIgnatius is so...

2011-08-04 11:00:00 117

原创 HDU 1370 Biorhythms

BiorhythmsTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 669    Accepted Submis

2011-08-03 10:27:33 885

HDU 1370 Biorhythms

BiorhythmsTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 669Accepted Submission(s): 266Problem DescriptionSome people believe that there are ...

2011-08-03 10:27:00 92

原创 2142 HDU box

boxTime Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3730    Accepted Submission(s

2011-08-02 21:21:52 709

2142 HDU box

boxTime Limit: 3000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3730Accepted Submission(s): 674Problem DescriptionOne day, winnie received a box and a lett...

2011-08-02 21:21:00 97

龙书2nd英文版

高清的编译原理经典教材,内容不用多介绍了吧.

2013-06-25

The TeXbook

A TeX document written by Donald. E. Knuth.

2012-11-27

计算几何算法与应用(第三版)

关于几何的书,对里面有很多经典的数据结构和算法.

2011-07-23

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除