Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in or ...
分类:
其他好文 时间:
2016-03-28 21:50:30
阅读次数:
218
1、 Given an array of integers, find the subarray with smallest sum. Return the sum of the subarray. For [1, -1, -2, 1], return -3 2、 1、只需要求出最小值 2、利用su ...
分类:
其他好文 时间:
2016-03-28 18:48:02
阅读次数:
141
public class NetStateUtils { /** * 对网络连接状态进行判断 * * @return true, 可用; false, 不可用 */ public static boolean isNetworkConnected(Context context) { if (con ...
分类:
其他好文 时间:
2016-03-28 16:49:30
阅读次数:
124
多重背包就是完全背包的一个特例 最容易的思想就是转化为01背包去遍历书写 杭电2191 #include<stdio.h> #include<string.h>int max(int x,int y){ if(x>y) return x; else return y;}int main(){ int ...
分类:
其他好文 时间:
2016-03-28 13:41:21
阅读次数:
119
一、时间:1、xdebug_time_index():这xdebug自带的执行时间函数;2、自己拓展的方法及调试:functionmicrotime_float(){list($usec,$sec)=explode("",microtime());return((float)$usec+(float)$sec);}$time_start=microtime_float();usleep(100);$time_end=microtime_float();..
分类:
Web程序 时间:
2016-03-28 12:05:28
阅读次数:
291
第 0010 题:使用 Python 生成类似于下图中的字母验证码图片 思路: 1. 随机生成字符串 2. 创建画布往上头写字符串 3. 干扰画面 code: Notes: 1. string.ascii_letters,大小写英文字母集合字符串 2. random.choice():Return ...
分类:
编程语言 时间:
2016-03-28 02:17:21
阅读次数:
440
MemoryManage.h
#include<string>
#include<list>
#include<assert.h>
#include"TypeTraits.hpp"
#include<iostream>
usingnamespacestd;
structBlockInfo
{
void*_ptr;
string_file;
int_line;
BlockInfo(void*ptr=0,char*file="",intline=0)//
..
分类:
其他好文 时间:
2016-03-28 00:29:21
阅读次数:
208
Combinations Total Accepted: 10949 Total Submissions: 36507My Submissions Given two integers n and k, return all possible combinations of k numbers ou ...
分类:
其他好文 时间:
2016-03-27 21:01:51
阅读次数:
218
-(CGRect)frame{ return CGRectMake(self.frame.origin.x,self.frame.origin.y,self.frame.size.width,self.frame.size.height);}-(CGRect)bounds{ return CGRec ...
分类:
其他好文 时间:
2016-03-27 19:26:32
阅读次数:
131
#include <stdio.h>long long quickPow(long long a, long long b)///快速幂, a的b次方{ long long c = 1; while(b) { if(b&1)c=c*a; b=b/2; a=a*a; } return c;}int m ...
分类:
编程语言 时间:
2016-03-27 17:36:28
阅读次数:
150