题目
There are N gas stations along a circular route, where the amount of gas at station i is gas[i].
You have a car with an unlimited gas tank and it costs cost[i] of gas
to travel from s...
分类:
其他好文 时间:
2014-07-01 11:02:24
阅读次数:
158
题目
Given an array of integers, every element appears twice except for one. Find that single one.
Note:
Your algorithm should have a linear runtime complexity. Could you implement it witho...
分类:
其他好文 时间:
2014-07-01 06:24:42
阅读次数:
204
题目
Given an array of integers, every element appears three times except for one. Find that single one.
Note:
Your algorithm should have a linear runtime complexity. Could you implement it...
分类:
其他好文 时间:
2014-07-01 06:23:24
阅读次数:
334
前言:随着内网linux服务器越来越多,在每台服务器上安装软件,都要先把安装盘上传上去,在配置本地yum服务,即麻烦又费时。可以在内网的一台linux服务器上安装yum服务,然后其他服务器直接修改repo文件使用yum服务就可以了。安装步骤如下:...
分类:
其他好文 时间:
2014-07-01 06:39:02
阅读次数:
287
题目描述:
在一个二维数组中,每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序。请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数。
分析:
首先选择数组中右上角的数字。如果该数字等于要查找的数字,查找过程结束;如果该数字大于要查找的数字,剔除这个数字所在的列;如果该数字小于要查找的数字,剔除这个数字所在的行。依次类推,直到查找范围为空。...
分类:
其他好文 时间:
2014-07-01 06:36:23
阅读次数:
148
电子邮件发送协议是一种基于“推”的协议,主要包括SMTP;邮件接收协议则是一种基于“拉”的协议,主要包括POP协议和IMAP协议,在正式介绍这些协议之前,我们先给出邮件收发的体系结构:...
分类:
其他好文 时间:
2014-07-01 06:35:47
阅读次数:
245
简单,二分法,但是在oj上交的时候会有精度的限制,所以只能把数扩得大一点,而且在扩的时候为防止尾数会自动生成一些非零数,所以还是自己吧扩到的位置设置为0,还有输出时因为%.2lf会自己有4设5入,所以可以自己算出小数点后两位的数值,在输出,保证要求的精度
#include
#include
#include
#define MAX 10010
using namespace std;
l...
分类:
其他好文 时间:
2014-07-01 06:35:11
阅读次数:
238
编译 windows上编译lua源码
cl /MD /O2 /W3 /c /DLUA_BUILD_AS_DLL *.c
del *.o
ren lua.obj lua.o
ren luac.obj luac.o
ren print.obj print.o
link /DLL /IMPLIB:lua5.1.lib /OUT:lua5.1.dll *.obj
link /OUT:lua.ex...
分类:
其他好文 时间:
2014-07-01 07:21:11
阅读次数:
199
使用静态链接的方式
#include
#include
#include
#ifdef __cplusplus
extern "C" {
#endif
#include "lua/include/lua.h"
#include "lua/include/lauxlib.h"
#include "lua/include/lualib.h"
#pragma comment (li...
分类:
其他好文 时间:
2014-07-01 07:50:09
阅读次数:
189
题目
A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null.
Return a deep copy of the list.
方法
publi...
分类:
其他好文 时间:
2014-07-01 07:49:33
阅读次数:
186
这几天总是被一个问题困扰着,那就是base64的加密,在centos 服务器上无法解密。经过反复测试才发现,原来是因为centos 系统没有GB2312库导致的。
加密端是在ASP.NET中处理的,解密是在centos 下使用java。ASP.NET默认采用的是GB2312字符集,所以,对应的解密也必须使用GB2312。为了成功解析,所以必须让centos 也支持GB2312。最终问题解决。
...
分类:
其他好文 时间:
2014-07-01 08:24:41
阅读次数:
221
加载超大效果图导致内存不足(GC/ANR)
浅谈ANR如何分析解决ANR...
分类:
其他好文 时间:
2014-07-01 08:24:01
阅读次数:
272
题目链接:uva 1425 - Metal
题目大意:现在要用如图机器对一块钢板进行切割,给出切割路线经过的若干个点,问可以切割成多少种不同的形状,注意切割下的为一整块。
解题思路:
由图可以得知,两条切割线是不可以相交的由题目描述可知,所有点的x坐标是不会重复的机器不会回退,也就是说钢板是朝一个方向移动的,这样的切割路线是不会产生的
所以我们定义两条切割线分别为上...
分类:
其他好文 时间:
2014-07-01 08:23:17
阅读次数:
274
火狐浏览器中的“HttpWatch”...
分类:
其他好文 时间:
2014-07-01 08:22:33
阅读次数:
160
1、Swift,用来判断option是不是nil,相当于OC的 if(option)
if let name = option{
greeting = “if=====“
}else{
greeting = "else==="
}
2、运行switch中匹配到的子句之后,程序会退出switch语句,并不会继续向下运行,所以不需要在每个子句结尾写break。
3、//使用..创建的范围...
分类:
其他好文 时间:
2014-07-01 07:05:30
阅读次数:
234
直接上代码
ZeroClipboard Test
.line {
margin-bottom: 20px;
}
/* 复制提示 */
.copy-tips {
position: fixed;
z-index: 9999;
bottom: 50%;
left: 50%;
margin: 0 0 -20px -80px;
background-color: rgba(0,...
分类:
其他好文 时间:
2014-07-01 07:04:53
阅读次数:
245
很无语的一个题。
反正我后来看题解完全不是一个道上的。
要用什么组合数学的lucas定理。
表示自己就推了前面几个数然后找找规律。
C(n, m) 就是 组合n取m;
(m!(n-m!)/n!)
如果n==11 ;
C(11,0);C(11,1);C(11,2);C(11,3);C(11,4);C(11,5);
分别为
(1/1); (1 / 11) ; (11*...
分类:
其他好文 时间:
2014-07-01 10:55:41
阅读次数:
233