上一页 1 ··· 24 25 26 27 28 29 30 31 32 ··· 53 下一页
摘要: 最大公约数 给定整数 $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 阅读(23) 评论(0) 推荐(0) 编辑
摘要: 可见的点 在一个平面直角坐标系的第一象限内,如果一个点 $(x,y)$ 与原点 $(0,0)$ 的连线中没有通过其他任何点,则称该点在原点处是可见的。 例如,点 $(4,2)$ 就是不可见的,因为它与原点的连线会通过点 $(2,1)$。 部分可见点与原点的连线如下图所示: 编写一个程序,计算给定整数 阅读全文
posted @ 2023-01-21 18:17 onlyblues 阅读(51) 评论(0) 推荐(0) 编辑
摘要: Hankson的趣味题 Hanks 博士是 BT(Bio-Tech,生物技术)领域的知名专家,他的儿子名叫 Hankson。 现在,刚刚放学回家的 Hankson 正在思考一个有趣的问题。 今天在课堂上,老师讲解了如何求两个正整数 $c_1$ 和 $c_2$ 的最大公约数和最小公倍数。 现在 Han 阅读全文
posted @ 2023-01-21 12:57 onlyblues 阅读(89) 评论(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 阅读(126) 评论(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 阅读(68) 评论(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 阅读(99) 评论(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 阅读(300) 评论(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 阅读(31) 评论(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 阅读(110) 评论(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 阅读(56) 评论(0) 推荐(0) 编辑
上一页 1 ··· 24 25 26 27 28 29 30 31 32 ··· 53 下一页
Web Analytics