码迷,mamicode.com
首页 >  
搜索关键字:pos    ( 22785个结果
删除字符串中连续的若干字符
#include char del(char s[],int pos,int len){ int i; for(i = pos+len-1; s[i] != '\0'; i ++, pos ++) { s[pos - 1] = s[i]; } s[pos - 1] = '\0'; return s....
分类:其他好文   时间:2015-04-24 20:57:53    阅读次数:143
opencv 内存解析jpg文件
刚需要用到接受到的jpg二进制文件,直接在内存做解析,mark一下,下面给出测试代码。FILE*file; file=fopen("D:/221606322483223.jpg","rb"); fseek(file,0,SEEK_END); fpos_tpos; fgetpos(file,&pos); char*data=newchar[pos]; fseek(file,0,0); intsjinum=fread(data,siz..
分类:其他好文   时间:2015-04-24 19:24:42    阅读次数:110
Sequence Classification
Natural Language Processing with PythonCharpter 6.1 1 import nltk 2 from nltk.corpus import brown 3 4 def pos_features(sentence,i,history): 5 fea...
分类:其他好文   时间:2015-04-24 13:57:26    阅读次数:176
编程之美中判断某个字符串是否是另一个字符串的移位结构的子串
#include #include using namespace std; bool is_circle(string src,string des) { if(src.empty()||des.empty()) return false; string temp=src; temp+=src; string::size_type pos=0; pos=temp.find(des)...
分类:其他好文   时间:2015-04-23 15:50:07    阅读次数:131
自然语言处理的一些工具文档介绍
NLP, NER, POS, CHUNK, 分词, tool,...
分类:编程语言   时间:2015-04-23 13:29:58    阅读次数:251
topcoder srm656 1000分题
Problem Statement   You are given an int N and a int[] pos. We are interested in some permutations of the set {1,2,...,N}. A permutation p is called good if the following condition is sa...
分类:其他好文   时间:2015-04-21 22:45:42    阅读次数:198
leetcode第26题-Remove Duplicates from Sorted Array
本题也属于easy模式,题意是说去掉一个有序数组中的重复部分,而且不需要额外的开销,只能在初始数组中做文章。这种题目就有一种固定的套路,就是使用两个指标,一个向前走,一个断后,我定义的i就是取到数组中的每一个数,pos是去掉重复之后的位置。最后多说一句,一定要注意判断原数组是否为空啊,粗心马虎真的不可取,谨记!#include #include int removeDuplicates(int ...
分类:其他好文   时间:2015-04-21 18:13:33    阅读次数:120
哈希 字符串匹配
#include #include #include #include #include #include #include using namespace std; #define maxn 1000000 string s1; string s2; int go[maxn]; int Hash; int pos[maxn]; int Pow(int a, int b) {...
分类:其他好文   时间:2015-04-21 14:38:04    阅读次数:137
HDU 4416 Good Article Good sentence
思路倒是一直有,就是好难实现,最后写出来了还是WA了,然后参考了别人的思路 才发现自己对于字符串的不同子串数的求解原理还不是很清楚,然后重新理解了遍 在这道题中,我们每找到一个A后缀,只要找出该后缀已经计算过的子串数就可以了,用pos数组保存 最后还要注意ans要用long long,并且在计算之前就先进行类型转换 #include #include #include using nam...
分类:其他好文   时间:2015-04-21 13:03:41    阅读次数:141
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!