
数据结构
Spark_007
Forward.
展开
-
Uva 1160 X-Plosives ——并查集
X-PlosivesTime Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %lluSubmit Status Practice UVA 1160DescriptionX-Plosives A secret service developed a new kind of ex原创 2013-07-16 10:57:43 · 958 阅读 · 0 评论 -
UVALive 4487 Exclusive-OR
#pragma warning(disable:4996)//UVALive 4487/*题意:每次告诉你两个变量的异或值,或者是一个变量的确切值,询问一些变量的异或值考点:并查集思路:每次告知信息时:将两个变量添加到并查集里(只给一个变量的确切值的时候看做是和一个数值为0的超级变量异或,因为x^0=x) 并且对于每个节点记录此节点与其祖先节点的异或值,做法就是从此结点一直更新到祖原创 2015-07-17 11:23:44 · 780 阅读 · 0 评论 -
UVA11988 Broken Keyboard (a.k.a. Beiju Text)
题意:给出一个打字序列,其中[表示home键,]表示end键,处理一下,输出实际输出的序列。 思路:邻接表的思路,记录每个字母的下一个字母在的位置。//UVA11988//邻接表#pragma warning(disable:4996)#include <stdio.h>#include <string.h>#include <string>#include <algorithm>#原创 2015-07-17 11:40:15 · 626 阅读 · 0 评论 -
POJ 3250 Bad Hair Day -- 栈
Bad Hair DayTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 11340 Accepted: 3832DescriptionSome of Farmer John's N cows (1 ≤ N ≤ 80,000) are having a ba原创 2013-05-15 13:20:12 · 733 阅读 · 0 评论 -
HDU 1908 Double Queue
Double QueueTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 7565Accepted: 3497DescriptionThe new founded Balkan Investment Group Bank (BIG-Bank原创 2013-04-16 17:37:37 · 915 阅读 · 0 评论 -
Mobile Phones poj 1195--二维树状数组
Mobile phonesTime Limit: 5000MS Memory Limit: 65536K DescriptionSuppose that the fourth generation mobile phone base stations in the Tampere area operate as follows原创 2013-04-30 16:27:50 · 842 阅读 · 0 评论 -
Sliding Window poj2823--单调队列
Sliding WindowTime Limit: 12000MS Memory Limit: 65536K Case Time Limit: 5000MSDescriptionAn array of size n ≤ 106 is given to you. There is a sliding window o原创 2013-05-06 18:51:49 · 841 阅读 · 0 评论 -
Ultra-QuickSort poj 2299--树状数组求逆序数
Ultra-QuickSortTime Limit: 7000MS Memory Limit: 65536KTotal Submissions: 32150 Accepted: 11441DescriptionIn this problem, you have to analyze a particular sorting a原创 2013-04-30 08:51:16 · 763 阅读 · 0 评论 -
Japan poj3067--树状数组
JapanTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 16732 Accepted: 4488DescriptionJapan plans to welcome the ACM ICPC World Finals and a lot of roads mu原创 2013-04-29 22:56:22 · 781 阅读 · 0 评论 -
Stars poj 2532--树状数组
StarsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 25498 Accepted: 11150DescriptionAstronomers often examine star maps where stars are represented by po原创 2013-04-30 10:57:36 · 923 阅读 · 0 评论 -
Poj 2560 || Hdu 1162 Freckles--最小生成树
FrecklesTime Limit: 1000MS Memory Limit: 65536K DescriptionIn an episode of the Dick Van Dyke show, little Richie connects the freckles on his Dad's back to form原创 2013-07-23 21:34:52 · 941 阅读 · 0 评论 -
Poj 1182 食物链--带边权的并查集
食物链Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 35967 Accepted: 10441Description动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。 现有N个动物,以1-N编号。每个动物都是A原创 2013-07-24 09:44:55 · 1316 阅读 · 0 评论 -
优先队列模拟最大堆和最小堆,poj 1442 Black Box
Black BoxTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 5619 Accepted: 2265DescriptionOur Black Box represents a primitive database. It can save an integ原创 2013-07-16 10:49:25 · 934 阅读 · 0 评论 -
二叉树 Poj 1577 Falling Leaves
Falling LeavesTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 3588 Accepted: 2005Description Figure 1Figure 1 shows a graphical representation of原创 2013-07-16 10:22:49 · 1000 阅读 · 0 评论 -
UVA 11136 Hoax or what 【multiset】
题意:每天放进箱子里一些数字,之后取出箱子中最大和最小的两个数,得分为两者的差,求n天后的得分总和。 思路:使用multiset,因为其内部是排好序的,直接取,然后删除即可。#pragma warning(disable:4996)#include <stdio.h>#include <algorithm>#include <set>#include <iostream>#include原创 2015-07-17 11:36:59 · 652 阅读 · 0 评论