码迷,mamicode.com
首页 >  
搜索关键字:seek    ( 696个结果
poj 2752 Seek the Name, Seek the Fame【KMP】
点击打开题目 Seek the Name, Seek the Fame Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 12651   Accepted: 6214 Description The little cat is so famous, th...
分类:其他好文   时间:2014-11-30 07:06:59    阅读次数:146
POJ 2752 (KMP 所有可能长度的前缀后缀) Seek the Name, Seek the Fame
题意:求一个字符串的相同前缀后缀的所有可能的长度,这里该字符串其本身也算自己的前缀和后缀。分析:我们知道next数组的性质是,该字符之前的字符串的最大相同前缀后缀。既然知道了最大的,即next[len]。递归一次next[ next[len] ],就能求得更小的前缀。不断的递归把所有所有可能的长度找...
分类:其他好文   时间:2014-11-21 10:29:01    阅读次数:252
Socket局域网多线程传输文件的方法
1.思路:为了实现各种大小的文件都可发送和接收,可设置缓冲区循环发送和接收,并记录文件读到的位置,如果某次读入到缓冲区的字节数小于缓冲区的大小,则说明文件发送完了,退出发送循环,关闭连接。并且Csocket是阻塞的,接收端接能接收到发送端发送的所有内容,直到发送端连接关闭,接收端退出接收循环。 //循环发送文件 2.主要代码 发送端: do { file.Seek(step,CFile...
分类:编程语言   时间:2014-11-19 12:39:32    阅读次数:225
POJ2752——Seek the Name, Seek the Fame
Seek the Name, Seek the Fame Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 12620   Accepted: 6198 Description The little cat is so famous, that many couples ...
分类:其他好文   时间:2014-11-19 11:18:35    阅读次数:275
HDU 4821 String 字符串HASH
又get了一种新的Hash方法。Seed取素数可以降低取余相同的概率,目测是这样的。 Hash[i] = Hash[i+1] *Seed + s[i]-'a'。 那么 [i,i+l-1]这一段的Hash值即为Hash[i] - Hash[i+l]*Seek^l。 #include #include #include #include #include #include #incl...
分类:其他好文   时间:2014-11-19 01:32:09    阅读次数:220
c语言中文件的读写、fp位置操作
#include<stdio.h>#include<stdlib.h>intmain() { FILE*file; file=fopen("./text","rb"); //获取文件长度 fseek(file,0,SEEK_END); inttell_len=ftell(file); fseek(file,0,SEEK_SET); char*buff=(char*)mem_get(char,tell_len+1); intread_len=fread(buff,len,..
分类:编程语言   时间:2014-11-11 23:06:58    阅读次数:423
RandomAccessFile和nio的"内存映射文件(memory-mapped files)"
RandomAccessFile RandomAccessFile的唯一父类是Object,与其他流父类不同。是用来访问那些保存数据记录的文件的,这样你就可以用seek( )方法来访问记录,并进行读写了。这些记录的大小不必相同;但是其大小和位置...
分类:移动开发   时间:2014-11-04 13:21:22    阅读次数:168
Exercise 20: Functions And Files
from sys import argvscript, input_file = argvdef print_all(f): print f.read() def rewind(f): f.seek(0)def print_a_line(line_count, f): pri...
分类:其他好文   时间:2014-10-24 10:25:01    阅读次数:253
Unix_文件I/O
lseek函数off_t lseek(int filedes, off_t offset, int whence);whence: SEEK_SET, 表示将文件的偏移量设置为距文件开始offset个字节。 SEEK_CUR, 当前+offset个字节,offset可正可负。 SEE...
分类:其他好文   时间:2014-10-22 20:07:39    阅读次数:230
Java RandomAccessFile用法
RandomAccessFile RandomAccessFile是用来访问那些保存数据记录的文件的,你就可以用seek( )方法来访问记录,并进行读写了。这些记录的大小不必相同;但是其大小和位置必须是可知的。但是该类仅限于操作文件。RandomAccessFile不属于InputStream和Ou...
分类:数据库   时间:2014-10-22 14:07:34    阅读次数:297
696条   上一页 1 ... 64 65 66 67 68 ... 70 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!