hash_multiset的元素不会被自动排序...
分类:
其他好文 时间:
2015-07-14 18:11:34
阅读次数:
113
hash_multimap的元素不能自动排序...
分类:
其他好文 时间:
2015-07-14 18:12:11
阅读次数:
159
......
分类:
其他好文 时间:
2015-07-14 18:08:40
阅读次数:
114
234 Palindrome Linked List链接:https://leetcode.com/problems/palindrome-linked-list/
问题描述:
Given a singly linked list, determine if it is a palindrome.Follow up:
Could you do it in O(n) time and O(...
分类:
其他好文 时间:
2015-07-14 18:06:54
阅读次数:
85
今天学习Funambol的connector开发,官方文档中的例子有问题。
首先,文档中提供的maven命令不可用:
mvn archetype:generate -DarchetypeGroupId=funambol
-DarchetypeArtifactId=funambol-module-archetype -DarchetypeVersion=8.0.0
-DgroupId=acme -DartifactId=acmeconnector
-Darchetyp...
分类:
其他好文 时间:
2015-07-14 18:06:43
阅读次数:
100
3942 - Remember the Word
Neal is very curious about combinatorial problems, and now here comes a problem about words. Knowing that Ray has a photographic memory and this may not trouble him, Neal...
分类:
其他好文 时间:
2015-07-14 18:07:32
阅读次数:
156
题目大意:给出n,k和m,表示有n个人围成一个圈,从第m个人开始(m也要去掉),每次走k步删除掉,问最后剩下人的序号。解题思路: 数学递推
分析:
1 题目是一道变形的约瑟夫环变形问题
2 网上看到一篇很好的数学递推法
问题描述:n个人(编号0~(n-1)),从0开始报数,报到(m-1)的退出,剩下的人继续从0开始报数。求胜利者的编号。编号0-(n-1)是有意义的,因为要模n,所以用0-(...
分类:
其他好文 时间:
2015-07-14 18:06:29
阅读次数:
98
在styles.xml文件中添加下面的样式即可
@style/TabTextStyle
20sp
修改前
修改后...
分类:
其他好文 时间:
2015-07-14 18:05:46
阅读次数:
90
前言:上一章节写了个回声客服端,回顾一下,客服端是循环读取已知的数据长度,但更多的情况是我们一般无法提前知道数据的长度,那么此时应该如何收发数据?这时需要的就是应用层协议的定义。如:上一节写的回声程序中定义“收到Q就立即终止连接”这么个协议(规则),就是应用层协议。同样,收发数据过程中也需要定好规则以表示数据的边界,或提前告知收发数据的大小。所谓应用层协议就是服务端/客服端实现过程中逐步定义的规则的...
分类:
其他好文 时间:
2015-07-14 18:04:57
阅读次数:
114
【题目链接】:click here~~
【题目大意】:题意:你面前有宽度为1,高度给定的连续木板,每次可以刷一横排或一竖列,问你至少需要刷几次。
Sample Input
Input
5
2 2 1 2 1
Output
3
Input
2
2 2
Output
2
Input
1
5...
分类:
其他好文 时间:
2015-07-14 18:04:14
阅读次数:
129
题目大意:有一间披萨店,要送n个披萨去不同的地方
现在给出每个位置之间的距离,每个位置都可以重复经过,问送完所有披萨再回到店里需要走的最短距离是多少解题思路:这题的话,有两个状态,一个是现所在地点,另一个是已经经过的地点,所以dp数组是二维的
设dp[i][j]为现所在地为i,经过的城市的状态为j的最短路线
那么dp[i][state | (1 << i)] = min(dp[i][state...
分类:
其他好文 时间:
2015-07-14 18:00:56
阅读次数:
197
题目链接:https://leetcode.com/problems/generate-parentheses/
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.
For example, given n = 3, a...
分类:
其他好文 时间:
2015-07-14 18:01:42
阅读次数:
106
将大数转化为小数,例如:
a:12351235 2151321 51514563 5132316
b: 3 1 4 2
type
node=record
id,c:longint;
end;
v...
分类:
其他好文 时间:
2015-07-14 18:01:31
阅读次数:
143
Spiral Matrix
Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.
For example,
Given the following matrix:
[
[ 1, 2, 3 ],
[ 4, 5,...
分类:
其他好文 时间:
2015-07-14 17:59:10
阅读次数:
141
HashMap和LinkedHashMap,TreeMap的区别
1.具体区别如下:
我们在开发的过程中使用HashMap比较多,在Map中在Map 中插入、删除和定位元素,HashMap 是最好的选择。
但如果您要按自然顺序或自定义顺序遍历键,那么TreeMap会更好。
如果需要输出的顺序和输入的相同,那么用LinkedHashMap 可以实现,它还可以按读取顺序来排列....
分类:
其他好文 时间:
2015-07-14 17:58:48
阅读次数:
243
题目很简单
题目描述 Description
做了,简单的a,b和的问题。但是,如果要求输入的情况不是a和b,而是整个加法表达式呢?
请想办法,计算加法表达式的结果。
输入描述 Input Description
输入一个加法表达式,如1+2=。
输出描述 Output Description
计算出输入表达式的正确结果
...
分类:
其他好文 时间:
2015-07-14 18:00:56
阅读次数:
172
思路:数位dp , dp[i][j]表示位数为i且首位数为j的数 符合条件的个数。
代码:
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define N 500010
#d...
分类:
其他好文 时间:
2015-07-14 18:00:56
阅读次数:
87