摘要:
#include<iostream> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; const int N = 1e6 + 10, M = 2010; int n, m; int a[N]; i 阅读全文
摘要:
本题要快速找到某个数字在数组中左边<=它的数的最小下标。 可以建立一个权值线段树,nums[i]处维护最小下标。 class Solution { public: const static int N = 50010, INF = 0x3f3f3f3f; struct Node { int l, r 阅读全文
摘要:
2903. 找出满足差值条件的下标 I 2905. 找出满足差值条件的下标 II 这两个题只有数据范围上面的差距 这个题我们大体思路是维护双指针,枚举数字,维护集合。 这是灵神视频的代码 class Solution: def findIndices(self, nums: List[int], i 阅读全文