上一页 1 ··· 36 37 38 39 40 41 42 43 44 ··· 65 下一页
摘要: 可见的点 在一个平面直角坐标系的第一象限内,如果一个点 $(x,y)$ 与原点 $(0,0)$ 的连线中没有通过其他任何点,则称该点在原点处是可见的。 例如,点 $(4,2)$ 就是不可见的,因为它与原点的连线会通过点 $(2,1)$。 部分可见点与原点的连线如下图所示: 编写一个程序,计算给定整数 阅读全文
posted @ 2023-01-21 18:17 onlyblues 阅读(116) 评论(0) 推荐(0)
摘要: Hankson的趣味题 Hanks 博士是 BT(Bio-Tech,生物技术)领域的知名专家,他的儿子名叫 Hankson。 现在,刚刚放学回家的 Hankson 正在思考一个有趣的问题。 今天在课堂上,老师讲解了如何求两个正整数 $c_1$ 和 $c_2$ 的最大公约数和最小公倍数。 现在 Han 阅读全文
posted @ 2023-01-21 12:57 onlyblues 阅读(206) 评论(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 阅读(184) 评论(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 阅读(271) 评论(0) 推荐(0)
摘要: D. Many Perfect Squares You are given a set $a_1, a_2, \ldots, a_n$ of distinct positive integers. We define the squareness of an integer $x$ as the n 阅读全文
posted @ 2023-01-19 16:20 onlyblues 阅读(264) 评论(0) 推荐(0)
摘要: 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 阅读全文
posted @ 2023-01-18 23:12 onlyblues 阅读(369) 评论(0) 推荐(1)
摘要: Difference Between Maximum and Minimum Price Sum There exists an undirected and initially unrooted tree with $n$ nodes indexed from $0$ to $n - 1$. Yo 阅读全文
posted @ 2023-01-18 12:15 onlyblues 阅读(102) 评论(0) 推荐(0)
摘要: D. Friendly Spiders Mars is home to an unusual species of spiders — Binary spiders. Right now, Martian scientists are observing a colony of $n$ spider 阅读全文
posted @ 2023-01-17 18:14 onlyblues 阅读(172) 评论(0) 推荐(0)
摘要: C. Interesting Sequence Petya and his friend, robot Petya++, like to solve exciting math problems. One day Petya++ came up with the numbers $n$ and $x 阅读全文
posted @ 2023-01-17 11:41 onlyblues 阅读(124) 评论(0) 推荐(0)
摘要: 最大价值 已知,小写字母 $a \sim z$ 的价值分别为 $w_a,w_b, \ldots, w_z$。 对于一个由小写字母构成的长度为 $l$ 的字符串 $S=s_{1} s_{2} \ldots s_{l}$,其价值为 $w_{s1} \times 1 + w_{s2} \times 2 + 阅读全文
posted @ 2023-01-16 17:17 onlyblues 阅读(77) 评论(0) 推荐(0)
上一页 1 ··· 36 37 38 39 40 41 42 43 44 ··· 65 下一页
Web Analytics