The shortest common superstring of 2 strings S 1 and S 2 is a string S with the minimum number of characters which contains both S 1 and S 2 as a sequence of consecutive characters. For instance, the shortest common superstring of "alba" and &qu…
题意:给两个字符串,问包含这两个字符串的最小的字符串的长度 kmp返回匹配串长度 #include "iostream" #include<cstdio> #include<algorithm> #include<cstring> using namespace std; #define N 1000005 char s[N],t[N]; int next1[N]; void get_next(char b[]) { next1[]=-; ; ; i…
LeetCode刷题记录 传送门 Description Given two strings str1 and str2, return the shortest string that has both str1 and str2 as subsequences.  If multiple answers exist, you may return any of them. (A string S is a subsequence of string T if deleting some nu…
题目链接:http://61.187.179.132/JudgeOnline/problem.php?id=1941 题意:给出平面上n个点,找出一点p,使得距离p最近和最远的点的距离之差最小.输出这个差值. 思路: 计算出距离每个点最近的点的距离和最远点的的距离.怎么计算呢?首先我们计算每个点到其左下角的那些点的最近最远距离.只要按照x升序然后y升序,之后将y离散化.一个一个插入到树状数组中.这样的话(x2+y2)-(x1+y1)的差值就是它们的距离.对于其右下角.左上角.右上角乘以(-1,1…
题意:有n个点,每个点都在一个层内,层与层之间的距离为c,一个层内的点可以到达与它相邻的前后两个层的点,还有m条小路 ..时间真的是卡的很恶心啊... 借一下别人的思路思路: 这题主要难在建图上,要将层抽象出来成为n个点(对应编号依次为n+1~n+n),然后层与层建边,点与点建边,层与在该层上的点建边(边长为0),点与相邻层建边(边长为c). ps:这样处理就不用拆点了.不过要注意的是相邻两层必须都要有点才建边(不然会WA,可以参考我贴的数据)  借鉴自:http://www.myexcepti…
Java基础常见英语词汇(共70个) ['ɔbdʒekt] ['ɔ:rientid]导向的                             ['prəʊɡræmɪŋ]编程 OO: object-oriented ,面向对象 OOP: object-oriented programming,面向对象编程 [dɪ'veləpmənt][kɪt]工具箱                              ['vɜːtjʊəl]虚拟的 JDK:Java development kit, j…
The Algorithm Design Manual, 2ed 跳转至: 导航. 搜索 Springer - The Algorithm Design Manual, 2ed Steven S.Skiena 2008 文件夹 1 介绍 2 算法设计 3 数据结构 4 排序和搜索 5 图遍历 6 加权图 7 组合搜索与启示式 8 DP 9 Intractable问题与近似算法 10 如何设计算法 11 数据结构 12 数值问题 13 组合问题 14 图问题:P 15 图问题:困难的 16 计算几…
java:  第一章: JDK(Java Development Kit) java开发工具包 JVM(Java Virtual Machine) java虚拟机 Javac  编译命令 java  解释命令 Javadoc  生成java文档命令 classpath 类路径 Version  版本 author  作者 public  公共的 class  类 static  静态的 void  没有返回值 String  字符串类 System  系统类 out  输出 print  同行打…
abstract (关键字)             抽象 ['.bstr.kt] access                            vt.访问,存取 ['.kses]‘(n.入口,使用权) algorithm                     n.算法 ['.lg.riem] annotation                     [java]代码注释 [.n.u'tei..n] anonymous                     adj.匿名的[.'n.…
柠檬学院Java 基础常见英语词汇(共 70 个)OO: object-oriented ,面向对象 OOP: object-oriented programming,面向对象编程JDK:Java development kit, java 开发工具包 JVM:java virtual machine ,java 虚拟机Compile:编绎 Run:运行 Class:类 Object:对象System:系统 out:输出 print:打印 line:行variable:变量 type:类型 op…