Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.
For example,
Given 1->2->3->3->4->4->5, return 1->2->5.
Given 1->1-...
分类:
其他好文 时间:
2014-10-12 15:51:58
阅读次数:
190
SELECT DISTINCT * INTO #temp FROM grade;
DROP TABLE grade;
SELECT * INTO grade FROM #temp;
DROP TABLE #temp;
SELECT DISTINCT * INTO #temp FROM grade;
DROP TABLE grade;
SELECT * INTO grade FROM #temp;
DROP TABLE #temp;...
分类:
数据库 时间:
2014-10-11 19:53:06
阅读次数:
191
引自:http://blog.csdn.net/shaopengfei/article/details/36426763从C# 3.0开始提供了Distinct方法,这对于集合的使用有了更为丰富的方法,经过在网上搜索相应的资源,发现有关这方面的写的好的文章还是不少的。而且为了扩展Linq的使用不方便...
题目链接:http://poj.org/problem?id=1458思路: 经典的最长公共子序列问题,使用动态规划解题。代码:#include #include using namespace std;const int MAX_N = 200 + 10;int dp[MAX_N][MAX_N]....
分类:
其他好文 时间:
2014-10-11 02:14:34
阅读次数:
201
Time Limit:3000MS Memory Limit:65536KB
Description You are given a sequence a[0]a[1] ... a[N-1] of digits and a prime number Q. For each i<=j with a[i] != 0, the subsequence a[i]a[i+1]...a[j] can be...
分类:
其他好文 时间:
2014-10-10 22:24:14
阅读次数:
256
Polymorphism is often referred to as the third pillar of object-oriented programming, after encapsulation and inheritance. It has two distinct aspects:
At run time, objects of a derived class may...
分类:
其他好文 时间:
2014-10-10 14:05:54
阅读次数:
158
Problem DescriptionThere are 2 special dices on the table. On each face of the dice, a distinct number was written. Consider a1.a2,a3,a4,a5,a6 to be n...
分类:
其他好文 时间:
2014-10-10 00:22:52
阅读次数:
482
Labeling BallsTime Limit:1000MSMemory Limit:65536KTotal Submissions:11146Accepted:3192DescriptionWindy hasNballs of distinct weights from 1 unit toNun...
分类:
其他好文 时间:
2014-10-10 00:12:37
阅读次数:
264
Problem DescriptionA subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = another ....
分类:
其他好文 时间:
2014-10-09 21:57:27
阅读次数:
219
开发中有些按日期记录的记录需要各种维度的统计,按天,按月,按年,按小时,。。分组统计,还有些需要对字段去重统计,在之前的 [Mongo] 按时间分组统计(group时间格式化) 中用group实现了按天的统计,不过使用new Date()方法会有些坑,今天看了下aggregate中,使用聚合来写个时间统计。
tips: aggregate 挺复杂,弄明白了再做笔记,现在只是根据需求来查询。...
分类:
其他好文 时间:
2014-10-09 17:00:37
阅读次数:
214