搜索 -

? 解题记录 ? ? SPOJ ? ? 后缀数组 ?    2017-12-09 16:09:16    382    0    0
Given a string, we need to find the total number of its distinct substrings. InputT- number of test cases. T<=20; Each test case consists of one string, whose length is <= 1000 OutputFor each test case output one number saying the number of distinct substrings. ExampleSample Input: 2 CCCCC ABA
? 解题记录 ? ? 洛谷 ? ? 强连通分量 ?    2017-11-25 14:49:25    652    0    0
题目描述There are exactly nn towns in Byteotia. Some towns are connected by bidirectional roads. There are no crossroads outside towns, though there may be bridges, tunnels and flyovers. Each pair of towns may be connected by at most one direct road. One can get from any town to any other-dire
? 解题记录 ? ? 洛谷 ? ? 拓扑排序 ? ? 最短路 ?    2017-11-25 14:34:13    649    0    0
题目描述最近,Elaxia和w的关系特别好,他们很想整天在一起,但是大学的学习太紧张了,他们 必须合理地安排两个人在一起的时间。Elaxia和w每天都要奔波于宿舍和实验室之间,他们 希望在节约时间的前提下,一起走的时间尽可能的长。 现在已知的是Elaxia和w**所在的宿舍和实验室的编号以及学校的地图:地图上有N个路 口,M条路,经过每条路都需要一定的时间。 具体地说,就是要求无向图中,两对点间最短路的最长公共路径。 输入输出格式输入格式:   第一行:两个整数N和M(含义如题目描述)。 第二行:四个整数x1、y1、x2、y2(1 ≤ x1 ≤ N,1 ≤ y1 ≤ N,1 ≤ x2
? 解题记录 ? ? Codeforces ? ? 期望概率 ?    2017-11-25 14:16:41    576    0    0
Twilight Sparkle was playing Ludo with her friends Rainbow Dash, Apple Jack and Flutter Shy. But she kept losing. Having returned to the castle, Twilight Sparkle became interested in the dice that were used in the game. The dice has m faces: the first face of the dice contains a dot, the s
? 解题记录 ? ? Codeforces ? ? 回文自动机 ?    2017-11-25 12:00:35    506    0    0
DescriptionAfter finishing his homework, our problem setter Federmann decided to kill time by hangingaround online. He found a cool chat room that discusses competitive programming. Federmannhas already joined lot of such chat rooms, but this one is special. Once he entered thechat room, he noticed
? 解题记录 ? ? 杂OJ ? ? 回文自动机 ?    2017-11-25 11:51:21    429    0    0
411. Petya the Hero Time limit per test: 0.25 second(s) Memory limit: 65536 kilobytes input: standard output: standard Petya has come back from the Berland-Birland War, and now he is fond of gathering his friends and narrating his heroic deeds. You have probably heard the story telling that Petya,
? 解题记录 ? ? 洛谷 ? ? 差分 ?    2017-11-23 11:19:37    608    0    0
题目描述To meet the ever-growing demands of his N (1 &lt;= N &lt;= 50,000) cows, Farmer John has bought them a new soda machine. He wants to figure out the perfect place to install the machine. The field in which the cows graze can be represented as a one-dimensional number line. Cow i grazes in
? 解题记录 ? ? BZOJ ? ? 回文自动机 ?    2017-11-23 11:13:58    645    0    0
Description考虑一个只包含小写拉丁字母的字符串s。我们定义s的一个子串t的“出 现值”为t在s中的出现次数乘以t的长度。请你求出s的所有回文子串中的最 大出现值。  Input输入只有一行,为一个只包含小写字母(a -z)的非空字符串s。  Output输出一个整数,为逝查回文子串的最大出现值。  Sample Input【样例输入l】 abacaba 【样例输入2] www Sample Output【样例输出l】 7 【样例输出2] 4 HINT  一个串是回文的,当且仅当它从左到右读和从
? 解题记录 ? ? 洛谷 ? ? Splay ? ? Treap ? ? 模板 ? ? 平衡树 ?    2017-11-22 23:30:14    522    0    0
题目背景这是一道经典的Splay模板题——文艺平衡树。 题目描述您需要写一种数据结构(可参考题目标题),来维护一个有序数列,其中需要提供以下操作:翻转一个区间,例如原有序序列是5 4 3 2 1,翻转区间是[2,4]的话,结果是5 2 3 4 1 输入输出格式输入格式:  第一行为n,m n表示初始序列有n个数,这个序列依次是(1,2,⋯n−1,n) m表示翻转操作次数 接下来m行每行两个数 [l,r] 数据保证 1≤l≤r≤n   输出格式:  输出一行n个数字,表示原始序列经过m次变换后的结果   输入输出样例
? 解题记录 ? ? 洛谷 ? ? AC自动机 ?    2017-11-18 17:07:44    344    0    0
题目描述有NN个由小写字母组成的模式串以及一个文本串TT。每个模式串可能会在文本串中出现多次。你需要找出哪些模式串在文本串TT中出现的次数最多。 输入输出格式输入格式:  输入含多组数据。 每组数据的第一行为一个正整数NN,表示共有NN个模式串,1 \leq N \leq 1501≤N≤150。 接下去NN行,每行一个长度小于等于7070的模式串。下一行是一个长度小于等于10^6106的文本串TT。 输入结束标志为N=0N=0。   输出格式:  对于每组数据,第一行输出模式串最多出现的次数,接下去若干行每行输出一个出现次数最多的模式串,按输入顺序排列。 &nbs