码迷,mamicode.com
首页 >  
搜索关键字:rotate array    ( 30802个结果
Leetcode::JumpGame
Description:Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents...
分类:其他好文   时间:2014-06-09 00:15:33    阅读次数:193
HNOI2008玩具装箱 (斜率优化)
总算A了,心情好激动……如果会了一类斜率优化,基本上这类题就成了套模版了……只是k函数不同 1 var n,l,x,tail,head,m:int64; 2 i,j:longint; 3 dp,q,s:array[0..100000] of int64; 4 function k(x...
分类:其他好文   时间:2014-06-08 21:53:27    阅读次数:247
HNOI2004打鼹鼠(LIS)
大水题……不过通过这题我们应该养成一个好习惯:好好看清题……竟然没有看到时限 10sec…… 1 var i,j,n,m,ans:longint; 2 f,time,x,y:array[0..15000] of longint; 3 function max(x,y:longint):lon...
分类:其他好文   时间:2014-06-08 18:38:49    阅读次数:261
转换MFC CString 到std::string
std::string CStringToSTDStr(const CString& theCStr) { // Convert the CString to a regular char array const int theCStrLen = theCStr.GetLength(); char *buffer = (char*)malloc(sizeof(char)*(theCStrLe...
分类:其他好文   时间:2014-06-08 16:33:53    阅读次数:218
检查输入的用户名是否符合规定
代码清单: <?php /** * 检测输入中是否含有错误字符 * @author ruxing.li * @param char $string 要检查的字符串名称 * @return boolean */ function is_badword($string) { $badwords = array("\\",'&',' ',"'",'"','/','*',',',''...
分类:其他好文   时间:2014-06-08 14:49:48    阅读次数:288
Merge Sorted Array
题目 Given two sorted integer arrays A and B, merge B into A as one sorted array. Note: You may assume that A has enough space (size that is greater or equal to m + n) to hold additional el...
分类:其他好文   时间:2014-06-08 05:05:47    阅读次数:268
UVa--Rotating Sentences
Rotating Sentences  In ``Rotating Sentences,'' you are asked to rotate a series of input sentences 90 degrees clockwise. So instead of displaying the input sentences from left to right and top to b...
分类:其他好文   时间:2014-06-08 04:51:34    阅读次数:236
[LeetCode] Remove Element [20]
题目 Given an array and a value, remove all instances of that value in place and return the new length. The order of elements can be changed. It doesn't matter what you leave beyond the new length. 原题链接(点我) 解题思路 给一个数组和一个数字,移除该数字在数组中所有出现的地方。 这是一个非常简单的题目,应...
分类:其他好文   时间:2014-06-08 04:05:50    阅读次数:284
[LeetCode] Remove Duplicates from Sorted Array [19]
题目...For example,Given input array A = [1,1,2],Your function should return length = 2, and A is now [1,2]. 解题思路, 移除数组中的重复元素,并返回新数组的长度。 这个题目应该算是简单的题目。使用两个变量就可以。具体的看代码 代码实现......
分类:其他好文   时间:2014-06-08 03:54:22    阅读次数:279
LeetCode——Two Sum
Given an array of integers, find two numbers such that they add up to a specific target number. The function twoSum should return indices of the two numbers such that they add up to the target, whe...
分类:其他好文   时间:2014-06-08 02:12:04    阅读次数:216
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!