http://acm.hdu.edu.cn/showproblem.php?pid=3832
1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8
#define maxn 1001...
分类:
其他好文 时间:
2014-05-18 20:36:07
阅读次数:
411
今天MacBook到手了,就正式开始学习php了。先搭个环境,由于MacBook自带了Apache和php所以只要修改下配置启动就可以了。 1.启用root用户(如果不启用root,下面的命令前都要加sudo,并且每次都要输入密码,比较麻烦)
sudo -i 和 su都可以切换到root账户,要.....
分类:
Web程序 时间:
2014-05-18 20:35:45
阅读次数:
478
Say you have an array for which theithelement
is the price of a given stock on dayi.If you were only permitted to complete at
most one transaction (ie...
分类:
其他好文 时间:
2014-05-18 20:30:16
阅读次数:
301
题目:查找元素target插入一个数组中的位置。代码:public int
searchInsert(int[] A, int target) { int len = A.length; int i; for(i = 0 ; i
< len ; i++){ ...
分类:
其他好文 时间:
2014-05-18 20:28:13
阅读次数:
299
出题:预先输入一个整型数组,数组中有正数也有负数;数组中连续一个或者多个整数组成一个子数组,每个子数组有一个和;求所有子数组中和的最大值,要求时间复杂度O(n);分析:时间复杂度为线性表明只允许一遍扫描,当然如果最终的最大值为0表明所有元素都是负数,可以用线性时间O(N)查找最大的元素。具体算法策略...
分类:
其他好文 时间:
2014-05-18 20:21:35
阅读次数:
339
问题描述:一个有N个整数元素的一维数组(A[0], A[1],
A[2],...,A[n-1]),这个数组当然有很多子数组,那么子数组之和的最大值是什么呢?解法:1. 暴力解法-------O(N^3)2.
改进版暴力解法-------O(N^2)*3. 分治算法-------O(NlogN)(暂时...
分类:
其他好文 时间:
2014-05-18 20:18:57
阅读次数:
341
1: #include 2: #include 3: #include 4: #include 5:
#include 6: using namespace std; 7: 8: #define LL(a) a>1; 32: sub_build(subl,
mid, LL(subidx), idx)...
分类:
其他好文 时间:
2014-05-18 19:43:43
阅读次数:
395
原贴发在hipda,地址:[移动化的数字笔记:livescribe3[更新图片] - E-INK -
Geek Talks · 奇客怪谈 - Hi!PDA
Hi!PDA](http://www.hi-pda.com/forum/viewthread.php?tid=1357455&highlight...
分类:
移动开发 时间:
2014-05-18 19:42:39
阅读次数:
415
早上公交上总想这个问题,终于写出来了,不知道有错误没 1 $chinese =
array("零","一","二","三","四","五","六","七","八","九"); 2 $str = 140032002005; 3 $arr =
array(); 4 ...
分类:
其他好文 时间:
2014-05-18 19:27:44
阅读次数:
262
数据类型:基本数据类型和引用数据类型基本数据类型包括 数值型(整数类型
byte,short,int,long;浮点类型 float double);字符型char;布尔型boolean引用数据类型包括
类class;接口interface ;数组2.字面量整数字面量为整数(int);小数字面量为双...
分类:
移动开发 时间:
2014-05-17 21:26:27
阅读次数:
321