http://codeforces.com/problemset/problem/730/B 题意:一个交互式问题,给出一个n代表有n个数字,你可以问下标为x和y的数的大小,会给出">","<"或"=",要求询问次数不能超过 ,最后输出最小的数和最大的数的下标。 思路:很新奇的题目。先将两两比较整理 ...
分类:
其他好文 时间:
2017-02-15 13:54:34
阅读次数:
296
虽然以前可能接触过最长公共子序列,但是正规的写应该还是第一次吧。 直接贴代码就好了吧: ...
分类:
其他好文 时间:
2017-02-15 12:04:02
阅读次数:
135
必要知识: 做移动站有一个必要的知识,就是关于屏幕宽度以及缩放问题。我们习惯的在<head>标签之间增加一个<meta>标签 <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,m ...
分类:
移动开发 时间:
2017-02-14 20:48:05
阅读次数:
271
dp[i][j] 表示第一个字符串前i位 和 第二个字符串前j位的最长公共子序列 ...
分类:
其他好文 时间:
2017-02-13 23:29:24
阅读次数:
179
300. Longest Increasing Subsequence 300. Longest Increasing Subsequence Description Submission Solutions Add to List Total Accepted: 64115 Total Submi ...
分类:
其他好文 时间:
2017-02-13 18:43:00
阅读次数:
206
Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. 求字符串中的最大回文子串(从左往右和从右往左读一样的子串)。 Exa ...
分类:
其他好文 时间:
2017-02-12 01:05:47
阅读次数:
191
http://poj.org/problem?id=2479 题意: 给出一个整数串,求连续子串1和连续子串2,不相交并且串1加串2的和最大。 思路: 其实就是求最大连续和,题意要求就是求两段最大连续和。我们可以从左边和右边分别求最大连续和,代码中的dp_l[i]就是1~i的最大连续和,dp_r[i ...
分类:
其他好文 时间:
2017-02-09 23:52:52
阅读次数:
361
414. Third Maximum Number 414. Third Maximum Number Description Submission Solutions Add to List Total Accepted: 20624 Total Submissions: 76932 Diffic ...
分类:
其他好文 时间:
2017-02-09 11:38:43
阅读次数:
148
问题描述: 有一个长为n的数列a0, a1,..., an-1.请求出这个序列中最长的上升子序列。请求出这个序列中最长的上升子序列。 上升子序列:对于任意i<j都满足ai<aj的子序列. 限制条件 i <= n <= 1000 0 <= ai <= 1000000 两种定义方式 具体看程序注释 ...
分类:
其他好文 时间:
2017-02-09 00:49:14
阅读次数:
129
Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may complet... ...
分类:
其他好文 时间:
2017-02-07 23:38:53
阅读次数:
185