摘要:
1.op:插入O(N)、查找O(N)、删除 时间复杂度:O(N) N:串的长度 空间复杂度:O(N*C) N:节点个数 C:字符集大小 2.op:插入O(N)、查找O(N)、删除 3.ap: 查询前缀,比如说判断a串是否是b串的前缀。 判断一个串是否在树中出现过。 4.优点:比较省时间,因为有26个 阅读全文
摘要:
Let x and y be two strings over some finite alphabet A. We would like to transform x into y allowing only operations given below: Deletion: a letter i 阅读全文
摘要:
如何定义?(初始化) 1. pair<int,int>p; 2.定义即初始化,也可以这个样子 pair<int,int>p(1,1); 里面的类型还可以是string,double等。 3.还可以这样子初始化 pair<int,int>p; p=make_pair(2,3); 如何调用? pair< 阅读全文
摘要:
After winning gold and silver in IOI 2014, Akshat and Malvika want to have some fun. Now they are playing a game on a grid made of n horizontal and m 阅读全文
摘要:
The only difference between easy and hard versions is constraints. You are given nn segments on the coordinate axis OXOX. Segments can intersect, lie 阅读全文
摘要:
kmp算法的时间复杂度是O(m+n) 主要作用: 1.最长公共前后缀问题 2.原串中含有几个模式串问题 3.循环节问题 阅读全文
摘要:
Given a list of phone numbers, determine if it is consistent in the sense that no number is the prefix of another. Let's say the phone catalogue liste 阅读全文
摘要:
The only difference between easy and hard versions is the maximum value of n. You are given a positive integer number nn. You really love good numbers 阅读全文
摘要:
题意:给出n、c,表示有n层楼,等电梯需要c时间;给出两行数,每行有n-1个数,第一行stairs代表从1楼到每层楼走楼梯需要的时间第二行elevator代表从1楼到每层楼乘电梯需要的时间;需要注意的是,从电梯转电梯不需要等待时间,从楼梯转楼梯也不需要等待时间,但是从楼梯转电梯需要算上等待的时间 t 阅读全文
摘要:
一般搜索 注意:一般定义成void Books Exchange (easy version) CodeForces - 1249B2 The only difference between easy and hard versions is constraints. There are nn ki 阅读全文