摘要:
一、递归版 s = ["1","2","3"] n = len(s) def dfs(l): if l == n: print(*s) return vis = set() for i in range(l,n): # 防止重复数字,造成答案重复 if i == l or s[i] not in v 阅读全文
摘要:
参考链接:https://www.cnblogs.com/dx123/p/16320467.html(感谢董晓老师) 树链剖分求LCA 比倍增快一些 https://www.luogu.com.cn/problem/P3379 #include<bits/stdc++.h> const int N 阅读全文
摘要:
D 题目链接 https://atcoder.jp/contests/abc325/tasks/abc325_d 题目大意 题目思路 贪心,每一次优先选取最先出去的,优先队列! 题目代码 #include<bits/stdc++.h> #define ll long long using names 阅读全文