[TOC] 背景 树链剖分只能解决静态的树上的问题, 但是对于动态的树上问题,树链剖分就凉了,LCT成为首选 ~~虽然不知道为什么是先发明的LCT,再出现的树链剖分~~ 主要思想 为什么树链剖分的时间复杂度小? 因为对于一堆点可以直接维护, LCT也是一样的道理 用splay维护一堆点,splay之 ...
分类:
其他好文 时间:
2020-01-10 22:21:04
阅读次数:
85
#Hamlet词频统计(含Hamlet原文文本) #CalHamletV1.py def getText(): txt = open("hamlet.txt", "r").read() txt = txt.lower() for ch in '!"#$%&()*+,-./:;<=>?@[\\]^_‘ ...
分类:
其他好文 时间:
2020-01-10 20:14:25
阅读次数:
283
$SAM$ + $LCT$ 维护 $parent树$ 每次插入一个点对应修改 $LCT$ 并链加,相当于在链上的 $\rm endpos$ 中添加一个新的位置。 匹配就在 $SAM$ 上跑即可。 2020.01.10 ...
分类:
其他好文 时间:
2020-01-10 18:45:14
阅读次数:
54
// num要处理的数据,retain保留几位 function keepNum(num, retain) { num = Number(num); num = num.toFixed(retain+1).split("."); num = num[0] + "." + num[1].substri ...
分类:
Web程序 时间:
2020-01-10 17:19:01
阅读次数:
92
点击选择你要分屏的页面 【Window】—>【Editor Tabs】—>【Split Vertically】or【Split Horizontally】 ...
分类:
Web程序 时间:
2020-01-10 12:45:02
阅读次数:
112
先在server.js里面引入: var fs = require('fs'); 然后写入 // 往writeme.txt文件 写入一些内容 fs.writeFile('./writeme.txt', [zuidi, now, address, text], function (err) { // ...
分类:
Web程序 时间:
2020-01-10 10:56:03
阅读次数:
89
.net中以扩展CheckBoxListFor为例 public static MvcHtmlString CheckBoxListFor<TModel, TProperty>(this HtmlHelper<TModel> htmlHelper, Expression<Func<TModel, T ...
分类:
Web程序 时间:
2020-01-10 10:43:37
阅读次数:
114
今天修改一个问题。 xml中使用的是#{xxxx jdbcType=String} 但是这个sql 查询需要用到 in 如果这样查询 会变成 in ( "1,2,3,4,5") 所以我把他改成 in <foreach collection="xxx.split(',')" item="item" o ...
分类:
其他好文 时间:
2020-01-09 00:57:23
阅读次数:
361
一、split()可以基于指定的分割符将字符串分割成多个子字符串,如果不指定分割符,则默认使用空白符(换行符/空格/制表符) 示例: f = "hello world" f1 = f.split("o") print(f1) f2 = f.split() print(f2) f3 = f.split ...
分类:
编程语言 时间:
2020-01-08 23:16:24
阅读次数:
459
// JS截取字符串可使用 substring()或者slice() // // 函数:substring() // 定义:substring(start,end)表示从start到end之间的字符串,包括start位置的字符但是不包括end位置的字符。 // 功能:字符串截取,比如想从"Minid ...
分类:
Web程序 时间:
2020-01-08 10:27:01
阅读次数:
84