1. 翻转二叉树:https://leetcode-cn.com/problems/invert-binary-tree/ 2. 二叉树展开为链表,关键在于找到递归部分:https://leetcode-cn.com/problems/flatten-binary-tree-to-linked-li ...
分类:
其他好文 时间:
2021-04-13 12:42:14
阅读次数:
0
UE4支持多种内存分配器: /** Which allocator is being used */ enum EMemoryAllocatorToUse { Ansi, // Default C allocator Stomp, // Allocator to check for memory s ...
分类:
其他好文 时间:
2021-04-13 12:34:37
阅读次数:
0
Kruskal模板题,需要注意,这道题空间限制很严格,第一遍下意识的开了一个记录数组(因为一对节点之间允许多条路经,这里想着进行优化,不过弄巧成拙了,遇到了第一个MLE) #include <iostream> #include <algorithm> #include <queue> #inclu ...
分类:
其他好文 时间:
2021-04-13 11:44:47
阅读次数:
0
四则运算代码:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks; namespace ClassLibrary1{ public ...
分类:
其他好文 时间:
2021-04-12 12:51:16
阅读次数:
0
1二分图最大匹配 在一张二分图中选出最多的边,使得边两两不相交。 2求解 2.1匈牙利算法 即不断地尝试匹配,有人抢就放弃的算法。 #include<iostream> #include<cstdio> #include<cmath> #include<algorithm> #include<cst ...
分类:
其他好文 时间:
2021-04-12 12:41:05
阅读次数:
0
原题链接 题解:注意建立边 代码: #include <iostream> #include <algorithm> #include <cstring> #include <cmath> using namespace std; const int N = 5e3 + 9; const int M ...
分类:
其他好文 时间:
2021-04-12 12:34:29
阅读次数:
0
Description: Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: Integers in each row ...
分类:
其他好文 时间:
2021-04-12 12:32:28
阅读次数:
0
#include<iostream> #include<algorithm>//sort头文件 using namespace std; struct student{ int theta;//阈值 int result;//结果 }; bool compare(student a,student ...
分类:
编程语言 时间:
2021-04-12 11:39:49
阅读次数:
0
#include<cstdio> #include<algorithm> const int N = 1e6 + 1; int n, t[N]; namespace lsh{ int lsh[N], tmp[N]; void init() { for (int i = 1; i <= n; ++i) ...
分类:
编程语言 时间:
2021-04-10 13:40:10
阅读次数:
0
A. Déjà Vu 题意:就是问能否加上字母a,使得字符串不中心对称 思路:只有一种情况不能加入,就是全部是a,剩下的都可以满足,找a的位置就找哪个字母不是a,然后让它的对称位置是新加的这个a 代码: 1 #include<iostream> 2 #include<algorithm> 3 #in ...
分类:
其他好文 时间:
2021-04-10 13:37:05
阅读次数:
0