摘要:
题目链接:点击打开链接题意:给你一个串,让你在串后面添加尽可能少的字符使得这个串变成回文串。思路:这题可以kmp,manacher,后缀数组三种方法都可以做,kmp和manacher效率较高,时间复杂度是O(n),后缀数组时间复杂度是O(nlogn).思路是求出元串的... 阅读全文
摘要:
Time Limit: 5000MS Memory Limit: 65536KTotal Submissions: 9414 Accepted: 3123DescriptionA substring of a string T is defined as:T(i, k... 阅读全文
摘要:
DescriptionThe repetition number of a string is defined as the maximum number R such that the string can be partitioned into R same co... 阅读全文
摘要:
A string s is called an (k,l)-repeat if s is obtained by concatenating k>=1 times some seed string t with length l>=1. For example, th... 阅读全文
摘要:
Description给出一个n个节点的有根树(编号为0到n-1,根节点为0)。一个点的深度定义为这个节点到根的距离+1。设dep[i]表示点i的深度,LCA(i,j)表示i与j的最近公共祖先。有q次询问,每次询问给出l r z,求sigma_{l#include#i... 阅读全文
摘要:
Description给定一棵有n个节点的无根树和m个操作,操作有2类:1、将节点a到节点b路径上所有点都染成颜色c;2、询问节点a到节点b路径上的颜色段数量(连续相同颜色被认为是同一段),如“112221”由3段组成:“11”、“222”和“1”。请你写一个程序依次... 阅读全文
摘要:
You are given a tree (an acyclic undirected connected graph) with N nodes, and edges numbered 1, 2, 3...N-1.We will ask you to perfrom... 阅读全文
摘要:
Problem DescriptionYJQQQAQ has an array A of length n. He defines a function fl,r,k where l,r,k are positive integers that satisfies l... 阅读全文
摘要:
Problem DescriptionBackgroundTo The Moon is a independent game released in November 2011, it is a role-playing adventure game powered ... 阅读全文
摘要:
Problem DescriptionA peak number is defined as continuous digits {D0, D1 … Dn-1} (D0 > 0 and n >= 3), which exist Dm (0 Di+1 (m #incl... 阅读全文