polygon_vertex=[5,-7,4,2]polygon_side=['+','+','*','*'] multi_list = [[[0 for col in range(5)] for row in range(5)] for i in range(5)] def get_min_of_ Read More
posted @ 2016-05-17 18:46 zhaodonglin Views(187) Comments(0) Diggs(0)
p = [0, 10, 12, 15, 255, 1, 2] def store_bit_number(n): k = 1 n = n//2 while n != 0: k = k+1 n = n//2 return k s = [0, 0, 0, 0, 0, 0, 0, 0, 0]pos = [0 Read More
posted @ 2016-05-06 19:24 zhaodonglin Views(97) Comments(0) Diggs(0)
weight_polygon = [ [0, 2, 2, 3, 1, 4], [2, 0, 1, 5, 2, 3], [2, 1, 0, 2, 1, 4], [3, 5, 2, 0, 6, 2], [1, 2, 1, 6, 0, 1], [4, 3, 4, 2, 1, 0]] polygon_spl Read More
posted @ 2016-05-04 20:35 zhaodonglin Views(119) Comments(0) Diggs(0)
def max_sum_of_sub_seg(a): cur_max_sum=0 cur_item_val=0 for item in a: if cur_item_val <0: cur_item_val = item else: cur_item_val = cur_item_val +item Read More
posted @ 2016-05-03 19:56 zhaodonglin Views(131) Comments(0) Diggs(0)
1 List[] extends 2 dictionary {} has_key() keys() values() 3 json: dumps dump 4 docstring:' ' " " ''' ''' 5 object: __ne__ _gte__ super(Book,self).__i Read More
posted @ 2016-04-30 16:27 zhaodonglin Views(116) Comments(0) Diggs(0)
1 Using the existing applications to build software so that they could help and accelerate your work,but we also need build our own infrastucture, whi Read More
posted @ 2016-04-30 14:00 zhaodonglin Views(145) Comments(0) Diggs(0)
pos=[0]*5x=[0]*5 def place(t): for i in range(1,t): if (pos[i] == pos[t]): return False elif (abs(pos[i]-pos[t]) == abs(i-t)): return False return Tru Read More
posted @ 2016-04-29 08:20 zhaodonglin Views(153) Comments(0) Diggs(0)
graph=[[0, 1, 999, 9, 999],[1, 0, 5, 7, 3],[999, 5, 0, 999, 4],[9 , 7, 999, 0, 3],[999, 1, 999, 9, 999]] for i in range(0,5): print graph[i] points =[ Read More
posted @ 2016-04-27 19:33 zhaodonglin Views(143) Comments(0) Diggs(0)
sequence1 =['A', 'B', 'C', 'D', 'E']sequence2 =['A', 'E','C', 'D', 'F'] m = [[0]*10for i in range(1,10)]dir = [[0]*10for i in range(1,10)] def find_lo Read More
posted @ 2016-04-27 18:24 zhaodonglin Views(80) Comments(0) Diggs(0)
weight=[0,1,3,4,8]value=[0,4,3,2,5]c=9m = [[0]*10 for i in range(10)] def min(x,y): if x < y: return x else: return y def package(weight, value, n, to Read More
posted @ 2016-04-22 20:50 zhaodonglin Views(107) Comments(0) Diggs(0)