思路 比较明显的动态规划问题。状态转移方程为:f(x, y) = grid(x,y) + max {f(x-1,y), f(x, y-1)} 。 优化:这里不使用额外的数组f,而就地更改grid数组,可以将空间复杂度降为O(1)。 1 class Solution { 2 public: 3 int ...
分类:
其他好文 时间:
2020-11-13 13:08:20
阅读次数:
7
D - D CodeForces - 743A Vladik is a competitive programmer. This year he is going to win the International Olympiad in Informatics. But it is not as e ...
分类:
其他好文 时间:
2020-11-13 13:07:43
阅读次数:
10
在Java开发中,持久层最常用的框架就是mybatis,该框架需要编写sql语句,mybatis官方提供逆向工程,可以把数据表自动生成执行所需要的基础代码,例如:mapper接口,sql映射文件,pojo实体类等,避免基础代码维护的繁杂过程。
分类:
其他好文 时间:
2020-11-13 12:07:03
阅读次数:
8
稍微有点难度……不过没有孔姥爷毒瘤( 题意 给定一个单词表,每个单词有权值,取出一部分(不改变顺序)使得这部分的每一个字符串都是后一个的子串,问得到的最大权值。 思路 设 f[i] 表示选了第 i 个字符串之后得到的最大值(截止)\(f[i]=max(f[j])+w[i]\), iff s[j]是s ...
分类:
其他好文 时间:
2020-11-12 14:24:44
阅读次数:
13
拆幂 \(x^n=x+\sum\limits_{i=1}^{n-1} (x-1)x^i\) 可以在递推式或者代数变形的时候用到这个式子,尤其是可以和二项式定理结合起来 例: noi.ac#286 集合 题解: 本地pdf,不知道咋上传qaq ...
分类:
其他好文 时间:
2020-11-12 14:16:25
阅读次数:
6
tricks 自定义匹配函数的回文子串问题 主体思想:把平常写的 == 换成任意匹配函数 例题 在这题中,匹配函数为: \[ f(a,b)= \begin{cases} 1 & (a \oplus b=1) \\ 0 & \operatorname{else} \end{cases} \] 然后要你 ...
分类:
其他好文 时间:
2020-11-12 14:15:19
阅读次数:
5
1.查看所有数据库容量大小 select table_schema as 'smartxs' ,sum(table_rows) as '记录数' ,sum(truncate(data_length/1024/1024, 2)) as '数据容量(MB)' ,sum(truncate(index_le ...
分类:
数据库 时间:
2020-11-12 13:50:57
阅读次数:
57
前言 如何只单独测试django中的某一个py文件呢?或者说如何书写测试脚本? 我们可以在任意一个py文件(应用下的tests或者自己新建一个)中书写以下代码: 前期准备 创建一个电影表 class Movie(models.Model): title = models.CharField(max_ ...
分类:
其他好文 时间:
2020-11-12 13:50:20
阅读次数:
8
Professional mechanics require the use of professional OBD2 diagnostic tools to get the job done. but before selected outstanding high-end scanners, w ...
分类:
其他好文 时间:
2020-11-12 13:22:27
阅读次数:
9
Double-weekly-contest-36 排名不高,再接再厉 1/5515. 设计停车系统 简单题,没什么好说的 class ParkingSystem { int[] carContainers; public ParkingSystem(int big, int medium, int ...
分类:
其他好文 时间:
2020-11-11 16:47:39
阅读次数:
26