F - The Minimum Length】的更多相关文章

F - The Minimum Length HUST - 1010 #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> using namespace std; int len; ]; ]; void getnet(){ memset(net,,sizeof(net)); net[]=-; ,j=; while(j<len){ ||s[k]==s[j]){…
F - The Minimum Length Time Limit:1000MS     Memory Limit:131072KB     64bit IO Format:%lld & %llu Submit Status Description There is a string A. The length of A is less than 1,000,000. I rewrite it again and again. Then I got a new string: AAAAAA...…
http://acm.hust.edu.cn/vjudge/contest/view.action?cid=70325#problem/F The Minimum Length Time Limit:1000MS     Memory Limit:131072KB     64bit IO Format:%lld & %llu Submit Status Practice HUST 1010 Description There is a string A. The length of A is…
[cf contest 893(edu round 33)] F - Subtree Minimum Query time limit per test 6 seconds memory limit per test 512 megabytes input standard input output standard output You are given a rooted tree consisting of n vertices. Each vertex has a number writ…
The Minimum Length Problem's Link: http://acm.hust.edu.cn/problem/show/1010 Mean: 给你一个字符串,求这个字符串的最小循环节. analyse: KMP之next数组的运用.裸的求最小循环节. Time complexity: O(N) Source code:  ;;;);      ;}/* */…
地址:http://acm.hust.edu.cn/problem/show/1010 题目: 1010 - The Minimum Length Time Limit: 1s Memory Limit: 128MB Submissions: 2502 Solved: 925 DESCRIPTION There is a string A. The length of A is less than 1,000,000. I rewrite it again and again. Then I g…
题意 给定一棵 \(n\) 个点的带点权树,以 \(1\) 为根, \(m\) 次询问,每次询问给出两个值 \(p, k\) ,求以下值: \(p\) 的子树中距离 \(p \le k\) 的所有点权最小值,询问强制在线. \(n \le 10^5 , m \le 10^6, TL = 6s\) 题解 如果不强制在线,直接线段树合并就做完了. 强制在线,不难想到用一些可持久化的结构来维护这些东西. 其实可以类似线段树合并那样考虑,也就是说每次合并的时候我们依然使用儿子的信息. 只要在合并 \(x…
There is a string A. The length of A is less than 1,000,000. I rewrite it again and again. Then I got a new string: AAAAAA...... Now I cut it from two different position and get a new string B. Then, give you the string B, can you tell me the length…
题意: 有一个字符串A,假设A是“abcdefg”,  由A可以重复组成无线长度的AAAAAAA,即“abcdefgabcdefgabcdefg.....”. 从其中截取一段“abcdefgabcdefgabcdefgabcdefg”,取红色部分为截取部分,设它为字符串B. 现在先给出字符串B, 求A最短的长度. 分析: 设字符串C = AAAAAAAA....  由于C是由无数个A组成的,所以里面有无数个循环的A, 那么从C中的任意一个起点开始,也都可以有一个循环,且这个循环长度和原来的A一样…
题意:有个一字符串A(本身不是循环串),然后经过很多次自增变成AAAAA,然后呢从自增串里面切出来一部分串B,用这个串B求出来A的长度.   分析:其实就是求最小循环节.......串的长度 - 最大的匹配. 代码如下. =========================================================================================================== #include<stdio.h> #include<…