题意:找出文本串中字典序第 k 大的字符串 思路: 首先我们不能仅仅按后缀数组排完序后每个字符串的大小来找,因为重复字符也参与排名,比如 AAB 2, 结果是 A 而不是 AA。 注:以下第 i 个后缀均指排完序后第 i 小的后缀。 所以我们二分找第 k 大的字符串位于哪个区间,假定我们现在确定目标 ...
分类:
编程语言 时间:
2020-07-17 22:05:37
阅读次数:
71
http://poj.org/problem?id=2406 http://poj.org/problem?id=1961 几乎是一个题 1961是对于第 \(i\) 位,求 \([1,i]\) 能不能由一段字符循环一次以上组成,输出 \(i\) 和这样的长度最小的循环节循环次数 2406是只对第 ...
分类:
其他好文 时间:
2020-07-17 13:49:40
阅读次数:
47
Tom and Jerry are going on a vacation. They are now driving on a one-way road and several cars are in front of them. To be more specific, there are nn ...
分类:
其他好文 时间:
2020-07-17 09:30:42
阅读次数:
82
Pass a year learning in Hangzhou, yifenfei arrival hometown Ningbo at finally. Leave Ningbo one year, yifenfei have many people to meet. Especially a ...
分类:
其他好文 时间:
2020-07-17 01:14:23
阅读次数:
90
Running Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 8597 Accepted: 3213 Description The cows are trying to become better athletes, so B ...
分类:
其他好文 时间:
2020-07-16 18:10:43
阅读次数:
60
一个数最多能取8-9次根号。 #include <bits/stdc++.h> using namespace std; #define debug printf("bug!!!\n"); typedef long long ll; const int MAXN=1e5+10; const ll M ...
分类:
其他好文 时间:
2020-07-16 10:11:53
阅读次数:
74
链接:https://leetcode-cn.com/problems/subsets-ii/ 代码 class Solution { public: vector<vector<int>> ans; vector<int> path; vector<vector<int>> subsetsWith ...
分类:
其他好文 时间:
2020-07-16 00:27:10
阅读次数:
75
重新做了一下这道并查集的题目,关键要点是抓住这种循环的关系和模运算的通性,进而利用加权并查集 #include <cstdio> #include <iostream> #include <algorithm> #include <cstring> using namespace std; cons ...
分类:
其他好文 时间:
2020-07-15 23:39:09
阅读次数:
63
Description A wqb-number, or B-number for short, is a non-negative integer whose decimal form contains the sub- string "13" and can be divided by 13. ...
分类:
其他好文 时间:
2020-07-15 23:20:22
阅读次数:
96
题目链接:http://poj.org/problem?id=2482 给出每个点框定的区域,求区域叠加的最大值,可以通过如下算法: 将每个可行点都标记,记录这些点上的权值,维护一个叶结点是一个权值点的线段树,更新的时候注意,由于所有的点都是可行点,所以右边界要在最后删除,遇到同样的x坐标的,优先叠 ...
分类:
编程语言 时间:
2020-07-15 15:23:49
阅读次数:
68