02 2023 档案

摘要:裁剪序列 给定一个长度为 N 的序列 A,要求把该序列分成若干段,在满足“每段中所有数的和”不超过 M 的前提下,让“每段中所有数的最大值”之和最小。 试计算这个最小值。 输入格式 第一行包含两个整数 NM。 第二行包含 N 个整数,表示完整的序列 A。 输出格式 阅读全文
posted @ 2023-02-24 19:49 onlyblues 阅读(133) 评论(0) 推荐(2) 编辑
摘要:Devu和鲜花 Devu 有 N 个盒子,第 i 个盒子中有 Ai 枝花。 同一个盒子内的花颜色相同,不同盒子内的花颜色不同。 Devu 要从这些盒子中选出 M 枝花组成一束,求共有多少种方案。 若两束花每种颜色的花的数量都相同,则认为这两束花是相同的方案。 结果需对 $10^9+ 阅读全文
posted @ 2023-02-22 15:33 onlyblues 阅读(39) 评论(0) 推荐(0) 编辑
摘要:构造新矩阵 给定一个 mn 列的整数矩阵,行编号 1m,列编号 1n。 其中,第 i 行第 j 列的元素为 pij。 你可以任意抽取其中不超过 n1 行元素,这些元素之间保持同一行列关系不变,构成一个新矩阵。 构成新矩阵后,我们可 阅读全文
posted @ 2023-02-20 17:14 onlyblues 阅读(94) 评论(0) 推荐(0) 编辑
摘要:The Number of Good Subsets You are given an integer array nums . We call a subset of nums good if its product can be represented as a product of one o 阅读全文
posted @ 2023-02-19 19:41 onlyblues 阅读(46) 评论(0) 推荐(0) 编辑
摘要:Count the Number of Square-Free Subsets You are given a positive integer 0-indexed array nums . A subset of the array nums is square-free if the produ 阅读全文
posted @ 2023-02-19 18:53 onlyblues 阅读(55) 评论(0) 推荐(0) 编辑
摘要:Handling Sum Queries After Update You are given two 0-indexed arrays nums1 and nums2 and a 2D array queries of queries. There are three types of queri 阅读全文
posted @ 2023-02-19 10:16 onlyblues 阅读(17) 评论(0) 推荐(0) 编辑
摘要:D. Triangle Coloring You are given an undirected graph consisting of n vertices and n edges, where n is divisible by 6. Each edge has a weight 阅读全文
posted @ 2023-02-18 16:19 onlyblues 阅读(50) 评论(0) 推荐(0) 编辑
摘要:约数之和 假设现在有两个自然数 ABSAB 的所有约数之和。 请你求出 Smod9901 的值是多少。 输入格式 在一行中输入用空格隔开的两个整数 AB。 输出格式 输出一个整数,代表 Smod9901 的值。 数据范围 $0 \ 阅读全文
posted @ 2023-02-18 11:50 onlyblues 阅读(31) 评论(0) 推荐(0) 编辑
摘要:台阶-Nim游戏 现在,有一个 n 级台阶的楼梯,每级台阶上都有若干个石子,其中第 i 级台阶上有 ai 个石子(i1)。 两位玩家轮流操作,每次操作可以从任意一级台阶上拿若干个石子放到下一级台阶中(不能不拿)。 已经拿到地面上的石子不能再拿,最后无法进行操作的人视为失 阅读全文
posted @ 2023-02-16 19:01 onlyblues 阅读(70) 评论(0) 推荐(0) 编辑
摘要:Nim游戏 给定 n 堆石子,两位玩家轮流操作,每次操作可以从任意一堆石子中拿走任意数量的石子(可以拿完,但不能不拿),最后无法进行操作的人视为失败。 问如果两人都采用最优策略,先手是否必胜。 输入格式 第一行包含整数 n。 第二行包含 n 个数字,其中第 i 个数字表示第 i 阅读全文
posted @ 2023-02-15 23:35 onlyblues 阅读(70) 评论(0) 推荐(0) 编辑
摘要:能被整除的数 给定一个整数 nm 个不同的质数 p1,p2,,pm。 请你求出 1n 中能被 p1,p2,,pm 中的至少一个数整除的整数有多少个。 输入格式 第一行包含整数 nm。 第二行包含 m 阅读全文
posted @ 2023-02-14 20:29 onlyblues 阅读(52) 评论(0) 推荐(0) 编辑
摘要:D. Moscow Gorillas In winter, the inhabitants of the Moscow Zoo are very bored, in particular, it concerns gorillas. You decided to entertain them and 阅读全文
posted @ 2023-02-13 17:52 onlyblues 阅读(148) 评论(0) 推荐(0) 编辑
摘要:B. Fedya and Array For his birthday recently Fedya was given an array a of n integers arranged in a circle, For each pair of neighboring numbers ( 阅读全文
posted @ 2023-02-13 16:22 onlyblues 阅读(53) 评论(0) 推荐(0) 编辑
摘要:Subsequence With the Minimum Score You are given two strings s and t . You are allowed to remove any number of characters from the string t. The s 阅读全文
posted @ 2023-02-12 22:54 onlyblues 阅读(22) 评论(0) 推荐(0) 编辑
摘要:Substring XOR Queries You are given a binary string s , and a 2D integer array queries where queries[i] = [firsti, secondi] . For the ith query, find 阅读全文
posted @ 2023-02-12 15:49 onlyblues 阅读(22) 评论(0) 推荐(0) 编辑
摘要:Count the Number of Fair Pairs Given a 0-indexed integer array nums of size n and two integers lower and upper , return the number of fair pairs. A pa 阅读全文
posted @ 2023-02-12 15:28 onlyblues 阅读(63) 评论(0) 推荐(0) 编辑
摘要:找数字 给定一个正整数 m 和一个非负整数 s。 请你找到长度为 m 且各位数字之和为 s 的最小和最大非负整数。 要求所求非负整数不得包含前导零。 输入格式 共一行,两个整数 m,s。 输出格式 在一行内输出满足条件的最小和最大非负整数。 如果无解,则输出 -1 -1。 数据范 阅读全文
posted @ 2023-02-12 10:16 onlyblues 阅读(57) 评论(0) 推荐(0) 编辑
摘要:B. Jumbo Extra Cheese 2 Pak Chanek has n two-dimensional slices of cheese. The i-th slice of cheese can be represented as a rectangle of dimension 阅读全文
posted @ 2023-02-11 22:06 onlyblues 阅读(46) 评论(0) 推荐(0) 编辑
摘要:D. Moving Dots We play a game with n dots on a number line. The initial coordinate of the i-th dot is xi. These coordinates are distinct. Every 阅读全文
posted @ 2023-02-11 21:13 onlyblues 阅读(53) 评论(0) 推荐(0) 编辑
摘要:B. Sum of Two Numbers The sum of digits of a non-negative integer a is the result of summing up its digits together when written in the decimal syst 阅读全文
posted @ 2023-02-11 13:10 onlyblues 阅读(170) 评论(1) 推荐(1) 编辑
摘要:E. Sum Over Zero You are given an array a1,a2,,an of n integers. Consider S as a set of segments satisfying the following conditions 阅读全文
posted @ 2023-02-10 20:54 onlyblues 阅读(87) 评论(0) 推荐(1) 编辑
摘要:D. Lucky Permutation You are given a permutation p of length n. In one operation, you can choose two indices 1i<jn and swa 阅读全文
posted @ 2023-02-09 19:13 onlyblues 阅读(51) 评论(0) 推荐(0) 编辑
摘要:E. Monsters (hard version) This is the hard version of the problem. In this version, you need to find the answer for every prefix of the monster array 阅读全文
posted @ 2023-02-07 22:00 onlyblues 阅读(175) 评论(0) 推荐(0) 编辑
摘要:Disconnect Path in a Binary Matrix by at Most One Flip You are given a 0-indexed m×n binary matrix grid . You can move from a cell (row, col) 阅读全文
posted @ 2023-02-05 18:16 onlyblues 阅读(35) 评论(0) 推荐(0) 编辑
摘要:Maximize Win From Two Segments There are some prizes on the X-axis. You are given an integer array prizePositions that is sorted in non-decreasing ord 阅读全文
posted @ 2023-02-05 16:08 onlyblues 阅读(24) 评论(0) 推荐(0) 编辑
摘要:G2. Teleporters (Hard Version) The only difference between the easy and hard versions are the locations you can teleport to. Consider the points $0,1, 阅读全文
posted @ 2023-02-04 21:56 onlyblues 阅读(170) 评论(0) 推荐(0) 编辑
摘要:E. Negatives and Positives Given an array a consisting of n elements, find the maximum possible sum the array can have after performing the follow 阅读全文
posted @ 2023-02-04 15:56 onlyblues 阅读(72) 评论(0) 推荐(0) 编辑
摘要:Minimum Cost to Make Array Equal You are given two 0-indexed arrays nums and cost consisting each of n positive integers. You can do the following o 阅读全文
posted @ 2023-02-02 23:12 onlyblues 阅读(68) 评论(0) 推荐(0) 编辑
摘要:Count Increasing Quadruplets Given a 0-indexed integer array nums of size n containing all numbers from 1 to n, return the number of increasing 阅读全文
posted @ 2023-02-02 19:36 onlyblues 阅读(33) 评论(0) 推荐(0) 编辑
摘要:方程的解 佳佳碰到了一个难题,请你来帮忙解决。 对于不定方程 a1+a2++ak1+ak=g(x),其中 k1kNx 是正整数,g(x)=xxmod1000(即 xx阅读全文
posted @ 2023-02-02 12:22 onlyblues 阅读(65) 评论(0) 推荐(0) 编辑
摘要:Put Marbles in Bags You have k bags. You are given a 0-indexed integer array weights where weights[i] is the weight of the ith marble. You are also gi 阅读全文
posted @ 2023-02-01 18:00 onlyblues 阅读(64) 评论(0) 推荐(0) 编辑
摘要:牡牛和牝牛 约翰要带 N 只牛去参加集会里的展示活动,这些牛可以是牡牛,也可以是牝牛。 牛们要站成一排,但是牡牛是好斗的,为了避免牡牛闹出乱子,约翰决定任意两只牡牛之间至少要有 K 只牝牛。 请计算一共有多少种排队的方法,所有牡牛可以看成是相同的,所有牝牛也一样,答案对 5000011 阅读全文
posted @ 2023-02-01 12:20 onlyblues 阅读(117) 评论(0) 推荐(0) 编辑

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