![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
树状数组
马角的逆袭
很菜的菜鸡
展开
-
leetcode 1562. 查找大小为 M 的最新分组 树状数组解法或并查集 巧妙
查找大小为 M 的最新分组 给你一个数组 arr ,该数组表示一个从 1 到 n 的数字排列。有一个长度为 n 的二进制字符串,该字符串上的所有位最初都设置为 0 。 在从 1 到 n 的每个步骤 i 中(假设二进制字符串和 arr 都是从 1 开始索引的情况下),二进制字符串上位于位置 arr[i] 的位将会设为 1 。 给你一个整数 m ,请你找出二进制字符串上存在长度为 m 的一组 1 的最后步骤。一组 1 是一个连续的、由 1 组成的子串,且左右两边不再有可以延伸的 1 。 返回存在长度 恰好 .原创 2020-08-26 15:14:45 · 106 阅读 · 0 评论 -
Educational Codeforces Round 87 (Rated for Div. 2) D. Multiset 树状数组+二分
Note that the memory limit is unusual. You are given a multiset consisting of n integers. You have to process queries of two types: add integer k into the multiset; find the k-th order statistics in the multiset and remove it. k-th order statistics in the原创 2020-05-18 17:00:15 · 152 阅读 · 0 评论