03 2023 档案
摘要:魔法 国由 座城市与 条有向道路组成,城市与道路都从 开始编号,经过 号道路需要 的费用。 现在你要从 号城市出发去 号城市,你可以施展最多 次魔法,使得通过下一条道路时,需要的费用变为原来的相反数,即费用从 变
阅读全文
摘要:佳佳的斐波那契 佳佳对数学,尤其对数列十分感兴趣。 在研究完 Fibonacci 数列后,他创造出许多稀奇古怪的数列。 例如用 表示 Fibonacci 前 项和 的值,即 ,其中 $
阅读全文
摘要:C. Candy Store The store sells types of candies with numbers from to . One candy of type costs coins. In total, there are c
阅读全文
摘要:D. Binary String Sorting You are given a binary string consisting of only characters 0 and/or 1. You can perform several operations on this string
阅读全文
摘要:最长公共上升子序列 熊大妈的奶牛在小沐沐的熏陶下开始研究信息题目。 小沐沐先让奶牛研究了最长上升子序列,再让他们研究了最长公共子序列,现在又让他们研究最长公共上升子序列了。 小沐沐说,对于两个数列 和 ,如果它们都包含一段位置不一定连续的数,且数值是严格递增的,那么称这一段数是两个数列
阅读全文
摘要:C. Sequence Master For some positive integer , YunQian considers an array of (possibly negative) integers good, if and only if for every p
阅读全文
摘要:关押罪犯 城现有两座监狱,一共关押着 名罪犯,编号分别为 。 他们之间的关系自然也极不和谐。 很多罪犯之间甚至积怨已久,如果客观条件具备则随时可能爆发冲突。 我们用“怨气值”(一个正整数值)来表示某两名罪犯之间的仇恨程度,怨气值越大,则这两名罪犯之间的积怨越多。
阅读全文
摘要:E. Music Festival The boy Vitya loves to listen to music very much. He knows that albums are due to be released this Friday, -th of which conta
阅读全文
摘要:C. The Very Beautiful Blanket Kirill wants to weave the very beautiful blanket consisting of of the same size square patches of some colo
阅读全文
摘要:C. Pull Your Luck While James is gone on business, Vesper takes her time and explores what the legendary Casino Royale has to offer to people who are
阅读全文
摘要:A. Lame King You are given a checkerboard of size , i. e. it has rows and columns. The rows of this checkerboard are numbe
阅读全文
摘要:前言 由于解决这个问题的做法完全是我个人主观完成的,因此可能会存在很严重的错误,如果发现任何的问题与错误请在评论区进行提出指正。还有这个问题在数论中应该有个专业的名词,如果有人知道的话也麻烦在评论区留言告知。 正文 本文尝试解决的问题为:对于 多
阅读全文
摘要:聪明的燕姿 城市中人们总是拿着号码牌,不停寻找,不断匹配,可是谁也不知道自己等的那个人是谁。 可是燕姿不一样,燕姿知道自己等的人是谁,因为燕姿数学学得好! 燕姿发现了一个神奇的算法:假设自己的号码牌上写着数字 ,那么自己等的人手上的号码牌数字的所有正约数之和必定等于 。 所以燕姿总是拿着
阅读全文
摘要:D. Buying gifts Little Sasha has two friends, whom he wants to please with gifts on the Eighth of March. To do this, he went to the largest shopping c
阅读全文
摘要:城市通电 平面上遍布着 座城市,编号 。 第 座城市的位置坐标为 。 不同城市的位置有可能重合。 现在要通过建立发电站和搭建电线的方式给每座城市都通电。 一个城市如果建有发电站,或者通过电线直接或间接的与建有发电站的城市保持连通,则该城市通电
阅读全文
摘要:构造有向无环图 给定一个由 个点和 条边构成的图。 不保证给定的图是连通的。 图中的一部分边的方向已经确定,你不能改变它们的方向。 剩下的边还未确定方向,你需要为每一条还未确定方向的边指定方向。 你需要保证在确定所有边的方向后,生成的图是一个有向无环图(即所有边都是有向的且没有有向环
阅读全文
摘要:作物杂交 作物杂交是作物栽培中重要的一步。 已知有 种作物 (编号 至 ),第 种作物从播种到成熟的时间为 。 作物之间两两可以进行杂交,杂交时间取两种中时间较长的一方。 如作物 种植时间为 天,作物 种植时间为 天,则 $AB
阅读全文
摘要:F. Dasha and Nightmares Dasha, an excellent student, is studying at the best mathematical lyceum in the country. Recently, a mysterious stranger broug
阅读全文
摘要:D. Remove Two Letters Dmitry has a string , consisting of lowercase Latin letters. Dmitry decided to remove two consecutive characters from the str
阅读全文
摘要:D. Maximum Subarray You are given an array , consisting of integers. You are also given two integers and . You have t
阅读全文
摘要:C. Maximum Set A set of positive integers is called beautiful if, for every two integers and from this set, either divides or
阅读全文
摘要:D. Serval and Shift-Shift-Shift Serval has two -bit binary integer numbers and . He wants to share those numbers with Toxel. Since Toxel lik
阅读全文
摘要:最大数量 一个无向图有 个点,编号 。 这些点之间没有任何边。 给定 个需求,编号 。 其中,第 个需求是让点 和点 连通。 需求可能存在重复。 在本题中,你需要依次解决 个问题,编号 $1 \sim d
阅读全文