描述:使用了递归,有些计算是重复的,用了额外的空间,Version 1是m*nBonus:一共走了m+n步,例如 m = 2, n = 3 [#, @, @, #, @],所以抽象成数学问题,解是C(m + n, m)代码: 1 class Solution: 2 # @return an ...
分类:
其他好文 时间:
2014-08-11 17:06:32
阅读次数:
155
The Unique MST
Time Limit: 1000MS
Memory Limit: 10000K
Total Submissions: 20421
Accepted: 7183
Description
Given a connected undirected graph, tell if its minimum spann...
分类:
其他好文 时间:
2014-08-11 15:07:32
阅读次数:
213
#include #include using namespace std;int a[10];int main(){ int i; for(i = 0;i<=9;i++) { scanf("%d",&a[i]); } int k = unique(a,a...
分类:
其他好文 时间:
2014-08-11 14:57:32
阅读次数:
151
The Unique MST
Time Limit: 1000MS
Memory Limit: 10000K
Total Submissions: 20421
Accepted: 7183
Description
Given a connected undirected graph, tell if its minimum s...
分类:
其他好文 时间:
2014-08-11 11:57:22
阅读次数:
293
notnull约束。notnull约束只能在列名后面声明,不能使用constraint语句声明,当然也就没无法声明约束名称了。更改字段为null或者notnull只能使用altertabletable_namemodifycol_name(not)null;无法使用constraint语句修改。也就是说notnull虽然是约束,但是却和constraint语句..
分类:
数据库 时间:
2014-08-11 10:18:02
阅读次数:
221
本文主要解决MySQL中如何删除unique key约束
分类:
数据库 时间:
2014-08-10 21:10:01
阅读次数:
327
1 简单数组去重 1 Array.prototype.unique = function(){ 2 var obj={},res=[]; //temp用于存放去重后的元素 3 4 for(var i=0;i<this.length;i++){ 5 ...
分类:
其他好文 时间:
2014-08-10 18:10:20
阅读次数:
219
以后坚持每个星期都写记到算法题,不论简单还是难,纯熟娱乐!
描述:
实现一个算法来判断一个字符串中的字符是否唯一(即没有重复).不能使用额外的数据结构。 (即只使用基本的数据结构)
代码:
#include
#include
#include
#include
bool isUnique(const std::string& vStr)
{
if (vStr.size() ...
分类:
其他好文 时间:
2014-08-10 13:07:10
阅读次数:
185
事情是这样的:
博主尝试用Python的sqlite3数据库存放加密后的用户名密码信息,表是这样的CREATE TABLE IF NOT EXISTS user
(
userID INTEGER PRIMARY KEY AUTOINCREMENT,
userStudentID BLOB NOT NULL UNIQUE ON CONFLICT IGNORE,
use...
分类:
数据库 时间:
2014-08-10 01:50:29
阅读次数:
427
1.1 Implement an algorithm to determine if a string has all unique characters. Whatif you cannot use additional data structures? 1 #include 2 #includ....
分类:
其他好文 时间:
2014-08-09 18:17:58
阅读次数:
199