结构体 type Mould struct { MouldId string `grom:"column:mouldID"` MouldInteriorID string `grom:"column:mouldInteriorID"` MouldName string `grom:"column:m ...
分类:
其他好文 时间:
2020-07-18 15:33:40
阅读次数:
183
链接:https://leetcode-cn.com/problems/unique-binary-search-trees-ii/ 代码 /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNo ...
分类:
其他好文 时间:
2020-07-18 13:39:30
阅读次数:
56
链接:https://leetcode-cn.com/problems/binary-tree-inorder-traversal/ 代码 /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNo ...
分类:
其他好文 时间:
2020-07-18 11:34:31
阅读次数:
66
此题和之前的剑指offer32-I、II.从上到下打印二叉树大致相同在BFS的基础上只是添加了一个重排序的过程。具体代码如下: 1 /** 2 * Definition for a binary tree node. 3 * struct TreeNode { 4 * int val; 5 * st ...
分类:
其他好文 时间:
2020-07-18 11:18:07
阅读次数:
58
一位C++小白的力扣刷题_成长记录_welcome to visit ^_^ 树和图_第4题:填充每个节点的下一个右侧节点指针 题目描述: 给定一个完美二叉树,其所有叶子节点都在同一层,每个父节点都有两个子节点。二叉树定义如下: struct Node { int val; Node *left; ...
分类:
编程语言 时间:
2020-07-18 11:15:54
阅读次数:
71
线段树是学不明白了…… 部分指针用法 对于这段代码, struct Node{ int a, b, c; }YJH[100], x; Node *p = YJH, *q = &x; 以下代码在使用过程中是等价的: cout << x.a << endl; cout << q->a << endl; ...
分类:
其他好文 时间:
2020-07-18 00:55:56
阅读次数:
106
#include<bits/stdc++.h> using namespace std; typedef long long ll; const int N=5e5+10; struct node{ int cnt; node * nxt[27]; node * fail; vector<node ...
分类:
其他好文 时间:
2020-07-18 00:44:51
阅读次数:
57
题面 分析 垃圾题面。 考虑一下题目的意思,既然S中只要有大于等于x的元素就要减RP,那我们就从小到大取就可以避免这个问题了。如果采取这种策略,不难看出只有相同的元素才会对答案做贡献,也就是说,答案等于出现次数最多的数的出现次数。于是,本题转化为求区间众数。 注意区间端点取值范围较大,需要离散化。 ...
分类:
其他好文 时间:
2020-07-18 00:37:52
阅读次数:
68
前言: 对于稀疏图而言,前向星(邻接表)是必不可少的工具,感性理解前向星,写多了就背下来了 结构体写法: struct fdfdfd{int next,to,w;}a[1000];//定义 int head[1000],cnt; void addedge(int x,int y,int w){a[+ ...
分类:
其他好文 时间:
2020-07-17 22:14:06
阅读次数:
74
题意:有一$n$个点,$m$条边的双向图,每条边都有花费和流量,求从$1$~$n$的路径中,求$max\frac{min(f)}{\sum c}$. 题解:对于c,一定是单源最短路,我们可以用dijkstra,但是这个最小流量不是很好搞,但是题目所给的数据范围较小,所以我们可以直接枚举最小流量,然后 ...
分类:
其他好文 时间:
2020-07-17 19:42:27
阅读次数:
70