数据结构
提比-我有特殊的AC技巧
这个作者很懒,什么都没留下…
展开
-
染色 - HYSBZ 2243 树链刨分
染色Time Limit: 20 Sec Memory Limit: 512 MBSubmit: 3626 Solved: 1380[Submit][Status][Discuss]Description给定一棵有n个节点的无根树和m个操作,操作有2类:1、将节点a到节点b路径上所有点都染成颜色c;2、询问节点a到节点b路径上的颜色段数量(连原创 2015-08-16 23:12:16 · 401 阅读 · 0 评论 -
War - UVa 10158 并查集
题意:朋友的朋友是朋友,朋友的敌人是敌人,敌人的敌人是朋友。思路:并查集模拟。AC代码如下:#include#includeusing namespace std;int n,p[10010],en[10010];int find(int x){ return p[x]==x ? x :p[x]=find(p[x]);}int main(){ int i原创 2015-02-12 17:46:16 · 486 阅读 · 0 评论 -
Watto and Mechanism - CodeForces 514 C Trie树
Watto and Mechanismtime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputWatto, the owner of a spare parts store原创 2015-02-15 03:18:52 · 1350 阅读 · 0 评论 -
R2D2 and Droid Army - CodeForces 514 D 二分
R2D2 and Droid Armytime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAn army of n droids is lined up in one原创 2015-02-15 03:17:54 · 556 阅读 · 0 评论 -
Choose and divide - UVa 10375
The binomial coefficient C(m,n) is defined as m!C(m,n) = -------- n!(m-n)!Given four natural numbers p, q, r, and s, compute the the result of dividing C(p,q) by C(r,s).原创 2015-02-16 16:30:42 · 448 阅读 · 0 评论 -
Weird Advertisement - UVa 11983 扫面线求重复K次的面积
2DPlaneLand is a land just like a huge 2D plane. The range of X axis is 0 to 109 and the range of Y axis is also 0 to 109. People built houses only in integer co-ordinates and there is exactly one h原创 2014-12-15 17:58:30 · 609 阅读 · 0 评论 -
Stars in Your Window - POJ 2482 线段树
Stars in Your WindowTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 10366 Accepted: 2854DescriptionFleeting time does not blur my memory of you. Can i原创 2014-12-12 20:42:55 · 513 阅读 · 0 评论 -
Brownie Points II - POJ 2464 线段树
Brownie Points IITime Limit: 5000MS Memory Limit: 65536KTotal Submissions: 1987 Accepted: 704DescriptionStan and Ollie play the game of Odd Brownie Points. Some原创 2014-12-12 23:00:54 · 508 阅读 · 0 评论 -
Solve It - UVa 10341 二分
Solve ItInput: standard inputOutput: standard outputTime Limit: 1 secondMemory Limit: 32 MBSolve the equation: p*e-x + q*sin(x) + r*cos(x) + s*tan(x) + t*x2 + u = 0 where 0原创 2015-02-01 20:11:34 · 486 阅读 · 0 评论 -
Children’s Game - UVa 10905 拼接最大数
4th IIUC Inter-University Programming Contest, 2005AChildren’s GameInput: standard inputOutput: standard outputProblemsetter: Md. KamruzzamanThere a原创 2015-02-01 15:42:10 · 508 阅读 · 0 评论 -
Get The Treasury - HDU 3642 扫描线 重复三次的体积
Get The TreasuryTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2083 Accepted Submission(s): 640Problem DescriptionJack know原创 2014-12-08 16:58:59 · 721 阅读 · 0 评论 -
覆盖的面积 - HDU 1255 扫描线 重复两次的面积
覆盖的面积Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3841 Accepted Submission(s): 1887Problem Description给定平面上若干矩形,求出被这些矩形覆盖原创 2014-12-08 16:54:51 · 478 阅读 · 0 评论 -
Misha and Permutations Summation - CodeForces 501 D 树状数组
Misha and Permutations Summationtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputLet's define the sum of tw原创 2015-01-30 23:24:01 · 562 阅读 · 0 评论 -
Picture - POJ 1177 扫描线 矩阵合并的周长
PictureTime Limit: 2000MS Memory Limit: 10000KTotal Submissions: 10646 Accepted: 5625DescriptionA number of rectangular posters, photographs and other pictures原创 2014-12-03 22:41:33 · 509 阅读 · 0 评论 -
Farming - HDU 3255 扫描线
FarmingTime Limit: 12000/6000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1307 Accepted Submission(s): 385Problem DescriptionYou have a big far原创 2014-12-15 17:55:46 · 472 阅读 · 0 评论 -
Closest Sums - UVa10487 二分
Closest SumsInput: standard inputOutput: standard outputTime Limit: 3 seconds Given is a set of integers and then a sequence of queries. A query gives you a number and asks to find a sum of原创 2015-02-27 01:14:35 · 379 阅读 · 0 评论 -
Mike and Feet - CodeForces #547 B
Mike and Feettime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputMike is the president of country What-The-Fath原创 2015-05-27 17:20:49 · 1070 阅读 · 0 评论 -
Quadtree - ZOJ 1955 四分树
QuadtreeTime Limit: 2 Seconds Memory Limit: 65536 KBWhile searching for treasures in an ancient Aztec ruin, Florida Jones (the brother of famous Indiana Jones) stumbles across a papyrus r原创 2015-07-08 16:34:33 · 1592 阅读 · 0 评论 -
Tree - POJ 3237 树链刨分
TreeTime Limit: 5000MS Memory Limit: 131072KTotal Submissions: 6101 Accepted: 1671DescriptionYou are given a tree with N nodes. The tree’s nodes are numbered 1原创 2015-08-16 21:48:13 · 351 阅读 · 0 评论 -
Housewife Wind - POJ 2763 树链刨分
Housewife WindTime Limit: 4000MS Memory Limit: 65536KTotal Submissions: 7509 Accepted: 1952DescriptionAfter their royal wedding, Jiajia and Wind hid away in XX原创 2015-08-16 15:43:12 · 501 阅读 · 0 评论 -
Aragorn's Story - HDU 3966 树链刨分
Aragorn's StoryTime Limit: 10000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5304 Accepted Submission(s): 1387Problem DescriptionOur prota原创 2015-08-12 22:01:39 · 370 阅读 · 0 评论 -
食物链 - POJ 1182 种类并查集
食物链Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 54026 Accepted: 15812Description动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。 现有N个动物,以1-N编号。每个动原创 2015-08-26 15:53:55 · 358 阅读 · 0 评论 -
Subway tree systems - POJ 1635 树的最小表示法
Subway tree systemsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 7145 Accepted: 2974DescriptionSome major cities have subway systems in the form of原创 2015-08-12 16:53:53 · 802 阅读 · 0 评论 -
Glass Beads - POJ 1509 最小表示法
Glass BeadsTime Limit: 3000MS Memory Limit: 10000KTotal Submissions: 3294 Accepted: 1864DescriptionOnce upon a time there was a famous actress. As you may expec原创 2015-08-12 16:51:08 · 339 阅读 · 0 评论 -
Find them, Catch them - POJ 1703 种类并查集
Find them, Catch themTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 36663 Accepted: 11249DescriptionThe police office in Tadu City decides to say end原创 2015-08-26 15:56:34 · 355 阅读 · 0 评论 -
Lucky - HDU 5213 莫队算法
LuckyTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 419 Accepted Submission(s): 143Problem DescriptionWLD is always very luc原创 2015-06-14 17:31:55 · 452 阅读 · 0 评论 -
Sona - NBUT 1457 莫队算法
[1457] Sona时间限制: 5000 ms 内存限制: 65535 K问题描述Sona, Maven of the Strings. Of cause, she can play the zither.Sona can't speak but she can make fancy music. Her music can attack, heal,原创 2015-06-14 13:21:30 · 639 阅读 · 0 评论 -
Mobile phones - POJ1195 cdq分治
Mobile phonesTime Limit: 5000MS Memory Limit: 65536KTotal Submissions: 16235 Accepted: 7461DescriptionSuppose that the fourth generation mobile phone base stati原创 2015-06-15 10:58:40 · 504 阅读 · 0 评论 -
K-th Number - POJ 2104 划分树
K-th NumberTime Limit: 20000MS Memory Limit: 65536KTotal Submissions: 41517 Accepted: 13593Case Time Limit: 2000MSDescriptionYou are working for Macrohard原创 2015-07-11 15:09:08 · 480 阅读 · 0 评论 -
Minimum Sum - HDU 3473 划分树
Minimum SumTime Limit: 16000/8000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3275 Accepted Submission(s): 754Problem DescriptionYou are given原创 2015-07-11 15:11:00 · 454 阅读 · 0 评论 -
小Z的袜子(hose) - bzoj 2038 莫队算法
2038: [2009国家集训队]小Z的袜子(hose)Time Limit: 20 Sec Memory Limit: 259 MBSubmit: 3684 Solved: 1705[Submit][Status][Discuss]Description作为一个生活散漫的人,小Z每天早上都要耗费很久从一堆五颜六色的袜子中找出一双来穿。终于有一天,小Z再也无法忍受这恼人原创 2015-06-12 13:41:04 · 719 阅读 · 0 评论 -
Quad Trees - ZOJ 1788 四分树
Quad TreesTime Limit: 2 Seconds Memory Limit: 65536 KBA binary image, such as the one shown in Figure 2(a), is usually represented as an array of binary entries, i.e., each entry of the原创 2015-07-08 18:19:21 · 788 阅读 · 0 评论 -
Keywords Search - HDU 2222 AC自动机
Keywords SearchTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 36244 Accepted Submission(s): 11733Problem DescriptionIn the m原创 2014-10-31 13:48:05 · 447 阅读 · 0 评论 -
病毒侵袭持续中 - HDU 3065 AC自动机
病毒侵袭持续中Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 6818 Accepted Submission(s): 2404Problem Description小t非常感谢大家帮忙解决了他的上一个原创 2014-10-31 14:29:33 · 530 阅读 · 0 评论 -
病毒侵袭 - HDU 2896 AC自动机
病毒侵袭Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 12164 Accepted Submission(s): 3152Problem Description当太阳的光辉逐渐被月亮遮蔽,世界失去了光原创 2014-10-31 13:52:51 · 399 阅读 · 0 评论 -
I Hate It - HDU 1752 单点赋值线段树
I Hate ItTime Limit: 9000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 39552 Accepted Submission(s): 15681Problem Description很多学校流行一种比较的习惯。原创 2014-09-09 23:13:01 · 584 阅读 · 0 评论 -
敌兵布阵 - HDU 1166 单点更新线段树
敌兵布阵Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 44979 Accepted Submission(s): 19147Problem DescriptionC国的死对头A国这段时间正在进行军事演原创 2014-09-09 13:24:31 · 546 阅读 · 0 评论 -
Distance Queries - POJ 1986 LCA
Distance QueriesTime Limit: 2000MS Memory Limit: 30000KTotal Submissions: 9314 Accepted: 3268Case Time Limit: 1000MSDescriptionFarmer John's cows refused原创 2014-08-25 00:23:11 · 604 阅读 · 0 评论 -
Multiple Morse Matches - UVaLive 2426 KMP+dp
Before the digital age, the most common ``binary'' code for radio communication was the Morse code. In Morse code, symbols are encoded as sequences of short and long pulses (called dots and dashes,原创 2014-08-11 16:54:01 · 1094 阅读 · 0 评论 -
Nearest Common Ancestors - POJ 1330 LCA
Nearest Common AncestorsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 18409 Accepted: 9756DescriptionA rooted tree is a well-known data structure in原创 2014-08-23 23:08:45 · 521 阅读 · 0 评论