Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for "abcabcbb" is "abc", which the length is 3....
分类:
其他好文 时间:
2014-04-29 13:47:20
阅读次数:
251
本题可以使用长整形来记录数据的,因为最长不过10^8,但是如果把这题当做是无穷大数来做的话,难度指数就直线上升了。
这里给出使用string来做无穷大减法的解法。
要处理的问题:
1 string大小比较问题,不能使用原始的<号
2 如何进位的问题
3 符号问题,因为这里只求差异就可以了,所以返回绝对值就够了。
这样做本题还是有一定难度, 而且可以锻炼到一些高级点的知识的运用,挺好。...
分类:
其他好文 时间:
2014-04-29 13:46:22
阅读次数:
277
原题链接: http://oj.leetcode.com/problems/interleaving-string/
这是一道关于字符串操作的题目,要求是判断一个字符串能不能由两个字符串按照他们自己的顺序,每次挑取两个串中的一个字符来构造出来。
像这种判断能否按照某种规则来完成求是否或者某个量的题目,很容易会想到用动态规划来实现。
先说说维护量,res[i][j]表示用s1的前i个字符和s...
分类:
其他好文 时间:
2014-04-29 13:46:22
阅读次数:
336
SQLite是一个轻量级的关系型数据库,在访问量不超过10万PV的中小网站中使用绰绰有余。而且使用方便,接口简单,下面从命令行和python接口两方面介绍SQLite3的基本操作。
在linux终端中,通过 sqlite3 a.db 打开a.db数据库,如果不存在会自动创建,创建一个表格:
create table users(id integer primary key,na...
分类:
数据库 时间:
2014-04-29 13:33:21
阅读次数:
489
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
void func()
{
string url;
cout << "输...
分类:
Web程序 时间:
2014-04-29 13:21:20
阅读次数:
506
在java所有类中都有一个共有的父类Object,一个类只要没有明显的继承一个类,则肯定是object类的子类
object类中有常用的四个方法。1、public object()构造方法
2、public boolean equals(object obj)对象比较 3、public int hashcode()取得hash码
4、public String toString();对象打...
分类:
其他好文 时间:
2014-04-29 13:17:21
阅读次数:
373
Problem Description
Given an integer N(0 ≤ N ≤ 10000), your task is to calculate N!
Input
One N in one line, process to the end of file.
Output
For each N, output N! i...
分类:
其他好文 时间:
2014-04-28 10:36:41
阅读次数:
341
会话清除与过期
程序主动清除session数据
设置会话失效:session.invalidate()
移除会话中一个属性:
语法:public void removeAttribute(String name);
服务器主动清除长时间没有再次发出请求的session
设置会话过期时间
方法一:public void setMaxInactiveInterval(int interv...
分类:
编程语言 时间:
2014-04-28 10:36:41
阅读次数:
322
记录一下,自己用过的打开第三方应用的两种方法;
1.//根据包名类名启动第三方应用(要启动的应用的包名,要启动的activity)
openApp("com.xx.test", "com.xx.test.TestActivity");
private void openApp(String pname,String aname){
// changeInputSo...
分类:
其他好文 时间:
2014-04-28 10:25:41
阅读次数:
400
欢迎加入我们的QQ群,无论你是否工作,学生,只要有c / vc / c++ 编程经验,就来吧!158427611
所谓的unicode文件,无非就是在文件头部插入了 0xFFFE的标志。。。读写的时候对应的读写 就可以了。
namespace fileStream
{
bool readFile_Unicode( const string &file ,wstr...
分类:
编程语言 时间:
2014-04-28 10:22:41
阅读次数:
678