摘要: 题目描述: Given an array of integers, every element appears twice except for one. Find that single one. 解题思路: 参考别人的想法,用异或的方法实在是太绝了。A ^ A = 0 and A ^ B ^ A 阅读全文
posted @ 2016-02-26 23:49 scottwang 阅读(224) 评论(0) 推荐(0) 编辑
摘要: 1.原始问题 假设是定义在上的连续可微函数(为什么要求连续可微呢,后面再说,这里不用多想),考虑约束最优化问题: 称为约束最优化问题的原始问题。 现在如果不考虑约束条件,原始问题就是: 因为假设其连续可微,利用高中的知识,对求导数,然后令导数为0,就可解出最优解,很easy. 那么,问题来了(呵呵。 阅读全文
posted @ 2016-02-26 12:53 scottwang 阅读(250) 评论(0) 推荐(0) 编辑