随笔分类 -  算法

摘要:最小生成树和最大生成树 1 生成树概念 生成树(spanning tree) :一个连通无向图的生成子图,同时要求是树。也即在图的边集中选择n-1条,将所有顶点连通。 2 最小生成树 2.1 定义 最小生成树为一个有 n 个结点的连通图的生成树是原图的极小连通子图,且包含原图中的所有 n 个结点,并 阅读全文
posted @ 2020-11-25 21:11 LiangYC1021 阅读(5437) 评论(0) 推荐(1) 编辑
摘要:##与、或、异或、左移、右移运算符 运算符 ##二叉树的前中后序遍历 二叉树前序、中序、后序遍历相互求法 根据先序序列和中序序列创建二叉树1 根据先序序列和中序序列创建二叉树2 阅读全文
posted @ 2020-07-16 17:21 LiangYC1021 阅读(203) 评论(0) 推荐(0) 编辑
摘要:小梁变强之后决定建设自己的道馆,她特别喜欢去其他的道馆串门。 但是有些道馆之间没有道路连通,于是小梁想知道自己能不能去她想去的道馆, 你能帮她写一个程序来查询两个道馆之间是否互相存在道路联通吗; 如果存在输出“YES”,反之输出“NO”。 示例1 输入 4 2 2 1 3 4 3 1 2 3 4 输 阅读全文
posted @ 2020-06-20 18:41 LiangYC1021 阅读(134) 评论(0) 推荐(0) 编辑
摘要:小梁来到了伽勒尔地区并参加了联盟赛热身赛,比赛小岛上有n个精灵散落在岛上各处,她有一个大小为s的背包,每个精灵的战斗值为vi,体积为wi。 请问在她临走之前背包内宝可梦的战斗力总和最多为多少,并输出其战斗值总和sum以及背包内的精灵数量ans。 示例1 输入 1 5 5 1 3 2 5 1 2 4 阅读全文
posted @ 2020-06-20 18:35 LiangYC1021 阅读(136) 评论(0) 推荐(0) 编辑
摘要:为了寻找稀有的宝可梦,小梁进了一个古代遗迹中。在一次意外的触发之下,她复活了超古代宝可梦化石翼龙并激怒了对方,现在化石翼龙准备攻击小梁,她要逃离这个遗迹了。 但化石翼龙的实力过于强大,让这个本就历经风霜的遗迹开始了毁灭性的崩塌,有大量的落石下落,现在我们要帮助小梁逃离这个遗迹。 遗迹是一个N * M 阅读全文
posted @ 2020-06-20 18:23 LiangYC1021 阅读(157) 评论(0) 推荐(0) 编辑
摘要:小梁旅途的第一站,来到了杰尼龟兄弟的栖息地,正巧赶上杰尼龟兄弟们在举行神奇的数学游戏,它们把广阔的湖面当做二维坐标系,他们分别站在某一点向某一方向发射高压水枪,这些高压水枪相互穿透,构成了多个交点。 现在小梁通过建模,把每道高压水枪抽象成了yi=ki*xi+bi的直线,现在她想知道那些高压水枪能构成 阅读全文
posted @ 2020-06-20 18:18 LiangYC1021 阅读(122) 评论(0) 推荐(0) 编辑
摘要:这次a的题目相对以往多了一点(因为难度下降了),但还是出现了大量的wa以及非常多的笨b错误,挑几题记录一哈。 (不是因为大量出现小梁^^) C-杰尼杰尼 G-遗迹逃亡 J-小梁的背包 L-小梁的道馆 都是比较简单的题,因为只能做出简单的题了…… 阅读全文
posted @ 2020-06-20 18:10 LiangYC1021 阅读(112) 评论(0) 推荐(0) 编辑
摘要:这个作业属于哪个课程 班级的链接 这个作业要求在哪里 作业的要求 这个作业的目标 代码的 git 仓库链接。 运行截图/运行视频。 代码要点 收获与心得。 依然存在的问题。 作业正文 作业 GitHub仓库地址 仓库 小组成员 031902609梁育诚031902610刘凌斌 成员博客首页 梁育诚刘 阅读全文
posted @ 2020-06-13 19:37 LiangYC1021 阅读(184) 评论(2) 推荐(0) 编辑
摘要:我们可以用一个数组来模拟集合,add运算用以实现集合元素的增加,delete运算用于实现集合元素的删除,find运算用以实现集合元素的查找,但是目前集合元素类型未知,可以是int、char、double等基本数据类型,也可以是String、Time、Student等对象类型,要求采用模板函数实现集合 阅读全文
posted @ 2020-05-30 00:34 LiangYC1021 阅读(121) 评论(0) 推荐(0) 编辑
摘要:Calendars in widespread use today include the Gregorian calendar, which is the de facto international standard, and is used almost everywhere in the w 阅读全文
posted @ 2020-05-30 00:27 LiangYC1021 阅读(149) 评论(0) 推荐(0) 编辑
摘要:In mathematics, the Pythagorean theorem — is a relation in Euclidean geometry among the three sides of a right-angled triangle. In terms of areas, it 阅读全文
posted @ 2020-05-30 00:22 LiangYC1021 阅读(147) 评论(0) 推荐(0) 编辑
摘要:You are an adventurer currently journeying inside an evil temple. After defeating a couple of weak zombies, you arrived at a square room consisting of 阅读全文
posted @ 2020-05-27 22:46 LiangYC1021 阅读(127) 评论(0) 推荐(1) 编辑
摘要:A country has n cities. Initially, there is no road in the country. One day, the king decides to construct some roads connecting pairs of cities. Road 阅读全文
posted @ 2020-05-27 22:44 LiangYC1021 阅读(107) 评论(0) 推荐(0) 编辑
摘要:You are given a rectangular cake, represented as an r × c grid. Each cell either has an evil strawberry, or is empty. For example, a 3 × 4 cake may lo 阅读全文
posted @ 2020-05-27 22:42 LiangYC1021 阅读(120) 评论(0) 推荐(0) 编辑
摘要:Little boy Petya loves stairs very much. But he is bored from simple going up and down them — he loves jumping over several stairs at a time. As he st 阅读全文
posted @ 2020-05-25 20:48 LiangYC1021 阅读(176) 评论(0) 推荐(0) 编辑
摘要:A boy Petya loves chess very much. He even came up with a chess piece of his own, a semiknight. The semiknight can move in any of these four direction 阅读全文
posted @ 2020-05-25 20:44 LiangYC1021 阅读(131) 评论(0) 推荐(0) 编辑
摘要:There is a rectangular grid of n rows of m initially white cells each. Arkady performed a certain number (possibly zero) of operations on it. In the i 阅读全文
posted @ 2020-04-28 19:02 LiangYC1021 阅读(127) 评论(1) 推荐(0) 编辑
摘要:Overlooking the captivating blend of myriads of vernal hues, Arkady the painter lays out a long, long canvas. Arkady has a sufficiently large amount o 阅读全文
posted @ 2020-04-28 18:59 LiangYC1021 阅读(160) 评论(0) 推荐(0) 编辑
摘要:The city of Fishtopia can be imagined as a grid of 4 rows and an odd number of columns. It has two main villages; the first is located at the top left 阅读全文
posted @ 2020-04-20 23:51 LiangYC1021 阅读(116) 评论(0) 推荐(0) 编辑
摘要:A necklace can be described as a string of links (' ') and pearls ('o'), with the last link or pearl connected to the first one. You can remove a link 阅读全文
posted @ 2020-04-20 23:49 LiangYC1021 阅读(116) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示