给一个矩阵mat,每个格子都是0或1,翻转一个格子会将该格子以及相邻的格子(有共同边)全部翻转(0变为1,1变为0) 求问最少需要翻转几次将所有格子全部置为0。 这题的重点是数据范围,比赛结束看了眼数据范围想把自己锤死= = m == mat.length n == mat[0].length 1 ...
分类:
其他好文 时间:
2019-12-08 15:55:36
阅读次数:
154
本蒟蒻第一道$K D Tree$维护$dp$ "Question" 题目大意:求一条路径,使得其四个维度单调不降。 先排序消掉一维再说。 对于每一个点,初始的时候绝对长度是1啊。于是,先赋值一个1,对于每一个点。 设计$dp$数组 $$f[i]=max_{f[j]}(a[j] include inc ...
分类:
其他好文 时间:
2019-12-08 15:30:04
阅读次数:
84
树 一、树的定义 1,树Tree是n(n >= 0) 个结点的有限集, n = 0时 称为空树 。 在任意一棵非空的树中: (1)有且仅有一个特定的根结点 (2)当n>1时,其余节点可分为m(m > 0)个互不相交的有限集T1,T2,.....,Tm,其中每一个集合又是一棵树,并且称为根的子树。 如 ...
分类:
其他好文 时间:
2019-12-08 12:49:22
阅读次数:
120
在项目中会用到模糊查询,之前在首页是用的element的tree显示的目录,会有用到搜索,但tree里边会有自带的模糊查询,用filter-node-method方法使用 但上次的项目中 又涉及到不试用插件的模糊搜索,使用原生来搜索,其实网上有很多种,但个人觉得正则还是好用,不区别大小写很方便,之前 ...
分类:
Web程序 时间:
2019-12-08 12:26:38
阅读次数:
105
1 int depth = 0; 2 int currentMaxDepth = 0; 3 public int maxDepth(TreeNode root) { 4 if(root == null){ 5 return 0; 6 } 7 8 int leftDepth = 1; 9 int ri... ...
分类:
其他好文 时间:
2019-12-08 12:15:18
阅读次数:
84
MySQL数据库 (上) MySQL数据类型:数值类型、日期和时间类型、字符串类型 1、数值类型 注:BIT数据类型保存位字段值,并且支持MyISAM、MEMORY、InnoDB和BDB表 类型大小范围(有符号)范围(无符号)用途 TINYINT 1 字节 (-128,127) (0,255) 小整 ...
分类:
数据库 时间:
2019-12-08 10:47:58
阅读次数:
109
A - Binary Tree Traversals 记一个模板 #include<iostream> using namespace std; typedef struct Tree{ Tree *left; Tree *right; int value; }Tree; Tree *root; T ...
分类:
其他好文 时间:
2019-12-08 10:40:35
阅读次数:
64
Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. According to the definition of LCA on Wikipedia: “The lowes ...
分类:
其他好文 时间:
2019-12-08 01:34:55
阅读次数:
120
[toc] fetch 注意:此功能是从其他远程主机下载到本地 |参数|说明| | | | |dest|远程机器中本地路径(仅能指定文件名),如果dest以/结尾,它将使用源文件的基础名称| |src|远程机器的远程路径(禁止指定目录)| |flat|仅传输文件| 传输文件(递归创建目录) 仅传输文 ...
分类:
其他好文 时间:
2019-12-08 01:04:42
阅读次数:
90
Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST. According to the definition of LCA on Wikipedia ...
分类:
其他好文 时间:
2019-12-08 00:58:19
阅读次数:
99