6073 Math MagicYesterday, my teacher taught us about math: +, -, *, /, GCD, LCM... As you know, LCM (Leastcommon multiple) of t...
分类:
其他好文 时间:
2014-07-08 12:43:37
阅读次数:
218
Windows多文档窗口编程中,需要注意的以下几点:1、主窗口与文档窗口之间还有一个Client Window。2、创建文档窗口。通常认为创建子窗口就用CreateWindow,但是MDI中创建文档窗口时,用的是发送消息的方式。具体的CreateWindow的工作由Client Window来完成。...
Update: July 4, 2014 Chap 5: At the beginning, he mentioned that: recursion is a divide-and-conquer method. Although many algorithms can be solved in ...
分类:
其他好文 时间:
2014-07-06 15:24:36
阅读次数:
213
尽管使用EXT开发了一段时间,可是自己认为我对javascript还是不是非常熟,所以边看书边做小样例 给自己以后用到的时候查看下,都是非常主要的东西,对刚開始学习的人可能有点帮助以下是代码 Java代码 grid 多选须要添加?multiple属性 在多选中size属...
分类:
Web程序 时间:
2014-07-06 13:04:19
阅读次数:
267
Description
Little John is herding his father's cattles. As a lazy boy, he cannot tolerate chasing the cattles all the time to avoid unnecessary omission. Luckily, he notice that there were N trees...
分类:
其他好文 时间:
2014-07-06 10:39:09
阅读次数:
188
题目链接:uva 11246 - K-Multiple Free set
题目大意:给定n,k。求一个元素不大于n的子集,要求该子集的元素尽量多,并且不含两个数满足a?k=b.
解题思路:容斥原理,f(i)=(?1)inki,取f函数的和即可。
#include
#include
#include
using namespace std;
typedef long long ...
分类:
其他好文 时间:
2014-07-06 09:58:18
阅读次数:
177
按他的方法排序,每次移动一个数到顶点,排成需要的序列。
Problem D: ShellSort
He made each turtle stand on another one's back
And he piled them all up in a nine-turtle stack.
And then Yertle climbed up. He sat down on the p...
分类:
其他好文 时间:
2014-07-06 09:15:42
阅读次数:
211
链表的归并排序
超时的代码
class Solution:
def merge(self, head1, head2):
if head1 == None:
return head2
if head2 == None:
return head1
# head1 and head2 point to the same link list
if head1 == he...
分类:
编程语言 时间:
2014-07-06 09:09:51
阅读次数:
275
今天又看CS630[1]的Chapter 15,发现里头的一个例程manydots.s无法正常编译。
$ gcc manydots.s -o manydots
/tmp/ccIvmRVT.o: In function `_start':
(.text+0x0): multiple definition of `_start'
/usr/lib/gcc/x86_64-linux-gnu/4....
分类:
其他好文 时间:
2014-07-06 00:50:42
阅读次数:
206
单链表的反转可以使用循环,也可以使用递归的方式
1.循环反转单链表
循环的方法中,使用pre指向前一个结点,cur指向当前结点,每次把cur->next指向pre即可。
代码:
class ListNode:
def __init__(self,x):
self.val=x;
self.next=None;
def nonrecurse(he...
分类:
编程语言 时间:
2014-07-06 00:24:52
阅读次数:
331