摘要: 思路 这道题目很像找 \(2\) 头牛的最近公共祖先,即 lca, 但是并不用那么麻烦. 因为数据很小,我们可以写一个 山寨版 的 lca.具体如下. int mother(string x, string y) { int res = 0; while (y != "") { // 有名字的牛 i 阅读全文
posted @ 2024-11-17 21:58 Panda_LYL 阅读(35) 评论(0) 推荐(0)