顺序表 线性表的第一个儿子 这个儿子的结构体定义: typedef int ElemType;//取别名 typedef struct link{ ElemType * head;//head是一个数组指针,不太清楚的同学,可以百度一下 ElemType length; ElemType size; ...
分类:
编程语言 时间:
2020-06-14 01:23:40
阅读次数:
81
/* 直接求多边形面积 */ #include<bits/stdc++.h> using namespace std; typedef double db; const db eps=1e-6; const db pi=acos(-1); int sign(db k){ if (k>eps) ret ...
分类:
其他好文 时间:
2020-06-14 01:20:57
阅读次数:
82
1 #include <stdio.h> 2 #include <malloc.h> 3 typedef struct lianbiao *ptr; 4 struct lianbiao 5 { 6 int data; 7 ptr next; 8 }; 9 10 int main(void) 11 { ...
分类:
其他好文 时间:
2020-06-14 01:00:09
阅读次数:
64
https://ac.nowcoder.com/acm/contest/5944/A 太坑了,有空一定把它做出来 //真坑,就有一条,我加上输出调试的时候是对的,但是交的时候就变成了错的 #include <cmath> #include <cstring> #include <iostream> ...
分类:
其他好文 时间:
2020-06-13 19:43:32
阅读次数:
105
第六章学习的主要内容如下: 这是课后习题的一道题: 1 void DFS_AM(AMGraph G, int v) 2 { //图G为邻接矩阵类型 3 cout << v << " "; //访问第v个顶点 4 visited[v] = true; 5 for(w=G.vexnum-1; w>=0; ...
分类:
其他好文 时间:
2020-06-13 17:45:56
阅读次数:
77
1030 完美数列 (25分) 二分查找常用函数: lower_bound() 函数用于在指定区域内查找不小于目标值的第一个元素 upper_bound() 函数定义在头文件中,用于在指定范围内查找大于目标值的第一个元素 第一次写的代码,测试点4没过 下面举个例子,如数组:1,2,3,4,5,6,7 ...
分类:
其他好文 时间:
2020-06-13 10:54:58
阅读次数:
59
#include <stdio.h> #include <malloc.h> typedef struct lianbiao *ptr; struct lianbiao { int data; ptr next; }; int main(void) { ptr create(); void out( ...
分类:
其他好文 时间:
2020-06-12 20:34:41
阅读次数:
70
题目链接 关于kmp : https://www.cnblogs.com/roccoshi/p/13096988.html 关于kmp, 想了很久, 我觉得不应该放在这里写, 另开一贴记录一下. #include<bits/stdc++.h> using namespace std; typedef ...
分类:
其他好文 时间:
2020-06-12 00:40:18
阅读次数:
51
这道题明显的树形DP,但是我有一个邪恶的想法,让他变成多叉树,而且不用返回可以幻影移形,但是得走回来才能去另一条走廊。这看起来很恶毒,我也不知道怎么做。 做法大家都解释的差不多了,这里我主要说一下毒瘤的读入 这道题的读入与这篇博客所讲的题目的输入非常相似 void init(int &x){ x=+ ...
分类:
其他好文 时间:
2020-06-11 20:04:20
阅读次数:
55
折半查找的实现代码: #include <stdio.h> #include <stdlib.h> #define keyType int typedef struct { keyType key;//查找表中每个数据元素的值 //如果需要,还可以添加其他属性 }ElemType; typedef ...
分类:
其他好文 时间:
2020-06-11 16:44:05
阅读次数:
86