#include#includeint harsh[10066];int arr[100066];int main(){ memset(harsh,0,sizeof(harsh)); memset(arr,0,sizeof(arr)); int n; scanf("%d",&n); for...
分类:
编程语言 时间:
2015-03-02 22:24:09
阅读次数:
188
在ANSI SQL 标准中unique 有两种实现方式 1、是可以插入多个空值、也就是说多个null值看成是互不相同的。 2、是只可以插入一个空值,也主是说把所有的空值看也是相同的。在SQL Server | MySQL 中实现的是第二种标准。例子:(代码以SQL server 的语法为例) ...
分类:
数据库 时间:
2015-03-02 18:25:33
阅读次数:
160
// FirstTest.cpp : 定义控制台应用程序的入口点。
//UUID是University Unique Identifier的缩写,它是一个128位的数字(16字节),不需要有一个中央认证机构就可以创建全国唯一的标示符。别名:GUID
#include "stdafx.h"
#include
#include
#include
#include
#include
#inc...
分类:
其他好文 时间:
2015-03-02 16:59:48
阅读次数:
142
Write a program to solve a Sudoku puzzle by filling the empty cells.
Empty cells are indicated by the character '.'.
You may assume that there will be only one unique solution.
A sudoku...
分类:
其他好文 时间:
2015-03-02 14:53:12
阅读次数:
135
当定义一个命名空间时,可以忽略这个命名空间的名称: namespce {char c; int i;double d; } 编译器在内部会为这个命名空间生成一个唯一的名字,而且还会为这个匿名的命名空间生成一条using指令。所以上面的代码在效果上等同于: namespace __UNIQUE_NAM...
分类:
编程语言 时间:
2015-03-02 13:03:57
阅读次数:
234
C++ 智能指针
flyfish 2015-3-1
使用原始指针进行显示内存管理在性能上有优势,但容易出错。诸如 野指针,重复释放,内容泄露等。
C++为了在编程语言上支持更好的内存管理机制,C++98提供了auto_ptr,因为auto_ptr的缺点在C++11中被废弃,C++11提供了
unique_ptr,shared_ptr,weak_ptr等智能指针在自动回收堆分配的内存,智能指...
分类:
编程语言 时间:
2015-03-01 17:09:47
阅读次数:
253
Branches are just pointers to commitsEvery branch is simply a named pointer to a commit. A special unique pointer for every repository is the HEAD whi...
分类:
其他好文 时间:
2015-03-01 13:04:49
阅读次数:
104
1.题目描述:点击打开链接
2.解题思路:本题实质上还是利用Kruskal算法来生成MST。首先按照边权值由小到大排序,对于一个连续的边集[L,R],如果使得这n个点全部连通,则一定存在一个苗条度不超过w[R]-w[L]的生成树。因此,可以从小到大枚举L,对于每一个L,利用Kruskal算法生成最小生成树后,计算苗条度,用ans取最小的即可。如果枚举结束后ans依然是INF。那么输出-1。这里可...
分类:
其他好文 时间:
2015-02-28 16:38:49
阅读次数:
159
1.array_unique()移除数组中的重复的值,并返回结果数组。当几个数组元素的值相等时,只保留第一个元素,其他的元素被删除,对每个值只保留第一个遇到的键名,接着忽略所有后面的键名。返回的数组中键名不变。2.array_intersect() 返回两个或多个数组的交集数组比如:"Cat",1=...
分类:
编程语言 时间:
2015-02-28 16:18:49
阅读次数:
184
Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.
Note: Elements in a triplet (a,b,c) must ...
分类:
其他好文 时间:
2015-02-28 14:35:46
阅读次数:
140