码迷,mamicode.com
首页 >  
搜索关键字:two pointer    ( 13796个结果
xtu字符串 B. Power Strings
B. Power StringsTime Limit: 3000msMemory Limit: 65536KB64-bit integer IO format:%lld Java class name:MainGiven two strings a and b we define a*b to be...
分类:其他好文   时间:2014-07-26 01:25:26    阅读次数:300
LeetCode:two sum
题目:如果采取暴力搜索,复杂度为O(n2),会超时解法1:构建Node类,存储输入的数据和它们的下标。用sort按升序排序(其中lambda可以写成一个返回值为bool类型的函数)。设置i和j,分别指向容器的头和尾。如果和大于target,尾向前移,如果和小于target,头向后移。直至找出和等于t...
分类:其他好文   时间:2014-07-26 00:31:46    阅读次数:223
【leetcode刷题笔记】Multiply Strings
Given two numbers represented as strings, return multiplication of the numbers as a string.Note: The numbers can be arbitrarily large and are non-nega...
分类:其他好文   时间:2014-07-26 00:23:26    阅读次数:242
zoj 2974 Just Pour the Water矩阵快速幂
Just Pour the WaterTime Limit: 2 Seconds Memory Limit: 65536 KBShirly is a very clever girl. Now she has two containers (A and B), each with some wat....
分类:其他好文   时间:2014-07-25 18:58:22    阅读次数:374
图片超过DIV宽度自适应
.main_con img{ max-width: 610px; height: auto; cursor: pointer; border: 0px double #cccccc; padding: 2px; zoom: expression( function...
分类:其他好文   时间:2014-07-25 14:27:11    阅读次数:177
从LLVM源码学C++(一)
今天开始需要分析clang的源码了,LLVM这个开源的project代码写的很不错的,也算是巩固一下C++的一些基础知识了。首先是在llvm/ADT/OwningPtr.h中定义了owningptr智能指针的实现:源码如下: 1 /// OwningPtr smart pointer - Ownin...
分类:编程语言   时间:2014-07-25 14:20:31    阅读次数:897
每日一道题2014/7/24
Two SumGiven 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...
分类:其他好文   时间:2014-07-25 03:15:41    阅读次数:176
[leetcode]Merge Sorted Array
Merge Sorted ArrayGiven 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 i...
分类:其他好文   时间:2014-07-25 02:34:44    阅读次数:162
[leetcode]Add Binary
Add BinaryGiven two binary strings, return their sum (also a binary string).For example,a ="11"b ="1"Return"100".算法思路:模拟二进制加法,跟十进制木有区别,将a,b转置(不转置的话,倒着...
分类:其他好文   时间:2014-07-24 22:57:23    阅读次数:216
import the library to Android Studio
To import the library to Android Studio, there is two methods that can (or cannot) work. The first one worked for me, but when I tried the second, it ...
分类:移动开发   时间:2014-07-24 22:42:13    阅读次数:284
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!