摘要:
题目如下:Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two ... 阅读全文
摘要:
Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999与罗马字符转数字类似,注意按级处理。string intToRoman(int num){... 阅读全文
摘要:
Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.从低位开始累加,注意一下像IV和 VI DC和CD的处理class Solution {... 阅读全文
摘要:
'.' Matches any single character.'*' Matches zero or more of the preceding element.The matching should cover the entire input string (not partial).The 阅读全文
摘要:
最近一直在做视频稳像的项目,为了简化部分实现,使用了部分Opencv的函数,其中包括Opencv中对IplImage进行同时变换的函数cvWarpPerspective(src, dst,...)发现的问题是,不管后面设置什么参数出现的结果有时候会出现差异。比如,正常的输出时在变换后没有图像区域像素... 阅读全文
摘要:
这是DP最基础的一个问题,刚开始学习这一块,实现了一下,不要黑我巨长的参数表,新手。代码如下:void FastWay(int l1[], int l2[], int e1, int e2, int x1, int x2, int t1[], int t2[], int n){ int f1[... 阅读全文
摘要:
Given an input string, reverse the string word by word.For example, Given s = "the sky is blue", return "blue is sky the".Update (2015-02-12): For C p... 阅读全文
摘要:
'.' Matches any single character.'*' Matches zero or more of the preceding element.The matching should cover the entire input string (not partial).The... 阅读全文
摘要:
回文检测,参考http://blog.csdn.net/feliciafay/article/details/16984031使用时间复杂度和空间复杂度相对较低的动态规划法来检测,具体的做法图一 偶数个回文字符情况图二 奇数个回文字符情况核心就是如果一个子串是回文,如果分别向回文左右侧扩展一个字符相... 阅读全文
摘要:
Which of following C++ code is correct ?A.int f(){ int *a = new int(3); return *a;}B.int *f(){ int a[3] = {1,2,3}; return a;}C.vector f(){ vecto... 阅读全文