这道题注意要是不重叠的,一开始这里WA了一次
其他的思路应该挺简单的
#include
#include
#include
using namespace std;
#define N 100100
int r[N];
char s[11][10005];
int wa[N],wb[N],wv[N],ws[N];
int sa[N],rank[N],height[N];
int m[N];...
分类:
其他好文 时间:
2015-04-19 11:38:23
阅读次数:
165
he Tetris game is one of the most popular computer games ever created. The original game was designed and programmed by a Russian programmerAlexey Paj...
分类:
其他好文 时间:
2015-04-18 14:31:26
阅读次数:
166
这里使用的Intellij IDEA的版本是14.1.1,使用maven构建的项目是Rank,rank是一个seo工具,用于分析网站的搜索引擎收录排名。? 1、将项目FORK到自己的GITHUB主页,如何FORK参考这里的入门指南链接,然后从自己的...
分类:
其他好文 时间:
2015-04-16 23:52:11
阅读次数:
344
假设现在有一张学生表student,学生表中有姓名、分数、课程编号,现在我需要按照课程对学生的成绩进行排序。
select * from student
1. rank over ()可以实现对学生排名,特点是成绩相同的两名是并列,如下1 2 2 4 5
2. dense_rank()和rank over()很像,但学生成绩并列后并不会空出并列所占的名次,如下1 2 2...
分类:
数据库 时间:
2015-04-16 15:46:25
阅读次数:
139
刚开始求height数组的地方写错了,看来还是理解不够透彻啊
所有的子串减去重复的子串
//先在草稿纸上把思想想清楚再动手,不要只是有个大概的思想,不然容易出错
#include
#include
#include
using namespace std;
#define N 10005
int n;
char s[N];
int r[N],sa[N],height[N],rank[N],...
分类:
其他好文 时间:
2015-04-15 14:56:59
阅读次数:
202
并查集:(union-find sets)是一种简单的用途广泛的集合. 并查集是若干个不相交集合,能够实现较快的合并和判断元素所在集合的操作,应用很多。一般采取树形结构来存储并查集,并利用一个rank数组来存储集合的深度下界,在查找操作时进行路径压缩使后续的查找操作加速。这样优化实现的并查集,空间复杂度为O(N),建立一个集合的时间复杂度为O(1),N次合并M查找的时间复杂度为O(M Alpha(N)),这里Alpha是Ackerman函数的某个反函数,在很大的范围内(人类目前观测到的宇宙范围估算有10的8...
分类:
其他好文 时间:
2015-04-14 23:23:30
阅读次数:
317
刚开始看到最大值要取到1000000,当时就吓尿了,心想难道要改排序算法?
赶紧看了下讨论,发现数据很水,200000就能过了
思路:就是答案二分,然后长度分组,满足条件返回true
#include
#include
using namespace std;
#define N 200005
int n,k;
int r[N],height[N],sa[N],rank[N];
int wa...
分类:
其他好文 时间:
2015-04-14 11:12:16
阅读次数:
142
后缀数组水题
先求所有的子串数,根据长度枚举,共(n+1)*n/2种
当height[i]>0时,说明height[i]这个前缀与其他子串相同,减去这height[i]个子串
#include
#include
#include
using namespace std;
#define N 1005
int r[N],sa[N],height[N],rank[N],wa[N],wb[N],w...
分类:
其他好文 时间:
2015-04-14 09:59:40
阅读次数:
125
Write a SQL query to rank scores. If there is a tie between two scores, both should have the same ranking. Note that after a tie, the next ranking number should be the next consecutive integer value. ...
分类:
其他好文 时间:
2015-04-13 09:43:20
阅读次数:
119
题目描述:标题:打印图形 小明在X星球的城堡中发现了如下图形和文字:rank=3 rank=5 ran=6 小明开动脑筋,编写了如下的程序,...
分类:
编程语言 时间:
2015-04-10 23:43:08
阅读次数:
211