PAT (Basic Level) Practise (中文)
分类:
其他好文 时间:
2014-08-27 23:24:08
阅读次数:
260
PAT (Basic Level) Practise (中文)
分类:
其他好文 时间:
2014-08-27 23:14:38
阅读次数:
386
awk是处理文本,并格式化输出的一种工具。若只是检索数据文本过滤来讲,grep的性能要远好于awk。这里再次回顾下awk的基本语法格式1awk[option]….‘program‘file…格式2awk[option]….‘/PATTERN/{action}‘file….默认的输出分隔符是空白,这里awk支持可以使用类似正则表达式的方..
分类:
其他好文 时间:
2014-08-26 03:06:16
阅读次数:
400
/** * Created by xie on 14-8-24. */public class KMP { private String pat; private int M; private int R=256; private int dfa[][]; public...
分类:
其他好文 时间:
2014-08-24 15:25:32
阅读次数:
309
/** * Created by xie on 14-8-24. */ public class KMP { private String pat; private int M; private int R=256; private int dfa[][]; public KMP(String pa...
分类:
其他好文 时间:
2014-08-24 15:22:42
阅读次数:
227
题解:利用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
题解:将原来的串扩展为两倍,然后用KMP匹配。#include #include char str[200005],pat[100005];int next[100005],N,M;void getnext(){ int i=1,j=0;next[1]=0; while(iM)retur...
分类:
其他好文 时间:
2014-08-21 20:54:54
阅读次数:
197
1 #include 2 3 int main() { 4 long n, a, b, c; 5 long i; 6 int ga, gb, gc, r; 7 scanf("%ld", &n); 8 for (i=...
分类:
其他好文 时间:
2014-08-21 00:08:23
阅读次数:
184
题意:给出一列数字,可以构成完全二叉搜索树,求构成的完全二叉搜索树的层次遍历
思路:构建树的过程可以看做是不断寻找子树根节点的过程
根据完全二叉树的特征,可以通过确定左子树的子孙节点个数来确定对应的根节点下标
递归构建即可。
代码:
#include
#include
#include
#include
#include
using namespac...
分类:
其他好文 时间:
2014-08-19 10:56:24
阅读次数:
206
在cocos2d-x中集成百度语音识别的时候,运行build_native.py会把libs/armeabi目录清空。 以下是解决办法,把so文件放在jni/prebuilt里面。 修改Android.mk文件,主要有两行`include $(CLEAR_VARS)` ``` LOCAL_PAT...
分类:
移动开发 时间:
2014-08-18 23:42:43
阅读次数:
488