摘要: 题目链接:https://www.nowcoder.com/acm/contest/77/C 【题意】 求一个字符串中最长的子串,要求子串既是原串的前缀又是后缀,除前后缀还在中间出现过。 【思路】 KMP的应用,首先要理解next数组的含义:一个字符串中 前缀 和 后缀的最长公共长度,next的值也 阅读全文
posted @ 2018-02-27 19:16 LesRoad 阅读(234) 评论(0) 推荐(1) 编辑
摘要: Description Given an N*N matrix A, whose elements are either 0 or 1. A[i, j] means the number in the i-th row and j-th column. Initially we have A[i, 阅读全文
posted @ 2018-02-27 17:03 LesRoad 阅读(555) 评论(0) 推荐(0) 编辑