*博客头图：

RGB颜色，例如：#AFAFAF

Hover：

RGB颜色，例如：#AFAFAF

RGB颜色，例如：#AFAFAF

# 孙佰贵的专栏

• 博客(23)
• 资源 (28)

#### 原创 程序员找工作经验

2014-04-29 00:10:21 8685 20

#### 原创 [codility]MinAvgTwoSlice

Python代码如下：def solution(A): # write your code in Python 2.6 # if one slice is the MA, then the average of its subslices # can not be smaller and also it can not be bigger, or the avera

2014-04-24 22:17:55 2188

#### 原创 [codility]GenomicRangeQuery

Python代码如下：def solution(S, P, Q): # write your code in Python 2.6 dict = {'A':0, 'C':1, 'G':2, 'T':3} nuclSumTable = [[0 for col in range(len(S)+1)] for row in range(4)] #print nuc

2014-04-22 21:45:31 1449

#### 原创 [codility]GenomicRangeQuery

Python代码如下：def solution(S, P, Q): # write your code in Python 2.6 dict = {'A':0, 'C':1, 'G':2, 'T':3} nuclSumTable = [[0 for col in range(len(S)+1)] for row in range(4)] #print nuc

2014-04-21 23:25:33 746

#### 原创 [codility]GenomicRangeQuery

Python代码如下：def solution(S, P, Q): # write your code in Python 2.6 dict = {'A':0, 'C':1, 'G':2, 'T':3} nuclSumTable = [[0 for col in range(len(S)+1)] for row in range(4)] #print nuc

2014-04-21 23:25:23 625

#### 原创 [codility]GenomicRangeQuery

Python代码如下：def solution(S, P, Q): # write your code in Python 2.6 dict = {'A':0, 'C':1, 'G':2, 'T':3} nuclSumTable = [[0 for col in range(len(S)+1)] for row in range(4)] #print nuc

2014-04-21 23:04:40 819

#### 原创 [codility]GenomicRangeQuery

Python代码如下：def solution(S, P, Q): # write your code in Python 2.6 dict = {'A':0, 'C':1, 'G':2, 'T':3} nuclSumTable = [[0 for col in range(len(S)+1)] for row in range(4)] #print nuc

2014-04-21 23:03:24 955

#### 原创 [codility]Task description

Python代码如下：def solution(S, P, Q): # write your code in Python 2.6 dict = {'A':0, 'C':1, 'G':2, 'T':3} nuclSumTable = [[0 for col in range(len(S)+1)] for row in range(4)] #print nuclS

2014-04-21 23:01:03 872

#### 原创 [codility]Task description

Python代码如下：def solution(S, P, Q): # write your code in Python 2.6 dict = {'A':0, 'C':1, 'G':2, 'T':3} nuclSumTable = [[0 for col in range(len(S)+1)] for row in range(4)] #print nuclS

2014-04-21 23:00:45 813

#### 原创 [codility]Task description

Python代码如下：def solution(S, P, Q): # write your code in Python 2.6 dict = {'A':0, 'C':1, 'G':2, 'T':3} nuclSumTable = [[0 for col in range(len(S)+1)] for row in range(4)] #print nuclS

2014-04-21 22:59:29 777

#### 原创 [codility]PassingCars

Python代码如下：def solution(A): # write your code in Python 2.6 curZeroCnt = 0 totalPairs = 0 for value in A: if value == 0: curZeroCnt += 1 else:

2014-04-21 22:12:24 1197

#### 原创 [codility]MaxCounters

Python代码如下：def solution(N, A): # write your code in Python 2.6 maxCount = 0 lastMaxSetter = 0 counters = [0]*N for op in A: if op == N+1: lastMaxSetter = maxC

2014-04-20 22:38:24 1547

#### 原创 [codility]FrogRiverOne

Python代码如下：def solution(X, A): # write your code in Python 2.6 checkCrucialTable = [False]*X crucialCnt = 0 for i in xrange(0, len(A)): if not checkCrucialTable[A[i]-1]:

2014-04-20 11:46:28 1656

#### 原创 [codility]PermCheck

Python代码如下：def solution(A): # write your code in Python 2.6 checkTable = [False]*len(A) for value in A: if value len(A): return 0 checkTable[value-1] = True

2014-04-19 16:32:45 1253

#### 原创 [codility]PermMissingElem

Python代码如下：def solution(A): # write your code in Python 2.6 curSum = 0 originalSum = 0 if len(A)%2 == 0: originalSum = (len(A)+1)*((len(A)+2)/2) else: originalSum

2014-04-19 14:55:56 1055

#### 原创 [codility]FrogJmp

Python代码如下：def solution(X, Y, D): # write your code in Python 2.6 dis = Y-X if dis%D == 0: return dis/D else: return dis/D+1 pass

2014-04-18 22:57:37 964

#### 原创 [codility]TapeEquilibrium

2014-04-16 22:58:17 1361

#### 原创 [codility]NailingPlanks

2014-04-16 21:46:02 2116

#### 原创 [codility]MinMaxDivision

2014-04-14 22:48:00 3092

#### 原创 [LeetCode]Reverse Words in a String

class Solution {public: void reverseWords(string &s) { string word; stack wordsStack; stringstream ss(s); while(ss>>word) { wordsStack.push(word); } st

2014-04-12 17:46:30 947

#### 原创 [LeetCode]Evaluate Reverse Polish Notation

class Solution {public: int evalRPN(vector &tokens) { stack numStack; //for each token in the tokens for(int i = 0; i < tokens.size(); ++i) { //if the

2014-04-10 22:45:13 962

#### 原创 [LeetCode]Max Points on a Line

/** * Definition for a point. * struct Point { * int x; * int y; * Point() : x(0), y(0) {} * Point(int a, int b) : x(a), y(b) {} * }; */class Solution { public: int max

2014-04-09 21:59:35 1295

#### 原创 北美求职之寻找内推资源

2013年下半年的时候准备过一阵子北美求职，但是后来没能求职成功。虽然没能成功，但是还是想分享自己在整个过程中积累的一些经验，希望能让他人少走些弯路。我将按如下解答问题的方式来展开全文的叙述。1. 为什么需要内推？北美各大公司网申系统上每年都会有海量应聘者，被recruiter或是hr（其实我还不是很懂这两者的区别，有知道的留个言哈，非常感谢）注意到时很困难的。而且公司一般比较相信内推，因

2014-04-08 22:40:05 4301 8

2011-12-06

2011-04-02

2011-04-02

2010-05-11

2010-04-19

2009-08-20

2009-08-04

2009-08-04

2009-03-10

2009-03-10

2009-03-10

2009-03-10

2009-03-10

2009-03-10

2009-03-10

2009-03-10

2009-03-10

2009-03-10

2009-03-10

2009-03-10

2009-03-10

2009-03-10

2009-03-10

2009-03-10

2009-03-10

2009-03-09

2009-03-09

#### 链表C语言实现 功能齐全

/* head 为链表的头指针，也就是第一个节点的地址，只有在加入第一个节点的时候有用 last 是这样一个节点，当你输入数据的时候，内存首先开辟一个区域，此时，last指向上一个节点的地址 curPosi 永远指向当前新开辟的区域，一旦指向当前新开辟的区域，那么curPosi 就和以前的所有节点没有关系了 为了让last永远指向上一个节点，在给last的 next指针赋值之后，last要指向当前节点 */

2009-03-09