上一页 1 ··· 20 21 22 23 24 25 26 27 28 ··· 40 下一页

2013年5月20日

Hdu 4545 魔法串 字符串dp

摘要: 魔法串Time Limit: 3000/1000 MS (Java/Others)Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 474Accepted Submission(s): 200Problem Description 小明和他的好朋友小西在玩一个新的游戏,由小西给出一个由小写字母构成的字符串,小明给出另一个比小西更长的字符串,也由小写字母组成,如果能通过魔法转换使小明的串和小西的变成同一个,那么他们两个人都会很开心。这里魔法指的是小明的串可以任意删掉某个字符,或者把某些字符对照字符变化表变化。如: ... 阅读全文

posted @ 2013-05-20 11:12 电子幼体 阅读(177) 评论(0) 推荐(0) 编辑

2013年5月16日

Hdu 1542 Atlantis 线段树 求矩形面积并

摘要: AtlantisTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4691Accepted Submission(s): 2095Problem DescriptionThere are several ancient Greek texts that contain descriptions of the fabled island Atlantis. Some of these texts even include maps of parts 阅读全文

posted @ 2013-05-16 14:43 电子幼体 阅读(201) 评论(0) 推荐(0) 编辑

Poj 3667 Hotel 线段树 区间合并

摘要: HotelTime Limit:3000MSMemory Limit:65536KTotal Submissions:8968Accepted:3804DescriptionThe cows are journeying north to Thunder Bay in Canada to gain cultural enrichment and enjoy a vacation on the sunny shores of Lake Superior. Bessie, ever the competent travel agent, has named the Bullmoose Hotel 阅读全文

posted @ 2013-05-16 09:58 电子幼体 阅读(209) 评论(0) 推荐(0) 编辑

2013年5月14日

UVa 11992 - Fast Matrix Operations 成段更新,求最值与和

摘要: Problem FFast Matrix OperationsThere is a matrix containing at most 106elements divided into r rows and c columns. Each element has a location (x,y) where 10)2 x1 y1 x2 y2 vSet each element (x,y) in submatrix (x1,y1,x2,y2) to v3 x1 y1 x2 y2Output the summation, min value and max value of submatrix ( 阅读全文

posted @ 2013-05-14 18:26 电子幼体 阅读(146) 评论(0) 推荐(0) 编辑

UVa 12299 - RMQ with Shifts 线段树 单点更新

摘要: RMQ with ShiftsIn the traditional RMQ (Range Minimum Query) problem, we have a static arrayA. Then for each query(L,R)(LR), we report the minimum value amongA[L],A[L+ 1], ...,A[R]. Note that the indices start from 1, i.e. the left-most element isA[1].In this problem, the arrayAis no longer static: w 阅读全文

posted @ 2013-05-14 15:32 电子幼体 阅读(169) 评论(0) 推荐(0) 编辑

2013年5月13日

Poj 2528 Mayor's posters 线段树 离散化 成段更新

摘要: Mayor's postersTime Limit:1000MSMemory Limit:65536KTotal Submissions:32605Accepted:9469DescriptionThe citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campaign have been placing their electoral posters at all places at their whim. The city council has finally 阅读全文

posted @ 2013-05-13 15:59 电子幼体 阅读(97) 评论(0) 推荐(0) 编辑

二分模板以及STL中的查找

摘要: 二分查找的基本实现int b_search(int key,int a[],int n) { int l=0,r=n-1; while (l=key的第一个元素的位置upper_bound()返回数组中>key的第一个元素的位置-------------------ForwardIterator lower_bound (ForwardIterator first,ForwardIterator last, const T& value)ForwardIterator lower_bound (ForwardIterator first,ForwardIterator last. 阅读全文

posted @ 2013-05-13 15:38 电子幼体 阅读(168) 评论(0) 推荐(0) 编辑

2013年5月12日

hdu 2795 Billboard 线段树 单点更新

摘要: BillboardTime Limit: 20000/8000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 6525Accepted Submission(s): 2957Problem 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-05-12 20:01 电子幼体 阅读(116) 评论(0) 推荐(0) 编辑

线段树模板

摘要: 单点更新,区间求最值#include #include #include #include #include #define N 222222 using namespace std; int num[N]; struct Tree { int l; int r; int max; } tree[N*4]; void push_up(int root) { tree[root].max=max(tree[root=tree[root].r) return tree[root].max; int mid=(tree[root].l+... 阅读全文

posted @ 2013-05-12 19:03 电子幼体 阅读(188) 评论(0) 推荐(0) 编辑

[置顶] ⑨的线段树专题

摘要: 单点更新最最基础的线段树,只更新叶子节点,然后把信息用PushUP(int r)这个函数更新上来。hdu1166 敌兵布阵线段树 hdu 1166 敌兵布阵 单点更新区间求和hdu1754 I Hate It线段树 hdu 1754 I Hate It 单点更新 区间求最值hdu1394 Minimum Inversion Numberhdu 1394 Minimum Inversion Number 线段树 逆序数hdu2795 Billboardhdu 2795 Billboard 线段树 单点更新UVa 12299 - RMQ with Shifts 线段树 单点更新poj2828Buy 阅读全文

posted @ 2013-05-12 17:33 电子幼体 阅读(172) 评论(0) 推荐(0) 编辑

上一页 1 ··· 20 21 22 23 24 25 26 27 28 ··· 40 下一页

导航