目录 并查集基础 1971. 寻找图中是否存在路径 684.冗余连接 685.冗余连接II 并查集基础 并查集主要有三个功能。 寻找根节点,函数:find(int u),也就是判断这个节点的祖先节点是哪个将两个节点接入到同一个集合,函数:join(int u, int v),将两个节点连在同一个根节点上判断两个节点是否在同一个集合,函数:isSame(int u, int v
题目链接:https://codeforc.es/contest/1451/problem/C Ashish has two strings a and b, each of length n, and an integer k. The strings only contain lowercase English letters. He wants to convert string a i
题目链接:https://codeforc.es/contest/1451/problem/D Utkarsh is forced to play yet another one of Ashish’s games. The game progresses turn by turn and as usual, Ashish moves first. Consider the 2D plane.
传送门 本题题意就是两个人相互对一个矩阵进行操作: 选定一个起点 ( r 1 , c 1 ) (r_1,c_1) (r1,c1),一个终点 ( r 2 , c 2 ) (r_2,c_2) (r2,c2),满足 r 2 ≥ r 1 , c 2 ≥ c 1 r_2\ge r_1,c_2\ge c_1 r2≥r1,c2≥c1。减少 a [ r 1 ] [ c 1 ] a[r_1][c