上一页 1 ··· 31 32 33 34 35 36 37 38 39 ··· 64 下一页
摘要: 裁剪序列 给定一个长度为 $N$ 的序列 $A$,要求把该序列分成若干段,在满足“每段中所有数的和”不超过 $M$ 的前提下,让“每段中所有数的最大值”之和最小。 试计算这个最小值。 输入格式 第一行包含两个整数 $N$ 和 $M$。 第二行包含 $N$ 个整数,表示完整的序列 $A$。 输出格式 阅读全文
posted @ 2023-02-24 19:49 onlyblues 阅读(186) 评论(0) 推荐(2)
摘要: Devu和鲜花 Devu 有 $N$ 个盒子,第 $i$ 个盒子中有 $A_i$ 枝花。 同一个盒子内的花颜色相同,不同盒子内的花颜色不同。 Devu 要从这些盒子中选出 $M$ 枝花组成一束,求共有多少种方案。 若两束花每种颜色的花的数量都相同,则认为这两束花是相同的方案。 结果需对 $10^9+ 阅读全文
posted @ 2023-02-22 15:33 onlyblues 阅读(61) 评论(0) 推荐(0)
摘要: 构造新矩阵 给定一个 $m$ 行 $n$ 列的整数矩阵,行编号 $1 \sim m$,列编号 $1 \sim n$。 其中,第 $i$ 行第 $j$ 列的元素为 $p_{ij}$。 你可以任意抽取其中不超过 $n−1$ 行元素,这些元素之间保持同一行列关系不变,构成一个新矩阵。 构成新矩阵后,我们可 阅读全文
posted @ 2023-02-20 17:14 onlyblues 阅读(168) 评论(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 阅读(187) 评论(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 阅读(253) 评论(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 阅读(39) 评论(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 阅读(119) 评论(0) 推荐(0)
摘要: 约数之和 假设现在有两个自然数 $A$ 和 $B$,$S$ 是 $A^B$ 的所有约数之和。 请你求出 $S \bmod 9901$ 的值是多少。 输入格式 在一行中输入用空格隔开的两个整数 $A$ 和 $B$。 输出格式 输出一个整数,代表 $S \bmod 9901$ 的值。 数据范围 $0 \ 阅读全文
posted @ 2023-02-18 11:50 onlyblues 阅读(83) 评论(0) 推荐(0)
摘要: 台阶-Nim游戏 现在,有一个 $n$ 级台阶的楼梯,每级台阶上都有若干个石子,其中第 $i$ 级台阶上有 $a_i$ 个石子$(i \geq 1)$。 两位玩家轮流操作,每次操作可以从任意一级台阶上拿若干个石子放到下一级台阶中(不能不拿)。 已经拿到地面上的石子不能再拿,最后无法进行操作的人视为失 阅读全文
posted @ 2023-02-16 19:01 onlyblues 阅读(107) 评论(0) 推荐(0)
摘要: Nim游戏 给定 $n$ 堆石子,两位玩家轮流操作,每次操作可以从任意一堆石子中拿走任意数量的石子(可以拿完,但不能不拿),最后无法进行操作的人视为失败。 问如果两人都采用最优策略,先手是否必胜。 输入格式 第一行包含整数 $n$。 第二行包含 $n$ 个数字,其中第 $i$ 个数字表示第 $i$ 阅读全文
posted @ 2023-02-15 23:35 onlyblues 阅读(146) 评论(0) 推荐(0)
上一页 1 ··· 31 32 33 34 35 36 37 38 39 ··· 64 下一页
Web Analytics