01 2023 档案
摘要:F. Timofey and Black-White Tree Timofey came to a famous summer school and found a tree on vertices. A tree is a connected undirected graph withou
阅读全文
摘要:最幸运的数字 是中国的幸运数字,如果一个数字的每一位都由 构成则该数字被称作是幸运数字。 现在给定一个正整数 ,请问至少多少个 连在一起组成的正整数(即最小幸运数字)是 的倍数。 输入格式 输入包含多组测试用例。 每组测试用例占一行,包含一个整数 。 当输
阅读全文
摘要:B. GCD Partition While at Kira's house, Josuke saw a piece of paper on the table with a task written on it. The task sounded as follows. There is an a
阅读全文
摘要:D. Fixed Prefix Permutations You are given permutations , each of length . Recall that a permutation of length is a s
阅读全文
摘要:Rank Transform of a Matrix Given an m x n matrix , return a new matrix answer where answer[row][col] is the rank of matrix[row][col] . The rank is an
阅读全文
摘要:Minimum Cost to Split an Array You are given an integer array nums and an integer . Split the array into some number of non-empty subarrays. The co
阅读全文
摘要:B. Emordnilap A permutation of length is an array consisting of distinct integers from to in arbitrary order. For example, $[2,3,1,5,4
阅读全文
摘要:C. Quiz Master A school has to decide on its team for an international quiz. There are students in the school. We can describe the students using
阅读全文
摘要:可见的点 在一个平面直角坐标系的第一象限内,如果一个点 与原点 的连线中没有通过其他任何点,则称该点在原点处是可见的。 例如,点 就是不可见的,因为它与原点的连线会通过点 。 部分可见点与原点的连线如下图所示: 编写一个程序,计算给定整数
阅读全文
摘要:Hankson的趣味题 Hanks 博士是 BT(Bio-Tech,生物技术)领域的知名专家,他的儿子名叫 Hankson。 现在,刚刚放学回家的 Hankson 正在思考一个有趣的问题。 今天在课堂上,老师讲解了如何求两个正整数 和 的最大公约数和最小公倍数。 现在 Han
阅读全文
摘要:质数距离 给定两个整数 和 ,你需要在闭区间 内找到距离最接近的两个相邻质数 和 (即 是最小的),如果存在相同距离的其他相邻质数对,则输出第一对。 同时,你还需要找到距离最远的两个相邻质数 和 (即 $D
阅读全文
摘要:D. Many Perfect Squares You are given a set of distinct positive integers. We define the squareness of an integer as the n
阅读全文
摘要:C. Equal Frequencies Let's call a string balanced if all characters that are present in it appear the same number of times. For example, "coder", "app
阅读全文
摘要:Difference Between Maximum and Minimum Price Sum There exists an undirected and initially unrooted tree with nodes indexed from to . Yo
阅读全文
摘要:D. Friendly Spiders Mars is home to an unusual species of spiders — Binary spiders. Right now, Martian scientists are observing a colony of spider
阅读全文
摘要:C. Interesting Sequence Petya and his friend, robot Petya++, like to solve exciting math problems. One day Petya++ came up with the numbers and $x
阅读全文
摘要:B. Gardener and the Array The gardener Kazimir Kazimirovich has an array of integers . He wants to check if there are two di
阅读全文
摘要:等差数列 给定一个长度为 的正整数数列 和一个正整数 。 你可以对数列进行以下两种操作: + i x ,增加操作,将 的值增加 ()。- i x ,减少操作,将 的值减少 ($x \g
阅读全文
摘要:Maximize the Minimum Powered City You are given a 0-indexed integer array stations of length , where stations[i] represents the number of power sta
阅读全文
摘要:Number of Great Partitions You are given an array nums consisting of positive integers and an integer k . Partition the array into two ordered groups
阅读全文
摘要:Count Pairs With XOR in a Range Given a (0-indexed) integer array nums and two integers low and high , return the number of nice pairs. A nice pair is
阅读全文
摘要:Maximum Number of Points From Grid Queries You are given an integer matrix grid and an array queries of size . Find an array answer of
阅读全文
摘要:Frog Jump II You are given a 0-indexed integer array stones sorted in strictly increasing order representing the positions of stones in a river. A fro
阅读全文
摘要:选数异或 给定一个长度为 的数列 和一个非负整数 ,给定 次查询,每次询问能否从某个区间 中选择两个下标不同的数使得他们的异或等于 。 输入格式 输入的第一行包含三个整数 。 第二行包含 个整
阅读全文