上一页 1 ··· 33 34 35 36 37 38 39 40 41 ··· 63 下一页
摘要: D. Fixed Prefix Permutations You are given $n$ permutations $a_1, a_2, \dots, a_n$, each of length $m$. Recall that a permutation of length $m$ is a s 阅读全文
posted @ 2023-01-27 16:23 onlyblues 阅读(293) 评论(0) 推荐(0)
摘要: 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 阅读全文
posted @ 2023-01-25 16:47 onlyblues 阅读(85) 评论(0) 推荐(0)
摘要: Minimum Cost to Split an Array You are given an integer array nums and an integer $k$. Split the array into some number of non-empty subarrays. The co 阅读全文
posted @ 2023-01-22 12:51 onlyblues 阅读(54) 评论(0) 推荐(0)
摘要: B. Emordnilap A permutation of length $n$ is an array consisting of $n$ distinct integers from $1$ to $n$ in arbitrary order. For example, $[2,3,1,5,4 阅读全文
posted @ 2023-01-22 10:13 onlyblues 阅读(87) 评论(0) 推荐(0)
摘要: C. Quiz Master A school has to decide on its team for an international quiz. There are $n$ students in the school. We can describe the students using 阅读全文
posted @ 2023-01-22 09:40 onlyblues 阅读(297) 评论(0) 推荐(0)
摘要: 最大公约数 给定整数 $N$,求 $1 \leq x,y \leq N$ 且 $\text{GCD}(x,y)$ 为素数的数对 $(x,y)$ 有多少对。 $\text{GCD}(x,y)$ 即求 $x$,$y$ 的最大公约数。 输入格式 输入一个整数 $N$。 输出格式 输出一个整数,表示满足条件 阅读全文
posted @ 2023-01-21 18:54 onlyblues 阅读(44) 评论(0) 推荐(0)
摘要: 可见的点 在一个平面直角坐标系的第一象限内,如果一个点 $(x,y)$ 与原点 $(0,0)$ 的连线中没有通过其他任何点,则称该点在原点处是可见的。 例如,点 $(4,2)$ 就是不可见的,因为它与原点的连线会通过点 $(2,1)$。 部分可见点与原点的连线如下图所示: 编写一个程序,计算给定整数 阅读全文
posted @ 2023-01-21 18:17 onlyblues 阅读(100) 评论(0) 推荐(0)
摘要: Hankson的趣味题 Hanks 博士是 BT(Bio-Tech,生物技术)领域的知名专家,他的儿子名叫 Hankson。 现在,刚刚放学回家的 Hankson 正在思考一个有趣的问题。 今天在课堂上,老师讲解了如何求两个正整数 $c_1$ 和 $c_2$ 的最大公约数和最小公倍数。 现在 Han 阅读全文
posted @ 2023-01-21 12:57 onlyblues 阅读(181) 评论(0) 推荐(0)
摘要: 樱花 给定一个整数 $n$,求有多少正整数数对 $(x,y)$ 满足 $\frac{1}{x}+\frac{1}{y}=\frac{1}{n!}$。 输入格式 一个整数 $n$。 输出格式 一个整数,表示满足条件的数对数量。 答案对 ${10}^9+7$ 取模。 数据范围 $ 1 \leq n \l 阅读全文
posted @ 2023-01-21 09:43 onlyblues 阅读(166) 评论(0) 推荐(0)
摘要: 质数距离 给定两个整数 $L$ 和 $U$,你需要在闭区间 $[L,U]$ 内找到距离最接近的两个相邻质数 $C_1$ 和 $C_2$(即 $C_2−C_1$ 是最小的),如果存在相同距离的其他相邻质数对,则输出第一对。 同时,你还需要找到距离最远的两个相邻质数 $D_1$ 和 $D_2$(即 $D 阅读全文
posted @ 2023-01-20 13:42 onlyblues 阅读(252) 评论(0) 推荐(0)
上一页 1 ··· 33 34 35 36 37 38 39 40 41 ··· 63 下一页
Web Analytics