![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
萌新的题解
文章平均质量分 75
佯设
萌新一枚罢了。
展开
-
生日礼物简单题解
题目来源:[SCOI2009]生日礼物 - 题目 - 黑暗爆炸OJ 原题: Description 小西有一条很长的彩带,彩带上挂着各式各样的彩珠。已知彩珠有N个,分为K种。简单的说,可以将彩带考虑为x轴,每一个彩珠有一个对应的坐标(即位置)。某些坐标上可以没有彩珠,但多个彩珠也可以出现在同一个位置上。 小布生日快到了,于是小西打算剪一段彩带送给小布。为了让礼物彩带足够漂亮,小西希望这一段彩带中能包含所有种类的彩珠。同时,为了方便,小西希望这段彩带尽可能短,你能帮助小西计算这个最短的长度么?彩带的长度原创 2022-03-01 22:06:14 · 229 阅读 · 0 评论 -
Largest Common Submatrix
题目来源:Largest Common Submatrix - 题库 - 计蒜客 题意:有两个大小相同的矩阵,求两个矩阵的最大相同子矩阵,数的范围是1到n*m,没有重复 题解思路:对于每个数,得到这个数在第一个矩阵和第二个矩阵的坐标差,用坐标差形成一个新的矩阵,在这个矩阵中寻找元素相同的最大子矩阵。 代码实现: #include <iostream> #include <algorithm> #include<string> #include<queue&原创 2022-03-01 11:38:18 · 447 阅读 · 0 评论 -
森森旅游的简单题解
原题: 好久没出去旅游啦!森森决定去 Z 省旅游一下。 Z 省有n座城市(从1到n编号)以及m条连接两座城市的有向旅行线路(例如自驾、长途汽车、火车、飞机、轮船等),每次经过一条旅行线路时都需要支付该线路的费用(但这个收费标准可能不止一种,例如车票跟机票一般不是一个价格)。 Z 省为了鼓励大家在省内多逛逛,推出了旅游金计划:在i号城市可以用1元现金兑换ai元旅游金(只要现金足够,可以无限次兑换)。城市间的交通即可以使用现金支付路费,也可以用旅游金支付。具体来说,当通过第...原创 2022-02-28 17:26:34 · 568 阅读 · 0 评论 -
Perform the Combo 简单题解
题目来源:Problem - 1311C - Codeforces 原题: time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You want to perform the combo on your opponent in one popular fighting game. The combo is the str.原创 2022-02-27 23:01:26 · 7011 阅读 · 0 评论 -
Moving Points简单题解
题目来源: Problem - F - Codeforces 原题: F. Moving Points time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output There arennpoints on a coordinate axisOXOX. Theii-th point is located at the i...原创 2022-02-27 11:16:17 · 510 阅读 · 0 评论 -
Construct the Binary Tree简单题解
题目来源:Problem - E - Codeforces 原题: time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You are given two integersnnanddd. You need to construct a rooted binary tree consisting ofnnvert...原创 2022-02-27 00:11:53 · 90 阅读 · 0 评论