unique()函数是一个去重函数,STL中unique的函数 unique的功能是去除相邻的重复元素(只保留一个),还有一个容易忽视的特性是它并不真正把重复的元素删除。他是c++中的函数,所以头文件要加#include,具体用法如下: int num[100]; unique(num,mun+n)...
分类:
其他好文 时间:
2014-10-19 19:53:59
阅读次数:
152
Given an arraySofnintegers, are there elementsa,b,cinSsuch thata+b+c= 0? Find all unique triplets in the array which gives the sum of zero.Note:Elemen...
分类:
其他好文 时间:
2014-10-19 19:52:08
阅读次数:
148
Problem Description
在图论中,树:任意两个顶点间有且只有一条路径的图。
生成树:包含了图中所有顶点的一种树。
最小生成树:对于连通的带权图(连通网)G,其生成树也是带权的。生成树T各边的权值总和称为该树的权,权最小的生成树称为G的最小生成树(Minimum Spanning Tree)。最小生成树可简记为MST。
但是,对于一个图而言,最小生成树并不是唯一的。
现...
分类:
其他好文 时间:
2014-10-19 11:36:48
阅读次数:
131
Highways
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 22842
Accepted: 10525
Description
The island nation of Flatopia is perfectly flat. Unfortunately...
分类:
其他好文 时间:
2014-10-19 10:13:53
阅读次数:
217
前期准备: create table T9(A int ,B text,C text,fulltext index fix_test_for_T8_B(B));#在定义表的时候加索引 create unique index ix_test_for_T8_A on T9(A);#加...
分类:
数据库 时间:
2014-10-18 12:30:57
阅读次数:
230
Problem:Given an arraySofnintegers, are there elementsa,b,c, anddinSsuch thata+b+c+d= target? Find all unique quadruplets in the array which gives the...
分类:
其他好文 时间:
2014-10-17 21:54:28
阅读次数:
249
LCM Cardinality
Input: Standard Input
Output: Standard Output
Time Limit: 2 Seconds
A pair of numbers has a unique LCM but a single number can be the LCM of more than one possible pairs. For ex...
分类:
其他好文 时间:
2014-10-17 15:37:49
阅读次数:
260
Givenn, generate all structurally uniqueBST's(binary search trees) that store values 1...n.For example,Givenn= 3, your program should return all 5 uni...
分类:
其他好文 时间:
2014-10-17 15:23:35
阅读次数:
148
[leetcode]Given n, generate all structurally unique BST's (binary search trees) that store values 1...n....
分类:
其他好文 时间:
2014-10-17 12:08:07
阅读次数:
165
Problem
After years of study, scientists at Google Labs have discovered an alien language transmitted from a faraway planet. The alien language is very unique in that every word consists of exactly L...
分类:
其他好文 时间:
2014-10-17 01:17:53
阅读次数:
392