马龙前越

导航

2016年11月27日 #

数据结构与算法分析——分治法

摘要: 看了一下午,终于把算法时间复杂度看完! 然后学着来敲这个O(NlogN)的分治法找最大连续和,这堆代码主要是找4,-3,5,-2,-1,2,6,-2的最大连续和(当然也适用于其他数列)。 主要感想和问题: 首先遇到了scope的问题,没搞清楚const和extern,intern,auto,regi 阅读全文

posted @ 2016-11-27 23:56 马龙前越 阅读(617) 评论(0) 推荐(0) 编辑

2016年11月22日 #

python-getattr

摘要: getattr(object, name[, default]) Return the value of the named attribute of object. name must be a string. If the string is the name of one of the obj 阅读全文

posted @ 2016-11-22 21:25 马龙前越 阅读(232) 评论(0) 推荐(0) 编辑

2016年11月21日 #

python学习GUIwxpython不支持中文输出入的问题

摘要: 上述代码一修改好。 看了一系列的blog之后,终于发现无法进行中文的保存的原因是GetValue 函数的使用应该表明其encode方式(如'utf-8'),而对于SetValue函数也是同理! 而在脚本开头的# -*- coding: utf8 -*-也是必要的。 阅读全文

posted @ 2016-11-21 10:16 马龙前越 阅读(149) 评论(0) 推荐(0) 编辑

2016年11月19日 #

python学习八皇后问题

摘要: 0 # -*- coding: utf-8 -*- 1 import random 2 #冲突检查,在定义state时,采用state来标志每个皇后的位置,其中索引用来表示横坐标,基对应的值表示纵坐标,例如: state[0]=3,表示该皇后位于第1行的第4列上 3 def conflict(state, nextX): 4 nextY = len(state) 5 ... 阅读全文

posted @ 2016-11-19 19:03 马龙前越 阅读(436) 评论(0) 推荐(0) 编辑

2016年11月17日 #

poj1083

摘要: The famous ACM (Advanced Computer Maker) Company has rented a floor of a building whose shape is in the following figure. The floor has 200 rooms each 阅读全文

posted @ 2016-11-17 14:53 马龙前越 阅读(168) 评论(0) 推荐(0) 编辑