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
题目:如果采取暴力搜索,复杂度为O(n2),会超时解法1:构建Node类,存储输入的数据和它们的下标。用sort按升序排序(其中lambda可以写成一个返回值为bool类型的函数)。设置i和j,分别指向容器的头和尾。如果和大于target,尾向前移,如果和小于target,头向后移。直至找出和等于t...
分类:
其他好文 时间:
2014-07-26 00:31:46
阅读次数:
223
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
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
.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
今天开始需要分析clang的源码了,LLVM这个开源的project代码写的很不错的,也算是巩固一下C++的一些基础知识了。首先是在llvm/ADT/OwningPtr.h中定义了owningptr智能指针的实现:源码如下: 1 /// OwningPtr smart pointer - Ownin...
分类:
编程语言 时间:
2014-07-25 14:20:31
阅读次数:
897
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
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
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
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