自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Top_Spirit的博客

我的指针和我一样已经找到对象!

  • 博客(202)
  • 收藏
  • 关注

原创 解决git clone速度慢的问题

原因:git clone特别慢是因为github.global.ssl.fastly.net域名被限制了。只要找到这个域名对应的ip地址,然后在hosts文件中加上ip–>域名的映射,刷新DNS缓存便可。1.在网站https://www.ipaddress.com/分别搜索github.global.ssl.fastly.netgithub.com2.然后记录下对应的ip地址3.修改hosts文件Windows上的hosts文件路径在C:\Windows\Syst...

2020-11-07 08:35:28 497 1

原创 落谷 P3370 字符串哈希

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

2020-07-21 14:16:08 325

原创 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:23 285

原创 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:15:35 250

原创 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:46:02 153

原创 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:30:23 174

原创 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:38:13 162 1

原创 牛客练习赛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:50:12 148

原创 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:39:38 107

原创 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 148

原创 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 201

原创 P1019 单词接龙

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

2019-08-29 14:49:40 137

原创 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 180

原创 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 275

原创 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 150

原创 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 578

原创 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 294

原创 后缀数组 模板

#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 132

原创 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 207

原创 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 150

原创 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 164

原创 String 2019牛客暑期多校训练营(第七场)(最小表示法)

链接:https://ac.nowcoder.com/acm/contest/887/A来源:牛客网题目描述A string is perfect if it has the smallest lexicographical ordering among its cyclic rotations.For example: "0101" is perfect as it is th...

2019-08-12 16:11:04 136

原创 Problem C HDU - 5687(字典树)

度熊手上有一本神奇的字典,你可以在它里面做如下三个操作:1、insert : 往神奇字典中插入一个单词2、delete: 在神奇字典中删除所有前缀等于给定字符串的单词3、search: 查询是否在神奇字典中有一个字符串的前缀等于给定的字符串Input这里仅有一组测试数据。第一行输入一个正整数N(1≤N≤100000),代表度熊对于字典的操作次数,接下来N行,每行...

2019-07-24 09:20:48 177

原创 关于字典树最大结点数组开多大的问题

假设节点的分支数为node_Branch,字符串数量为n,字符串最大长度为len,那么最大节点数组=Arr_sizemax= n * len要证明? Ok n个字符串都不相同 即构建出来的树有n个叶子,那么满节点的深度共有k=[Log(node_Branch)n];([]代表向下取整) 那么arr_sizemax=(Branch^k)+(len-k)*n因...

2019-07-23 14:32:09 619

原创 spoj GSS1 Can you answer these queries I (线段树)

You are given a sequence A[1], A[2], ..., A[N] . ( |A[i]| ≤ 15007 , 1 ≤ N ≤ 50000 ). A query is defined as follows:Query(x,y) = Max { a[i]+a[i+1]+...+a[j] ; x ≤ i ≤ j ≤ y }.Given M queries, your pr...

2019-07-23 10:12:41 216

原创 Walk Through Squares HDU - 4758(AC自动机 + 四维状压dp)

On the beaming day of 60th anniversary of NJUST, as a military college which was Second Artillery Academy of Harbin Military Engineering Institute before, queue phalanx is a special landscape....

2019-07-18 10:05:23 166

原创 小明系列故事——女友的考验 HDU - 4511 (AC自动机+dp)

 终于放寒假了,小明要和女朋友一起去看电影。这天,女朋友想给小明一个考验,在小明正准备出发的时候,女朋友告诉他,她在电影院等他,小明过来的路线必须满足给定的规则:  1、假设小明在的位置是1号点,女朋友在的位置是n号点,则他们之间有n-2个点可以走,小明每次走的时候只能走到比当前所在点编号大的位置;  2、小明来的时候不能按一定的顺序经过某些地方。比如,如果女朋友告诉小明不能经过1 -&gt...

2019-07-17 14:31:40 427

原创 Repository HDU - 2846 (字典树)

When you go shopping, you can search in repository for avalible merchandises by the computers and internet. First you give the search system a name about something, then the system responds with the ...

2019-07-16 10:03:05 100

原创 Group HDU - 4638 (线段树离线)

There are n men ,every man has an ID(1..n).their ID is unique. Whose ID is i and i-1 are friends, Whose ID is i and i+1 are friends. These n men stand in line. Now we select an interval of men to mak...

2019-07-15 10:18:27 95

原创 No Pain No Game HDU - 4630 (线段树离线)

Life is a game,and you lose it,so you suicide.But you can not kill yourself before you solve this problem:Given you a sequence of number a1, a2, ..., an.They are also a permutation of 1...n....

2019-07-14 19:23:10 117

原创 51 nod 1711 平均数 (二分+树状数组)

LYK有一个长度为n的序列a。他最近在研究平均数。他甚至想知道所有区间的平均数,但是区间数目实在太多了。为了方便起见,你只要告诉他所有区间(n*(n+1)/2个区间)中第k大的平均数就行了。收起输入第一行两个数n,k(1<=n<=100000,1<=k<=n*(n+1)/2)。接下来一行n个数表示LYK的区间(1<=ai<=100...

2019-07-14 17:34:10 91

原创 计蒜客 青出于蓝胜于蓝 (树状数组 + dfs序)

武当派一共有nn人,门派内nn人按照武功高低进行排名,武功最高的人排名第11,次高的人排名第22,... 武功最低的人排名第nn。现在我们用武功的排名来给每个人标号,除了祖师爷,每个人都有一个师父,每个人可能有多个徒弟。我们知道,武当派人才辈出,连祖师爷的武功都只能排行到pp。也就是说徒弟的武功是可能超过师父的,所谓的青出于蓝胜于蓝。请你帮忙计算每个人的所有子弟(包括徒弟...

2019-07-14 17:31:56 187

原创 Bi-shoe and Phi-shoe LightOJ - 1370 (欧拉函数)

Bamboo Pole-vault is a massively popular sport in Xzhiland. And Master Phi-shoe is a very popular coach for his success. He needs some bamboos for his students, so he asked his assistant Bi-Shoe to g...

2019-05-24 18:47:17 90

原创 Part Acquisition POJ - 2457 (Spfa+优先队列优化+输出路径)

The cows have been sent on a mission through space to acquire a new milking machine for their barn. They are flying through a cluster of stars containing N (1 <= N <= 50,000) planets, each with...

2019-05-13 21:22:49 186

原创 Choose the best route HDU - 2680 (多源点最短路)

ne day , Kiki wants to visit one of her friends. As she is liable to carsickness , she wants to arrive at her friend’s home as soon as possible . Now give you a map of the city’s traffic route, and t...

2019-05-09 19:15:37 165

原创 Just another Robbery LightOJ - 1079 (概率DP)

As Harry Potter series is over, Harry has no job. Since he wants to make quick money, (he wants everything quick!) so he decided to rob banks. He wants to make a calculated risk, and grab as much mon...

2019-05-08 20:16:24 103

原创 Substring Frequency (II) LightOJ - 1427 (AC自动机)

A string is a finite sequence of symbols that are chosen from an alphabet. In this problem you are given a stringTandnqueries each with a stringPi, where the strings contain lower case English al...

2019-05-08 19:42:57 165

原创 string string string HDU - 6194 (后缀数组)

Uncle Mao is a wonderful ACMER. One day he met an easy problem, but Uncle Mao was so lazy that he left the problem to you. I hope you can give him a solution.Given a string s, we define a substring...

2019-05-06 20:29:12 209

原创 Codeforces E. Beautiful Subarrays (01字典树)

E. Beautiful Subarraystime limit per test3 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputOne day, ZS the Coder wrote down an array of integersa w...

2019-05-05 18:53:12 275

原创 Codeforces D. Vasiliy's Multiset (01字典树)

D. Vasiliy's Multisettime limit per test4 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAuthor has gone out of the stories about Vasiliy, so here ...

2019-05-04 11:03:32 160

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除