上一页 1 ··· 36 37 38 39 40 41 42 43 44 ··· 65 下一页
摘要: 质数距离 给定两个整数 $L$ 和 $U$,你需要在闭区间 $[L,U]$ 内找到距离最接近的两个相邻质数 $C_1$ 和 $C_2$(即 $C_2−C_1$ 是最小的),如果存在相同距离的其他相邻质数对,则输出第一对。 同时,你还需要找到距离最远的两个相邻质数 $D_1$ 和 $D_2$(即 $D 阅读全文
posted @ 2023-01-20 13:42 onlyblues 阅读(265) 评论(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 阅读(261) 评论(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 阅读(365) 评论(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 阅读(100) 评论(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 阅读(168) 评论(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 阅读(121) 评论(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 阅读(73) 评论(0) 推荐(0)
摘要: B. Gardener and the Array The gardener Kazimir Kazimirovich has an array of $n$ integers $c_1, c_2, \dots, c_n$. He wants to check if there are two di 阅读全文
posted @ 2023-01-15 18:24 onlyblues 阅读(125) 评论(5) 推荐(0)
摘要: 等差数列 给定一个长度为 $n$ 的正整数数列 $a_1,a_2, \ldots, a_n$ 和一个正整数 $k$。 你可以对数列进行以下两种操作: + i x ,增加操作,将 $a_i$ 的值增加 $x$($x \geq 1$)。- i x ,减少操作,将 $a_i$ 的值减少 $x$($x \g 阅读全文
posted @ 2023-01-13 23:13 onlyblues 阅读(239) 评论(0) 推荐(0)
摘要: Maximize the Minimum Powered City You are given a 0-indexed integer array stations of length $n$, where stations[i] represents the number of power sta 阅读全文
posted @ 2023-01-13 16:05 onlyblues 阅读(53) 评论(0) 推荐(0)
上一页 1 ··· 36 37 38 39 40 41 42 43 44 ··· 65 下一页
Web Analytics