
并查集
文章平均质量分 88
2997ms
这个作者很懒,什么都没留下…
展开
-
POJ1611 && POJ2524 并查集入门
The SuspectsTime Limit: 1000MS Memory Limit: 20000KTotal Submissions: 28293 Accepted: 13787DescriptionSevere acute respiratory syndrome (SARS), an atypical pneu原创 2015-10-02 10:45:06 · 329 阅读 · 0 评论 -
POJ1703 && POJ2942 &&POJ 1182 并查集 这个做法挺巧妙
Find them, Catch themTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 37242 Accepted: 11483DescriptionThe police office in Tadu City decides to say end原创 2015-10-02 15:51:58 · 494 阅读 · 0 评论 -
51nod 1515:明辨是非 并查集合并
1515 明辨是非题目来源: 原创基准时间限制:1 秒 空间限制:131072 KB 分值: 160 难度:6级算法题 收藏 关注给n组操作,每组操作形式为x y p。当p为1时,如果第x变量和第y个变量可以相等,则输出YES,并限制他们相等;否则输出NO,并忽略此次操作。当p为0时,如果第x变量和第y个变量可原创 2015-10-14 22:02:34 · 1100 阅读 · 2 评论 -
Zenefits CodeSprint:Knight or Knave
题意是一堆人,从1到n编号,每个人i说一句话,x。x是正数表示i说x君是个好人,x是负数表示i说x君是坏人。问这个群体中最多能有多少好人,把这种情况用字典序的方式输出(好人用A表示,坏人用B表示),希望我把题意说清楚了。又做了一道Hackerrank上一道很好玩的题目,做的时候怎么都想不出来。。。但看完了题解之后,又发现这个题目。。。其实这个思路以前做并查集的时候有过,就是每个人就两种原创 2015-11-22 21:22:10 · 691 阅读 · 0 评论 -
51nod 1204:Parity 并查集
1204 Parity题目来源: Ural基准时间限制:1 秒 空间限制:131072 KB 分值: 80 难度:5级算法题 收藏 关注你的朋友写下一串包含1和0的串让你猜,你可以从中选择一个连续的子串(例如其中的第3到第5个数字)问他,该子串中包含了奇数个还是偶数个1,他会回答你的问题,然后你可以继续提问......你怀疑朋友的原创 2016-01-18 22:45:32 · 886 阅读 · 0 评论 -
51nod 1456:小K的技术
1456 小K的技术题目来源: CodeForces基准时间限制:1 秒 空间限制:131072 KB 分值: 80 难度:5级算法题 收藏 关注苏塞克王国是世界上创新技术的领先国家,在王国中有n个城市,标记为1到n。由于小K的研究,我们最终能过在两个城市之间建立传输管道,一个传输管道能单向连接两个城市,即,一个从城市原创 2016-01-30 17:24:19 · 981 阅读 · 1 评论 -
Codeforces 506D:Mr. Kitayuta's Colorful Graph 并查集
D. Mr. Kitayuta's Colorful Graphtime limit per test4 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputMr. Kitayuta has just boug原创 2016-02-01 21:34:48 · 987 阅读 · 0 评论 -
Codeforces 651E:Table Compression
E. Table Compressiontime limit per test4 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputLittle Petya is now fond of data compr原创 2016-03-09 18:10:01 · 908 阅读 · 0 评论 -
bnu 49100:超级线段树
超级线段树Time Limit: 5000msMemory Limit: 65536KB64-bit integer IO format: %lld Java class name: MainPrev Submit Status Statistics Discuss NextType: None原创 2016-04-07 22:18:18 · 406 阅读 · 0 评论