new 初始化:括号内加初始值 int *pi = new int (6) // C++98 struct where {double x; double y; double z}; where * one = new where {2.5, 5.3, 7.2}; // C++11 以下为定位 ne ...
分类:
编程语言 时间:
2020-05-22 21:30:15
阅读次数:
116
我的LeetCode:https://leetcode cn.com/u/ituring/ 我的LeetCode刷题源码[GitHub]:https://github.com/izhoujie/Algorithmcii LeetCode 面试题26. 树的子结构 题目 输入两棵二叉树A和B,判断B是 ...
分类:
其他好文 时间:
2020-05-22 19:41:00
阅读次数:
40
最多存储2^32-1个元素,支持取交集、并集、差集 内部编码: 整数集合(intset) typedef struct intset{ uint32_t encoding; 编码类型(int8_t, int16_t...) uint32_t length; 元素个数 int8_t contents[ ...
分类:
其他好文 时间:
2020-05-22 16:54:32
阅读次数:
63
这个题就是一个01背包的模板题; 代码: 1 #include<iostream> 2 using namespace std; 3 struct zkw{ 4 int w; 5 int c; 6 }; 7 zkw a[3500]; 8 int f[2200]; 9 int main() 10 { ...
分类:
其他好文 时间:
2020-05-22 15:33:10
阅读次数:
52
在单例模式中,一个类只有一个实例。而枚举其实就是多例,一个类有多个实例,但实例的个数不是无穷的,是有限个数的。例如word文档的对齐方式有几种:左对齐、居中对齐、右对齐。开车的方向有几种:前、后、左、右!我们称呼枚举类中实例为枚举项!一般一个枚举类的枚举项的个数不应该太多,如果一个枚举类有30个枚举 ...
分类:
编程语言 时间:
2020-05-22 14:24:49
阅读次数:
46
1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <ctype.h> 4 #include <string.h> 5 typedef int ElemType; 6 typedef struct item{ 7 ElemType items; ...
分类:
编程语言 时间:
2020-05-22 13:08:35
阅读次数:
49
1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <ctype.h> 4 #include <string.h> 5 typedef int ElemType; 6 typedef struct stack{ 7 ElemType *item ...
分类:
编程语言 时间:
2020-05-22 12:50:08
阅读次数:
41
题意 :你有$n$天的时间,这段时间中你有$m$长考试,$s$表示宣布考试的日期,$d$表示考试的时间,$c$表示需要准备时间,如果你不能准备好所有考试,输出$ 1$,否则输出你每天都在干什么,如果这一天你有考试,输出$m+1$,如果你要准备第$i$场考试,输出$i$,否则休息,输出$0$. 题解 ...
分类:
其他好文 时间:
2020-05-22 09:15:48
阅读次数:
52
一、变量 (一)变量的概念 1. 变量时计算机语言中存储数据的抽象概念。变量的功能是存储数据。变量通过变量名访问; 2. 变量的本质是计算机分配的一小块内存,专门用于存放指定 数据,在程序运行过程中该数据可以发生改变; 3. 变量的存储往往具有瞬时性,当程序运行结束,存放该数据的内存就会释放,而该变 ...
分类:
编程语言 时间:
2020-05-21 23:43:31
阅读次数:
60
1.作为返回值 2.作为函数参数 https://bbs.csdn.net/topics/340095770 ...
分类:
编程语言 时间:
2020-05-21 19:18:27
阅读次数:
253