959专题

LeetCode - 959. 由斜杠划分区域

说明:很明显这是一个求连通分量的问题,最开始我发现将一个格子划分为4个小格子无法求解,但是可以划分为16个小格子,因此划分为16个小格子后的深度/广度优先遍历都可以完成,但是效率很低,我发现讨论里面有同学讲一个格子划分为9个小格子也可以解决,分析了下确认如此,因此方法一,二都是深度/广度优先遍历,分别采用两种划分实现了一遍,不过不管16个格子还是9个格子,效率都较低,最后并查集的方法我没有想到怎么

CodeForces 959 E Mahmoud and Ehab and the xor-MST(异或 思维)

Description Ehab is interested in the bitwise-xor operation and the special graphs. Mahmoud gave him a problem that combines both. He has a complete graph consisting of n vertices numbered from 0 to

959. Regions Cut By Slashes(Leetcode每日一题-2021.01.25)--抄答案

Problem In a N x N grid composed of 1 x 1 squares, each 1 x 1 square consists of a /, , or blank space. These characters divide the square into contiguous regions. (Note that backslash characters ar