#girls2[超话]#|#ガールズガールズ #
Girls²生产化妆品「you know...?」
9人女子团体Girls²制作化妆品!「you know...?」
以“成为新自我的关键”为主题,充满了成员们的承诺的特别项目阵容。
3/30(星期三)开始网上预购!
Shine to you shadow 2,100日元(含税)全3色
Shine to you tint 1,500日元(含税)全5色
Girls²生产化妆品「you know...?」
9人女子团体Girls²制作化妆品!「you know...?」
以“成为新自我的关键”为主题,充满了成员们的承诺的特别项目阵容。
3/30(星期三)开始网上预购!
Shine to you shadow 2,100日元(含税)全3色
Shine to you tint 1,500日元(含税)全5色
#金采炫[超话]# #新人MC金采炫#
【Photo】220217 饭推更新 采炫相关
visual cam 金采炫拍立得
在拍立得后面给写了love you...
金sweet老虎采炫
cr.sommchae
翻译-餐包
【嗷呜小盒】https://t.cn/A6iQGJT7
【无门槛kp群‼️急需】https://t.cn/A6fpY8aa
【新粉必看‼️】https://t.cn/A6MEbrgN
【刷教程】https://t.cn/A6xa9Bs9
【UNIVERSE翻译群】https://t.cn/A6JZmn7h
急招‼️韩翻‼️美工‼️资源
【Photo】220217 饭推更新 采炫相关
visual cam 金采炫拍立得
在拍立得后面给写了love you...
金sweet老虎采炫
cr.sommchae
翻译-餐包
【嗷呜小盒】https://t.cn/A6iQGJT7
【无门槛kp群‼️急需】https://t.cn/A6fpY8aa
【新粉必看‼️】https://t.cn/A6MEbrgN
【刷教程】https://t.cn/A6xa9Bs9
【UNIVERSE翻译群】https://t.cn/A6JZmn7h
急招‼️韩翻‼️美工‼️资源
1719. Number Of Ways To Reconstruct A Tree
You are given an array pairs, where pairs[i] = [xi, yi], and:
There are no duplicates.
xi < yi
Let ways be the number of rooted trees that satisfy the following conditions:
The tree consists of nodes whose values appeared in pairs.
A pair [xi, yi] exists in pairs if and only if xi is an ancestor of yi or yi is an ancestor of xi.
Note: the tree does not have to be a binary tree.
Two ways are considered to be different if there is at least one node that has different parents in both ways.
Return:
0 if ways == 0
1 if ways == 1
2 if ways > 1
A rooted tree is a tree that has a single root node, and all edges are oriented to be outgoing from the root.
An ancestor of a node is any node on the path from the root to that node (excluding the node itself). The root has no ancestors.
解题重点:
1. 题目的意思是,pairs如果能构成树,那pairs的结对和树拆散后要一致,不能有多余的节点。
2. 通过假设pairs能构成树,找到一些规律,或者推论。节点总数为n,节点 x 的祖先和后代的节点集合表示 adj[x]
3. 根结点为root, 有adj[root]的数量为n-1
4. 如果x为y的祖先,则有len(adj[x]) >= len(adj[y]),adj[y]是adj[x]的子集。
5. 如果x为y的祖先,且adj[xi]=adj[yi],则此时构成树的方案数一定不是唯一的。
6.找父节点,依次跟父节点对比。父节点:节点 x 满足 len(adj[x])最小且 len(adj[x])>= len(ajd[node])。判断子集关系,判断节点数量,相等则有多种可能。
You are given an array pairs, where pairs[i] = [xi, yi], and:
There are no duplicates.
xi < yi
Let ways be the number of rooted trees that satisfy the following conditions:
The tree consists of nodes whose values appeared in pairs.
A pair [xi, yi] exists in pairs if and only if xi is an ancestor of yi or yi is an ancestor of xi.
Note: the tree does not have to be a binary tree.
Two ways are considered to be different if there is at least one node that has different parents in both ways.
Return:
0 if ways == 0
1 if ways == 1
2 if ways > 1
A rooted tree is a tree that has a single root node, and all edges are oriented to be outgoing from the root.
An ancestor of a node is any node on the path from the root to that node (excluding the node itself). The root has no ancestors.
解题重点:
1. 题目的意思是,pairs如果能构成树,那pairs的结对和树拆散后要一致,不能有多余的节点。
2. 通过假设pairs能构成树,找到一些规律,或者推论。节点总数为n,节点 x 的祖先和后代的节点集合表示 adj[x]
3. 根结点为root, 有adj[root]的数量为n-1
4. 如果x为y的祖先,则有len(adj[x]) >= len(adj[y]),adj[y]是adj[x]的子集。
5. 如果x为y的祖先,且adj[xi]=adj[yi],则此时构成树的方案数一定不是唯一的。
6.找父节点,依次跟父节点对比。父节点:节点 x 满足 len(adj[x])最小且 len(adj[x])>= len(ajd[node])。判断子集关系,判断节点数量,相等则有多种可能。
✋热门推荐