随笔分类 -  ------【数据结构】

1 2 下一页

HDU - 1542【离散化+线段树+扫描线】
摘要:Atlantis Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 11997 Accepted Submission(s): 5056 Probl 阅读全文

posted @ 2017-02-16 18:59 Jstyle 阅读(200) 评论(0) 推荐(0)

HDU - 4614 【二分+线段树维护】
摘要:Vases and Flowers Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 3263 Accepted Submission(s): 12 阅读全文

posted @ 2017-02-14 11:16 Jstyle 阅读(211) 评论(0) 推荐(0)

codeforces - 766D【Double 并查集】
摘要:D. Mahmoud and a Dictionary time limit per test 4 seconds memory limit per test 256 megabytes input standard input output standard output Mahmoud want 阅读全文

posted @ 2017-02-08 20:07 Jstyle 阅读(341) 评论(0) 推荐(0)

HDU 6012【离散化+扫描线】
摘要:Lotus and Horticulture Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 698 Accepted Submission( 阅读全文

posted @ 2017-02-07 19:19 Jstyle 阅读(328) 评论(0) 推荐(0)

BZOJ - 1015【并查集】
摘要:1015: [JSOI2008]星球大战starwar Description 很久以前,在一个遥远的星系,一个黑暗的帝国靠着它的超级武器统治者整个星系。某一天,凭着一个偶然的 机遇,一支反抗军摧毁了帝国的超级武器,并攻下了星系中几乎所有的星球。这些星球通过特殊的以太隧道互相直 接或间接地连接。 但 阅读全文

posted @ 2017-02-03 20:44 Jstyle 阅读(242) 评论(0) 推荐(0)

codeforces 760E or 759C 【线段树维护后缀和】
摘要:C. Nikita and stack time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output C. Nikita and stack 阅读全文

posted @ 2017-01-26 21:45 Jstyle 阅读(471) 评论(0) 推荐(0)

BZOJ - 1007 【单调栈】
摘要:007: [HNOI2008]水平可见直线 Time Limit: 1 Sec Memory Limit: 162 MB Submit: 6614 Solved: 2519 [Submit][Status][Discuss] Description 在xoy直角坐标平面上有n条直线L1,L2,... 阅读全文

posted @ 2017-01-24 17:03 Jstyle 阅读(191) 评论(0) 推荐(0)

HDU - 5269【SBBBBBB Trie】
摘要:ZYB loves Xor I Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 979 Accepted Submission(s): 436 阅读全文

posted @ 2017-01-18 22:25 Jstyle 阅读(263) 评论(0) 推荐(0)

HDU - 5775 Bubble Sort(树状数组)
摘要:Bubble Sort Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 659 Accepted Submission(s): 393 Prob 阅读全文

posted @ 2016-07-30 09:07 Jstyle 阅读(161) 评论(0) 推荐(0)

HDU - 1556 Color the ball(树状数组 or 线段树)
摘要:Color the ball Time Limit: 9000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 16484 Accepted Submission(s): 820 阅读全文

posted @ 2016-07-30 08:53 Jstyle 阅读(214) 评论(0) 推荐(0)

树状数组
摘要:对于普通数组,其修改的时间复杂度位O(1),而求数组中某一段的数值和的时间复杂度为O(n),因此对于n的值过大的情况,普通数组的时间复杂度我们是接受不了的。 在此,我们引入了树状数组的数据结构,它能在O(logn)内对数组的值进行修改和查询某一段数值的和。 树状数组是一个查询和修改复杂度都为log( 阅读全文

posted @ 2016-07-30 08:41 Jstyle 阅读(189) 评论(0) 推荐(0)

HDU - 1541 Stars(树状数组)
摘要:同学们~ Stars Problem Description Astronomers often examine star maps where stars are represented by points on a plane and each star has Cartesian coordi 阅读全文

posted @ 2016-07-30 08:35 Jstyle 阅读(180) 评论(0) 推荐(0)

51nod - 1019 逆序数(归并排序or线段树)
摘要:思路:利用归并排序,先分解区间。最后合并区间的时候找到逆序的个数。(可以画图来理解归并排序) 代码: 1 #include <iostream> 2 #include <cstring> 3 using namespace std; 4 5 int a[50005]; 6 int res[50005 阅读全文

posted @ 2016-07-28 09:52 Jstyle 阅读(223) 评论(0) 推荐(0)

cf - 629D Babaei and Birthday Cake(DP+线段树维护)
摘要:D - Babaei and Birthday Cake Time Limit:2000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64u Submit Status Practice CodeForces 629D D - Babaei a 阅读全文

posted @ 2016-07-15 15:10 Jstyle 阅读(258) 评论(0) 推荐(0)

POJ 3468 - A Simple Problem with Integers(线段树,区间更新)
摘要:C - A Simple Problem with Integers Time Limit:5000MS Memory Limit:131072KB 64bit IO Format:%I64d & %I64u Submit Status Practice POJ 3468 C - A Simple 阅读全文

posted @ 2016-07-15 15:02 Jstyle 阅读(245) 评论(0) 推荐(0)

HDU 1166 - 敌兵布阵(线段树,单点更新)
摘要:A - 敌兵布阵 Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status Practice HDU 1166 A - 敌兵布阵 Submit Status Practice HDU 1166 阅读全文

posted @ 2016-07-15 14:53 Jstyle 阅读(178) 评论(0) 推荐(0)

NWU CCCC 1017(HDU 1272改编 并查集判断图是否存在环)
摘要:Evio与观察小白鼠 Font: Times New Roman | Verdana | Georgia Font Size: ← → Problem Description Evio非常喜欢生物,Evio现在想观察小白鼠的记忆能力。Evio想设计一个任意两个房间只有一条路径的地图。这个地图有m条双 阅读全文

posted @ 2016-07-09 16:57 Jstyle 阅读(212) 评论(0) 推荐(0)

hdu - 1556 (Color the ball 线段树)
摘要:题目链接:点击打开链接 思路:简单的线段树模板,理解了好久。创建+更新+查询。更新只涉及到区间更新次数(+1)即可。查询可以递归查询,累加包含查询结点的树结点(即离散化的区间[l,r])的次数即可。简单的说就是,查询结点所在的区间更新次数的总和。 eg:离散化到树结点,若共有4个结点,更新区间[1, 阅读全文

posted @ 2016-07-02 23:31 Jstyle 阅读(145) 评论(0) 推荐(0)

cf #345 div2 C(Vasya and String。双端队列)
摘要:题目链接:http://codeforces.com/contest/676/problem/C 1 #include <iostream> 2 #include <deque> 3 #include <string> 4 5 using namespace std; 6 /************ 阅读全文

posted @ 2016-06-13 12:27 Jstyle 阅读(159) 评论(0) 推荐(0)

PAT - L2-010. 排座位(并查集)
摘要:L2-010. 排座位 时间限制 150 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 作者 陈越 时间限制 150 ms 时间限制 150 ms 内存限制 65536 kB 内存限制 65536 kB 代码长度限制 8000 B 代码长度限制 8000 阅读全文

posted @ 2016-06-04 23:35 Jstyle 阅读(253) 评论(0) 推荐(0)

1 2 下一页

导航