목록유니온-파인드 (2)
넘치게 채우기
https://www.acmicpc.net/problem/18116BOJ - 로봇 조립문제 유형: 유니온-파인드, 분리 집합문제 난이도 : Gold IV시간 제한: 4초메모리 제한: 1024MB 문제성규는 로봇을 조립해야 한다. 상자 안에는 여러 로봇의 부품들이 섞여 있다. 그런데 어떤 부품이 어느 로봇의 부품인지 표시가 되어있지 않다. 호재는 전자과라서 두 부품을 보면 같은 로봇의 부품인지 알 수 있다. 그래서 성규는 호재의 지시에 따라 부품들을 정리하기로 하였다.부품들은 1부터 106까지의 정수로 표현된다. 그리고 부품 i가 속한 로봇은 robot(i)라고도 표현한다. 예를 들어, 부품 11과 부품 22가 로봇 A의 부품이라고 알고 있는 경우, robot(11)은 로봇 A를 의미하고, robot(22..

https://leetcode.com/problems/most-stones-removed-with-same-row-or-column/description/?envType=daily-question&envId=2024-08-29leetcode - Most Stones Removed with Same Row or Column문제 유형 : 유니온-파인드문제 난이도 : Medium 문제On a 2D plane, we place n stones at some integer coordinate points. Each coordinate point may have at most one stone.A stone can be removed if it shares either the same row or the same ..