上一页 1 ··· 28 29 30 31 32 33 34 35 36 ··· 64 下一页
摘要: 国际象棋 众所周知,“八皇后” 问题是求解在国际象棋棋盘上摆放 $8$ 个皇后,使得两两之间互不攻击的方案数。 已经学习了很多算法的小蓝觉得 “八皇后” 问题太简单了,意犹未尽。作为一个国际象棋迷,他想研究在 $N \times M$ 的棋盘上,摆放 $K$ 个马,使得两两之间互不攻击有多少种摆放方 阅读全文
posted @ 2023-04-05 19:53 onlyblues 阅读(105) 评论(0) 推荐(0)
摘要: 方格迷宫 给定一个 $n$ 行 $m$ 列的方格矩阵。 行从上到下依次编号为 $1 \sim n$,列从左到右依次编号为 $1 \sim m$。 第 $i$ 行第 $j$ 列的方格表示为 $(i,j)$。 矩阵中的方格要么是空地(用 . 表示),要么是陷阱(用 # 表示)。 初始时,你位于方格 $( 阅读全文
posted @ 2023-04-04 20:04 onlyblues 阅读(129) 评论(0) 推荐(0)
摘要: 砝码称重 给定一个天平和 $101$ 个砝码。 $101$ 个砝码的重量依次为 $n_0,n_1,n_2, \ldots ,n_{100}$ 克,其中 $n$ 是一个不小于 $2$ 的整数。 请你判断,我们能否利用给定天平和砝码对重量为 $m$ 克的物品进行称重。 注意,天平的两端都可以放入砝码。 阅读全文
posted @ 2023-04-04 16:04 onlyblues 阅读(121) 评论(0) 推荐(0)
摘要: C. Place for a Selfie The universe is a coordinate plane. There are $n$ space highways, each of which is a straight line $y=kx$ passing through the or 阅读全文
posted @ 2023-04-04 10:14 onlyblues 阅读(132) 评论(0) 推荐(0)
摘要: D. A Wide, Wide Graph You are given a tree (a connected graph without cycles) with $n$ vertices. Consider a fixed integer $k$. Then, the graph $G_k$ i 阅读全文
posted @ 2023-04-04 09:38 onlyblues 阅读(126) 评论(0) 推荐(0)
摘要: 魔法 $C$ 国由 $n$ 座城市与 $m$ 条有向道路组成,城市与道路都从 $1$ 开始编号,经过 $i$ 号道路需要 $t_i$ 的费用。 现在你要从 $1$ 号城市出发去 $n$ 号城市,你可以施展最多 $K$ 次魔法,使得通过下一条道路时,需要的费用变为原来的相反数,即费用从 $t_i$ 变 阅读全文
posted @ 2023-03-30 12:28 onlyblues 阅读(59) 评论(0) 推荐(0)
摘要: 记录下由 $\min$ 与 $+$ 运算转换成类似于矩阵乘法的推导过程,有错误请在评论区指出 qwq。 我们先简单证明一下矩阵乘法的结合律。设有矩阵 $A_{n \times m}$,$B_{m \times p}$,$C_{p \times q}$,要证明 $(AB)C = A(BC)$。等价于证 阅读全文
posted @ 2023-03-30 12:25 onlyblues 阅读(838) 评论(2) 推荐(0)
摘要: 佳佳的斐波那契 佳佳对数学,尤其对数列十分感兴趣。 在研究完 Fibonacci 数列后,他创造出许多稀奇古怪的数列。 例如用 $S(n)$ 表示 Fibonacci 前 $n$ 项和 $\text{mod} \ m$ 的值,即 $S(n)=(F_1+F_2+…+F_n) \bmod m$,其中 $ 阅读全文
posted @ 2023-03-28 20:26 onlyblues 阅读(107) 评论(0) 推荐(0)
摘要: C. Candy Store The store sells $n$ types of candies with numbers from $1$ to $n$. One candy of type $i$ costs $b_i$ coins. In total, there are $a_i$ c 阅读全文
posted @ 2023-03-27 23:00 onlyblues 阅读(180) 评论(0) 推荐(0)
摘要: D. Binary String Sorting You are given a binary string $s$ consisting of only characters 0 and/or 1. You can perform several operations on this string 阅读全文
posted @ 2023-03-24 10:08 onlyblues 阅读(258) 评论(0) 推荐(0)
上一页 1 ··· 28 29 30 31 32 33 34 35 36 ··· 64 下一页
Web Analytics