分治
tomjobs
别慌,慌也没用
展开
-
LeetCode 23. 合并K个升序链表(分治 / 堆)
思路: 分治:分为两部分分别求解,再把求解结果按照两个链表合并的方式合并。 堆:将所有的节点放入堆中,每次取最小权值的节点。 分治: /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : val(x), next(nul.原创 2021-01-18 17:15:32 · 185 阅读 · 0 评论 -
Codeforces1400 E. Clear the Multiset(分治)
You have a multiset containing several integers. Initially, it contains ????1 elements equal to 1, ????2 elements equal to 2, …, ???????? elements equal to ????. You may apply two types of operations: choose two integers ???? and ???? (????≤????), then rem原创 2020-08-31 19:17:44 · 267 阅读 · 0 评论 -
C - Painting Fence CodeForces - 448C(dp或分治)
C. Painting Fence time limit per test1 second memory limit per test512 megabytes inputstandard input outputstandard output Bizon the Champion isn’t just attentive, he also is very hardworking. Bizon t...原创 2019-03-27 09:25:11 · 519 阅读 · 0 评论 -
98. 分形之城 (分形变换,矩阵旋转)
分形之城 题目 提交记录 讨论 题解 视频讲解 城市的规划在城市建设中是个大问题。 不幸的是,很多城市在开始建设的时候并没有很好的规划,城市规模扩大之后规划不合理的问题就开始显现。 而这座名为 Fractal 的城市设想了这样的一个规划方案,如下图所示: city.png 当城区规模扩大之后,Fractal 的解决方案是把和原来城区结构一样的区域按照图中的方式建设在城市周围,提升城市的等级。 ...原创 2019-08-14 21:08:13 · 614 阅读 · 0 评论 -
HDU1007 Quoit Design(平面最近点对)
Problem Description Have you ever played quoit in a playground? Quoit is a game in which flat rings are pitched at some toys, with all the toys encircled awarded. In the field of Cyberground, the posi...原创 2019-12-28 11:58:23 · 267 阅读 · 0 评论