![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
并查集
Dejavu1z
做题,总结,不断的学习
展开
-
codeforces 722C(带权并查集+反向思维)
题意描述You are given an array consisting of n non-negative integers a 1, a 2, …, a n.You are going to destroy integers in the array one by one. Thus, you are given the permutation of integers from 1 to n defining the order elements of the array are destroye原创 2020-07-28 15:01:37 · 277 阅读 · 0 评论 -
扩散(二分答案+并查集)
题目描述一个点每过一个单位时间就会向四个方向扩散一个距离,两个点a、b连通,记作e(a,b),当且仅当a、b的扩散区域有公共部分。连通块的定义是块内的任意两个点u、v都必定存在路径e(u,a0),e(a0,a1),…,e(ak,v)。给定平面上的n给点,问最早什么时刻它们形成一个连通块。思路我们可以二分答案,然后对于每个时间,判断每个点之间的曼哈顿距离是否小于时间的两倍(因为两个点是一起扩散的)。AC代码#include<bits/stdc++.h>#define x first#原创 2020-07-08 18:17:14 · 363 阅读 · 0 评论 -
codeforce893C (并查集)
题意描述Vova promised himself that he would never play computer games… But recently Firestorm — a well-known game developing company — published their newest game, World of Farcraft, and it became really...原创 2020-05-08 16:00:44 · 402 阅读 · 1 评论 -
HDU1213 (并查集)
题意描述Today is Ignatius’ birthday. He invites a lot of friends. Now it’s dinner time. Ignatius wants to know how many tables he needs at least. You have to notice that not all the friends know each oth...原创 2020-03-05 20:59:42 · 276 阅读 · 0 评论 -
POJ1611 (并查集)
题意描述Severe acute respiratory syndrome (SARS), an atypical pneumonia of unknown aetiology, was recognized as a global threat in mid-March 2003. To minimize transmission to others, the best strategy is...原创 2020-03-03 15:54:53 · 196 阅读 · 0 评论 -
POJ2236 (并查集)
题意描述An earthquake takes place in Southeast Asia. The ACM (Asia Cooperated Medical team) have set up a wireless network with the lap computers, but an unexpected aftershock attacked, all computers in ...原创 2020-03-03 17:13:28 · 183 阅读 · 0 评论