随笔分类 -  编程相关

摘要:From:steve-yegge.blogspot.comI've been working for the past 15 months on repairing my rusty math skills, ever since I read abiographyofJohnny von Neumann. I've read a huge stack of math books, and I have an even bigger stack of unread math books. And it's starting to come together.Let me 阅读全文
posted @ 2013-02-15 20:40 Maxwell:My Blog 阅读(377) 评论(0) 推荐(0)
摘要:思路 : 直接枚举 1 /* 2 PROG: Finding crosses 3 ID : 4 LANG: C++ 5 */ 6 //#pragma warnning (diaable : 4530) 7 //#pragma warnning (disable : 4786) 8 9 #include <set> 10 #include <map> 11 #include <list> 12 #include <stack> 13 #include <queue> 14 #include <cmath> 15 #inclu 阅读全文
posted @ 2012-10-01 15:36 Maxwell:My Blog 阅读(314) 评论(0) 推荐(0)
摘要:原题是 : TopCoder SRM 416 DIV 2 Same binary weight先看看这几个例子:1717(0110 1011 0101),下一位是 1718(0110 1011 0110)767(0010 1111 1111),下一位是 895(0011 0111 1111)348(0001 0101 1100),下一位是 355(0001 0110 0011)其中不难发现一个规律,从右起的第一个“01”改变为“10”,并且在“01”的后面所有的“1”都移动至最后,事实上,这个就是解题的关键点,那么整个问题求解的核心就转移到这两个子问题:1. 将右起第一个“01”,改变为“10 阅读全文
posted @ 2012-09-21 10:33 Maxwell:My Blog 阅读(445) 评论(0) 推荐(1)
摘要:2009 Competition Highlights by ICPC LiveLinks:http://www.youtube.com/watch?v=n0oZRcAz6w0 阅读全文
posted @ 2012-09-07 12:46 Maxwell:My Blog 阅读(119) 评论(0) 推荐(0)
摘要:原文链接:http://www.slyar.com/blog/stdlib-qsort.htmlqsort包含在<stdlib.h>头文件中,此函数根据你给的比较条件进行快速排序,通过指针移动实现排序。排序之后的结果仍然放在原数组中。使用qsort函数必须自己写一个比较函数。函数原型:void qsort ( void * base, size_t num, size_t size, int ( * comparator ) ( const void *, const void * ) );用法以及参数说明:Sorts the num elements of the array p 阅读全文
posted @ 2012-07-23 16:25 Maxwell:My Blog 阅读(691) 评论(0) 推荐(0)