3 Top_Spirit

尚未进行身份认证

我要认证

此人真的不懒!

等级
TA的排名 3w+

落谷 P3370 字符串哈希

题目描述如题,给定N个字符串(第i个字符串长度为Mi,字符串内包含数字、大小写字母,大小写敏感),请求出N个字符串中共有多少个不同的字符串。输入输出格式输入格式:第一行包含一个整数N,为字符串的个数。接下来N行每行包含一个字符串,为所提供的字符串。输出格式:输出包含一行,包含一个整数,为不同的字符串个数。输入输出样例输入样例#1:复制...

2019-01-14 15:17:03

19年牛客暑期多校训练营第五场 B-generator 1 (十进制矩阵快速幂)

链接:https://ac.nowcoder.com/acm/contest/885/B来源:牛客网题目描述You are given four positive integers x0,x1,a,bx_0, x_1, a, bx0​,x1​,a,b. And you know xi=a⋅xi−1+b⋅xi−2x_i = a \cdot x_{i-1} + b \cdot x_{i...

2019-10-02 11:17:19

P1226 【模板】快速幂||取余运算 洛谷(十进制思路)

题目描述输入b,p,k的值,求b^p mod k的值。其中b,p,k*k为长整型数。输入格式三个整数b,p,k.输出格式输出“b^p mod k=s”s为运算结果输入输出样例输入 #12 10 9输出 #12^10 mod 9=7例如3^405可以拆分为 (3 ^1) ^5 * ( 3^10 ) ^0 * (3 ^ 100) ^ 4....

2019-10-02 11:12:41

CA Loves Palindromic (回文自动机)

CA loves strings, especially loves the palindrome strings.One day he gets a string, he wants to know how many palindromic substrings in the substring S[l,r].Attantion, each same palindromic subst...

2019-09-12 19:44:26

Palindromes and Super Abilities (回文自动机)

After solving seven problems on Timus Online Judge with a word “palindrome” in the problem name, Misha has got an unusual ability. Now, when he reads a word, he can mentally count the number of uniqu...

2019-09-12 18:28:58

A - Palisection (Manacher)

In an English class Nick had nothing to do at all, and remembered about wonderful strings called palindromes. We should remind you that a string is called a palindrome if it can be read the same way ...

2019-09-11 20:31:07

牛客练习赛51 子串查询 (序列自动机)

链接:https://ac.nowcoder.com/acm/contest/1083/B来源:牛客网题目描述给出一个长度为n的字符串s和q个查询。对于每一个查询,会输入一个字符串t,你需要判断这个字符串t是不是s的子串。子串的定义就是存在任意下标a<b<c<d<e,那么”s[a]s[b]s[c]s[d]s[e]”就构成s的一个子串。如”abc”的子串有”a...

2019-09-11 18:49:36

2019牛客暑期多校训练营(第十场) Coffee Chicken(DFS)

链接:https://ac.nowcoder.com/acm/contest/890/B来源:牛客网Dr. JYY has just created the Coffee Chicken strings, denoted as S(n). They are quite similar to the Fibonacci soup --- today's soup is made by m...

2019-09-06 18:38:35

K - Relevant Phrases of Annihilation (后缀数组 + 二分)

You are the King of Byteland. Your agents have just intercepted a batch of encrypted enemy messages concerning the date of the planned attack on your island. You immedietaly send for the Bytelandian ...

2019-08-30 16:17:55

L - Substrings POJ - 1226 (后缀数组+二分)

You are given a number of case-sensitive strings of alphabetic characters, find the largest string X, such that either X, or its inverse can be found as a substring of any of the given strings.Inpu...

2019-08-30 09:57:40

P1019 单词接龙

题目描述单词接龙是一个与我们经常玩的成语接龙相类似的游戏,现在我们已知一组单词,且给定一个开头的字母,要求出以这个字母开头的最长的“龙”(每个单词都最多在“龙”中出现两次),在两个单词相连时,其重合部分合为一部分,例如 beastbeastbeast和astonishastonishastonish,如果接成一条龙则变为beastonishbeastonishbeastonish,另外相邻的...

2019-08-29 14:49:40

J - Life Forms POJ - 3294 (后缀数组 + 二分)

You may have wondered why most extraterrestrial life forms resemble humans, differing by superficial traits such as height, colour, wrinkles, ears, eyebrows and the like. A few bear no human resembla...

2019-08-29 10:39:39

I - Common Substrings POJ - 3415 (后缀数组+单调栈)

A substring of a string T is defined as:T( i, k)= TiTi +1... Ti+k -1, 1≤ i≤ i+k-1≤| T|.Given two strings A, B and one integer K, we define S, a set of triples (i, j, k):S = {( i, j, k)...

2019-08-28 15:39:55

G - Maximum repetition substring (后缀数组)

The repetition number of a string is defined as the maximum number R such that the string can be partitioned into R same consecutive substrings. For example, the repetition number of "ababab" is 3 an...

2019-08-27 15:27:37

K-th occurrence 2019中国大学生程序设计竞赛(CCPC) - 网络选拔赛 (后缀数组+主席树+RMQ)

Problem DescriptionYou are given a string S consisting of only lowercase english letters and some queries.For each query (l,r,k), please output the starting position of the k-th occurence of the s...

2019-08-27 08:57:35

E - Acesrc and String Theory 19多校 (后缀数组)

Acesrc is a famous string theorist at Nanjing University second to none. He insists that we should always say an important thing k times. He also believes that every string that can be obtained by co...

2019-08-26 22:27:25

后缀数组 模板

#include <bits/stdc++.h>using namespace std;const int Maxn = 100010;/**suffix array*倍增算法 O(n*logn)*待排序数组长度为n,放在0~n-1中,在最后面补一个0*build_sa( ,n+1, );//注意是n+1;*getHeight(,n);*例如:*n = 8;...

2019-08-24 14:38:45

I - I Love Palindrome String 19多校(回文自动机+hash)

You are given a string S=s1s2..s|S| containing only lowercase English letters. For each integer i∈[1,|S|] , please output how many substrings slsl+1...sr satisfy the following conditions:∙ r−l+1 equ...

2019-08-22 19:23:10

Snowy Smile 19多校(线段树)

There are n pirate chests buried in Byteland, labeled by 1,2,…,n. The i-th chest's location is (xi,yi), and its value is wi, wi can be negative since the pirate can add some poisonous gases into the ...

2019-08-22 18:43:16

Codeforces A. Knight Tournament (线段树)

A. Knight Tournamenttime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputHooray! Berl II, the king of Berland is making a knight tou...

2019-08-13 13:25:02

查看更多

勋章 我的勋章
  • GitHub
    GitHub
    绑定GitHub第三方账户获取
  • 签到新秀
    签到新秀
    累计签到获取,不积跬步,无以至千里,继续坚持!
  • 持之以恒
    持之以恒
    授予每个自然月内发布4篇或4篇以上原创或翻译IT博文的用户。不积跬步无以至千里,不积小流无以成江海,程序人生的精彩需要坚持不懈地积累!
  • 勤写标兵Lv4
    勤写标兵Lv4
    授予每个自然周发布9篇以上(包括9篇)原创IT博文的用户。本勋章将于次周周三上午根据用户上周的博文发布情况由系统自动颁发。