Given a stringSand a stringT, count the number of distinct subsequences ofTinS.A subsequence of a string is a new string which is formed from the orig...
分类:
其他好文 时间:
2014-08-22 21:06:19
阅读次数:
203
环境:OFFICE WORD 2007
打开WORD,在菜单的“视图”->“宏”->“查看宏”->“创建”
Sub 宏1()
Dim MyFile As String
Dim Arr(1000) As String '一次处理最大的文件数量,根据需要修改数字1000改为需要处理的数量
Dim count As Integer
MyFile = Dir("F:\...
分类:
Web程序 时间:
2014-08-22 19:48:19
阅读次数:
304
今天有个简单的小需求:求列表中每个元素的个数,实现的方法有好几种,这里我就说一个用set来实现的。#!/usr/bin/envpython
fa=[1,2,3,4,5,3,2,1,1,1,1,1,1,3,3,3,3,3]
fb=set(fa)
foriinfb:
printi,fa.count(i)首先定义了一个列表,然后将列表使用set初始化之后赋值给fb,在..
分类:
编程语言 时间:
2014-08-22 18:13:49
阅读次数:
176
程序开发中经常会碰到处理文本文件中数据的情况,这里通过一个例子来看用java实现文本文件分组汇总的方法:从文本文件employee.txt中读取员工信息,按照DEPT分组,求出每组的员工个数COUNT和薪酬SALARY总额。文本文件empolyee.txt的格式如下:EIDNAMESURNAMEGENDERSTATEBIRTHDA..
分类:
编程语言 时间:
2014-08-22 18:12:40
阅读次数:
1166
Problem 32
We shall say that an n-digit number is pandigital if it makes use of all the digits 1 to n exactly once; for example, the 5-digit
number, 15234, is 1 through 5 pandigital.
The produ...
分类:
其他好文 时间:
2014-08-22 16:23:19
阅读次数:
178
SharpZipLib 文件/文件夹压缩一、ZipFile ZipFile类用于选择文件或文件夹进行压缩生成压缩包。 常用属性:属性说明Count文件数目(注意是在ComitUpdat之后才有)Password压缩包密码Size压缩包占用空间大小Name压缩包名称,默认输出是文件路径ZipEnt.....
分类:
其他好文 时间:
2014-08-22 16:08:39
阅读次数:
247
题目:UVA - 357Let Me Count The Ways(完全背包)
题目大意:给出N,问用1, 5, 10, 25, 50,这些硬币能够凑出N的方式有多少种。
代码:
#include
#include
const int N = 5;
const int maxn = 30005;
const int coin[N] = {1, 5, 10, 25, 50...
分类:
其他好文 时间:
2014-08-22 13:01:38
阅读次数:
150
在讨论匿名管道之前,我们先回顾下read和write系统调用以及fgets函数 #include ssize_t read(int fd, void *buf, size_t count);当read成功时,返回值为读到的字符数。当遇见文件结尾时,返回0(也就是什么都读不出来了)。出错,返回-1。—...
分类:
其他好文 时间:
2014-08-22 12:23:36
阅读次数:
224
题解:利用next数组来保存前缀位置,递推求解。#include #include char pat[200005];int next[200005],M,f[200005];const int MOD=10007;int getnext(){ int i=1,j=0;next[1]=0; ...
分类:
其他好文 时间:
2014-08-22 12:20:16
阅读次数:
201
From now on, I'm gonna say yes--yes to love, yes to adventure, yes to life, whatever it maybe, the answer's going to be yes从今天起,我要积极接受一切,接受爱,迎接挑战,拥抱生活...
分类:
其他好文 时间:
2014-08-22 09:15:45
阅读次数:
241