1.Algorithm - at least one leetcode problem per week(Medium+) 986. Interval List Intersections https://leetcode.com/problems/interval-list-intersections/ Medium Basic sorting and one time scan, be sure to process the start and end of each interval,…
传送门 题解可以参见zjjzjjzjj神仙的,写的很清楚. 代码: #include<bits/stdc++.h> #define ri register int using namespace std; typedef long long ll; const int mod=1e9+7; inline int add(const int&a,const int&b){return a+b>=mod?a+b-mod:a+b;} inline int dec(const i…
传送门 题意:给你一棵带点权的树,多次询问路径的最大异或和. 思路: 线性基上树?? 倍增维护一下就完了. 时间复杂度O(nlog3n)O(nlog^3n)O(nlog3n) 代码: #include<bits/stdc++.h> #define ri register int #define fi first #define se second using namespace std; typedef long long ll; const int rlen=1<<18|1; i…