--------数据结构--------
文章平均质量分 82
kyoma
这个kyoma就是逊啦
展开
-
刘汝佳紫书 uva1592
刘汝佳上传的代码没耐心看。。。就大致照着书上写的思路写了一个。。。一开始发现全写错了耗了半天。。。定义一个pair,这个pair里有存两个队,字符串对和int对。每每读入一行的时候看看map中是否存在这个对。自己感觉坑就是,一行中可能存在重复的字符像这样:2 4a,b,a,ba,b,c,d第一行中存在两个字符串想等但列根本不想等的两对下面是代码:#include原创 2016-08-01 20:48:45 · 1373 阅读 · 0 评论 -
hdu5497 Inversion 树状数组 待补完!!!
InversionTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1174 Accepted Submission(s): 351Problem DescriptionYou have a sequen原创 2017-01-18 23:17:32 · 321 阅读 · 2 评论 -
hdu1022 Train Problem I 数据结构--栈
Train Problem ITime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 33846 Accepted Submission(s): 12744Problem DescriptionAs the n原创 2017-01-19 14:17:46 · 302 阅读 · 0 评论 -
hdu1425 sort 快速排序
sortTime Limit: 6000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 45942 Accepted Submission(s): 13263Problem Description给你n个整数,请按从大到小的顺序输出其原创 2017-02-28 18:47:09 · 679 阅读 · 0 评论 -
poj2299 马桶吸题使用 归并排序解
In this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of n distinct integers by swapping two adjacent sequence elements until the sequence is sorted i原创 2017-02-24 13:41:52 · 486 阅读 · 0 评论 -
UVA679 / UVA122 学习二叉树
详细内容翻阅紫书p148~p155#include #include #include #include #include #include #include using namespace std;int d,I;const int maxn = 1048586;int main(){ int i,t,k; scanf("%原创 2017-03-14 15:13:44 · 313 阅读 · 0 评论 -
UVA548 中序后序构造二叉树
详见字书p157代码:#include #include #include #include #include #include #include using namespace std;const int maxn = 10010;const int inf = 0x3f3f3f3f;int n;int inOrder[maxn],postOrder[maxn];原创 2017-04-20 20:08:41 · 337 阅读 · 0 评论 -
hdu5091 线段树扫描线
Recently, the γ galaxies broke out Star Wars. Each planet is warring for resources. In the Star Wars, Planet X is under attack by other planets. Now, a large wave of enemy spaceships is approaching. T原创 2017-10-02 01:31:33 · 346 阅读 · 0 评论 -
Hdu4819 Mosaic 二维线段树维护区间最值+单点更新
MosaicTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 102400/102400 K (Java/Others)Total Submission(s): 2077 Accepted Submission(s): 927Problem DescriptionThe God of sheep原创 2017-10-02 18:49:30 · 439 阅读 · 0 评论 -
2017-2018 ACM-ICPC Nordic Collegiate Programming Contest (NCPC 2017) 部分题/平衡树/最小环/思路bfs
交题地址难度按照顺序递增J - Judging Moose 队友敲的#include #include using namespace std;int main(){ int l, r; while(~scanf("%d %d", &l, &r)){ if(l == r && l != 0){ printf("Even ");原创 2017-10-30 21:34:17 · 1366 阅读 · 0 评论 -
CODE FESTIVAL 2017 qual B:C - 3 Steps 并查集判二分图、二分图性质
题目链接 题意:给一个连通的无向图,让我们往距离为三的两个不同的点添加一条边,问最终能够添加多少条边 比赛时做的没想法,官方题解讲得很清楚假设在ss和t之间存在一条长度为奇数的路径,也就是说对于某个奇数t之间存在一条长度为奇数的路径,也就是说对于某个奇数k,存在一个点的序列,存在一个点的序列s=v0,v1,...,vk=t=v_0,v_1,...,v_k=t(viv_i和vi+1v_{i+1}相原创 2017-10-24 23:48:19 · 296 阅读 · 0 评论 -
noip 2010 关押罪犯 二分图
题目链接 题目描述 S 城现有两座监狱,一共关押着N 名罪犯,编号分别为1~N。他们之间的关系自然也极不和谐。很多罪犯之间甚至积怨已久,如果客观条件具备则随时可能爆发冲突。我们用“怨气值”(一个正整数值)来表示某两名罪犯之间的仇恨程度,怨气值越大,则这两名罪犯之间的积怨越多。如果两名怨气值为c 的罪犯被关押在同一监狱,他们俩之间会发生摩擦,并造成影响力为c 的冲突事件。 每年原创 2017-10-24 23:55:19 · 285 阅读 · 0 评论 -
AOJ2170 Marked Ancestor 并查集
You are given a tree T that consists of N nodes. Each node is numbered from 1 to N, and node 1 is always the root node of T. Consider the following two operations on T:M v: (Mark) Mark node v.Q原创 2017-01-18 23:20:10 · 659 阅读 · 0 评论 -
hdu2838 Cow Sorting 树状数组
7 口碑商家客流量预测大赛》Cow SortingTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3322 Accepted Submission(s): 1118Problem Des原创 2017-01-18 23:13:18 · 310 阅读 · 0 评论 -
UVA1593 Alignment of Code 数据结构
、一开始用数组写,后来发现好傻逼啊。。。。直接用stringstream来为输入的句子去空格保存单词然后用vector来储存就行了啊。。用len数组来保存每列单词的最大长度下面是代码:#include #include #include #include #include #include #include using namespace std;vecto原创 2016-08-05 19:23:28 · 284 阅读 · 0 评论 -
hdu4006 The kth great number 优先队列
Kingdom of Black and WhiteTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1826 Accepted Submission(s): 575Problem DescriptionIn the Kin原创 2016-09-19 15:51:28 · 515 阅读 · 0 评论 -
POJ1606 Jugs BFS搜索 TWT TokyoOlympic 4combo-3
JugsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 4923 Accepted: 2883 Special JudgeDescriptionIn the movie "Die Hard 3", Bruce Willis and Samuel原创 2016-09-28 20:50:56 · 424 阅读 · 0 评论 -
POJ3414 Pots BFS搜索 TWT TokyoOlympic 4combo-2
/* ━━━━━┒ ┓┏┓┏┓┃μ'sic foever!! ┛┗┛┗┛┃\○/ ┓┏┓┏┓┃ / ┛┗┛┗┛┃ノ) ┓┏┓┏┓┃ ┛┗┛┗┛┃ ┓┏┓┏┓┃ ┛┗┛┗┛┃ ┓┏┓┏┓┃ ┛┗┛┗┛┃ ┓┏┓┏┓┃ ┃┃┃┃┃┃ ┻┻┻┻┻┻ */#include #include #include #include #include #include原创 2016-09-28 18:19:09 · 462 阅读 · 0 评论 -
玲珑1046 chess play
DESCRIPTIONBob has a n×mn×m chessboard, which has two kinds of chess pieces.one is black, and the other is white.As for chessboard, you can do three operations:1 1 x y1 1 x y (means原创 2016-11-05 20:12:41 · 310 阅读 · 0 评论 -
玲珑1052 See car
DESCRIPTIONYou are the god of cars, standing at (a, b) point.There are some cars at point (xi,yi)(xi,yi). If lots of cars and you are in one line, you can only see the car that is nearest原创 2016-11-05 20:14:53 · 310 阅读 · 0 评论 -
hdu1224 Free DIY Tour 动态规划
原题 Free DIY Tour Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 6308 Accepted Submission(s): 2038 Problem Description Weiwei原创 2016-10-15 20:30:09 · 373 阅读 · 0 评论 -
poj3295 Tautology 构造 数据结构 枚举
TautologyTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 12321 Accepted: 4695DescriptionWFF 'N PROOF is a logic game played with dice. Each die has six原创 2016-11-14 17:43:14 · 446 阅读 · 0 评论 -
poj1068 Parencodings 模拟 栈
ParencodingsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 25239 Accepted: 14884DescriptionLet S = s1 s2...s2n be a well-formed string of parentheses.原创 2016-11-15 01:40:59 · 381 阅读 · 0 评论 -
hdu5818 Joint Stacks 数据结构
Joint StacksTime Limit: 8000/4000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1398 Accepted Submission(s): 663Problem DescriptionA stack is a d原创 2016-11-22 00:27:21 · 384 阅读 · 0 评论 -
hdu4496 D-City 并查集
D-CityTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 4015 Accepted Submission(s): 1440Problem DescriptionLuxer is a really b原创 2017-01-18 23:08:47 · 395 阅读 · 0 评论 -
Educational Codeforces Round 31(ABCD):有向图求环长度/数据结构贪心
比赛地址 A. Book Reading time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Recently Luba bought a very interesting book. She know原创 2017-11-02 19:49:20 · 574 阅读 · 0 评论