http://acm.hdu.edu.cn/showproblem.php?pid=4339
Problem Description
You are given two strings s1[0..l1], s2[0..l2] and Q - number of queries.
Your task is to answer next queries:
1) 1 a i c...
分类:
其他好文 时间:
2015-02-03 13:13:46
阅读次数:
157
原题地址基本链表操作代码: 1 ListNode *addTwoNumbers(ListNode *l1, ListNode *l2) { 2 ListNode *h = NULL; 3 ListNode *t = NULL; 4 int carry ...
分类:
其他好文 时间:
2015-01-30 19:13:02
阅读次数:
136
哈夫曼树又称最优二叉树,是一种带权路径长度最短的二叉树。所谓树的带权路径长度,就是树中所有的叶结点的权值乘上其到根结点的 路径长度(若根结点为0层,叶结点到根结点的路径长度为叶结点的层数)。树的带权路径长度记为WPL= (W1*L1+W2*L2+W3*L3+...+Wn*Ln),N个权值Wi(i=1...
分类:
其他好文 时间:
2015-01-30 15:17:37
阅读次数:
155
题目:
Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first
two lists.
我的解法:
(1)算法思想:
先根据两个链表l1,l2头结点值的大小设置要返回链表的头结点h...
分类:
其他好文 时间:
2015-01-29 17:44:28
阅读次数:
116
可看到Linux支持的信号列表:
$ kill -l1) SIGHUP 2) SIGINT 3) SIGQUIT 4) SIGILL 5) SIGTRAP 6) SIGABRT 7) SIGBUS 8) SIGFPE 9) SIGKILL 10) SIGUSR1 11) SIGSEGV ...
分类:
系统相关 时间:
2015-01-29 15:53:59
阅读次数:
314
一、基础数据类型
1、布尔型(boolean)
布尔型(boolean) :true/false,不可以以0或非0的数字代替;不能进行数据之间的转换。
2、整数类型
整型默认为int型,而long类型表示的范围要超出int表数范围,所以,声明long类型时,常量后要加L(l)。
如:long l1=12345678 // 数值在int范围之内,还不会出错
lo...
分类:
编程语言 时间:
2015-01-28 17:57:50
阅读次数:
178
Given a singly linked list L: L0→L1→…→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→…You must do this in-place without altering the nodes' values.For ....
分类:
编程语言 时间:
2015-01-28 07:22:02
阅读次数:
210
A -Frogs' NeighborhoodTime Limit:5000MSMemory Limit:10000KB64bit IO Format:%I64d & %I64uSubmitStatusDescription未名湖附近共有N个大小湖泊L1,L2, ...,Ln(其中包括未名湖),每个湖...
分类:
其他好文 时间:
2015-01-26 20:58:53
阅读次数:
170
题意:两个字符串,判断最长公共子序列的长度。思路:直接看代码,,注意边界处理代码:char s1[505], s2[505];int dp[505][505];int main(){ while(scanf("%s%s",s1,s2)!=EOF){ int l1=strlen(s...
分类:
其他好文 时间:
2015-01-24 22:44:01
阅读次数:
126