摘要:
用于较大规模数据的非递归的启发式合并/按秩合并并查集。 解决爆栈RE问题。 顺带连通块计数。 cpp include using namespace std; typedef long long ll; int n,m,x,y,z; namespace Disjoint_Set_Union { co 阅读全文
摘要:
终于搞明白了。根据某定理,最少需要的防御系统的数量就是最长上升子序列的数量。 呵呵手写二分果然功能很多,想清楚自己要找的是什么就可以了。 cpp include using namespace std; typedef long long ll; const int INF=0x3f3f3f3f; 阅读全文
摘要:
https://www.luogu.org/fe/problem/P2439 很明显时间是一个维度,按照时间顺序决策就行了。 dp[i]表示以时间i为结尾所能达到的最长演讲时间。 cpp include using namespace std; typedef long long ll; int n 阅读全文