摘要: 题目链接 描述 You are given an N × N matrix. At the beginning every element is 0. Write a program supporting 2 operations: 1. Add x y value: Add value to th 阅读全文
posted @ 2017-10-14 21:20 redips 阅读(229) 评论(0) 推荐(0) 编辑
摘要: 题目链接 一个长度1000的字符串最少划分为几个回文字符串 想复杂了。 首先N2的时间预处理一下,从i开始长度为len的字符串是否为回文串。 dist(i) = MIN(dist(i),dist(j)+1) 如果 j-i 为一个回文串 阅读全文
posted @ 2017-10-14 19:56 redips 阅读(286) 评论(0) 推荐(0) 编辑