LCP Array Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 830 Accepted Submission(s): 232 Problem Description Peter has a string s=s1s2...sn, let suffi=sisi+1...sn be the suffix start with …
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5635 LCP Array Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 282 Accepted Submission(s): 79 Problem Description Peter has a string s=s1s2..…
Red and Black Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 12935 Accepted Submission(s): 8006 Problem Description There is a rectangular room, covered with square tiles. Each tile is color…
比赛地址:http://acm.hdu.edu.cn/contests/contest_show.php?cid=804 题目编号:第一题 A. Ascending Rating hdu6319 题意: 给定一个序列 a[1..n],对于每个长度为 m 的连续子区间, 求出区间 a 的最大值以及从左往右扫描该区间时 a 的最大值的 变化次数. 题解:按照 r 从 m 到 n 的顺序很难解决这个问题. 考虑按照 r 从 n 到 m 的顺序倒着求出每个区间的答案. 按照滑窗最大值的经典方法维护 a…
letcode第一题, tm的不好弄. 想了很久想到了一个粗蠢的解决办法. Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution, and you may not use the same element twice…
第一题:题目内容 Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution, and you may not use the same element twice. Example: Given nums = [2, 7…