摘要: Highly divisible triangular number The sequence of triangle numbers is generated by adding the natural numbers. So the 7th triangle number would be 1 阅读全文
posted @ 2020-02-17 19:34 quanjun 阅读(324) 评论(0) 推荐(1) 编辑
摘要: Largest product in a grid In the 20×20 grid below, four numbers along a diagonal line have been marked in red. 08 02 22 97 38 15 00 40 00 75 04 05 07 阅读全文
posted @ 2020-02-17 18:49 quanjun 阅读(148) 评论(0) 推荐(0) 编辑
摘要: Summation of primes The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17. Find the sum of all the primes below two million. 素数的和 所有小于10的素数的和是2 + 3 + 5 阅读全文
posted @ 2020-02-17 18:34 quanjun 阅读(172) 评论(0) 推荐(0) 编辑
摘要: Special Pythagorean triplet A Pythagorean triplet is a set of three natural numbers, $a using namespace std; int main() { for (int i = 1; i <= 1000/3; 阅读全文
posted @ 2020-02-17 18:25 quanjun 阅读(206) 评论(0) 推荐(0) 编辑
摘要: Largest product in a series The four adjacent digits in the 1000 digit number that have the greatest product are 9 × 9 × 8 × 9 = 5832. Find the thirte 阅读全文
posted @ 2020-02-17 18:14 quanjun 阅读(492) 评论(0) 推荐(0) 编辑
摘要: 10001st prime By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13. What is the 10 001st prime number? 阅读全文
posted @ 2020-02-17 18:07 quanjun 阅读(201) 评论(0) 推荐(0) 编辑
摘要: Sum square difference The sum of the squares of the first ten natural numbers is, $$1^2 + 2^2 + \cdots + 10^2 = 385$$ The square of the sum of the fir 阅读全文
posted @ 2020-02-17 17:57 quanjun 阅读(180) 评论(0) 推荐(0) 编辑
摘要: Smallest multiple 2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder. What is the smallest posi 阅读全文
posted @ 2020-02-17 17:47 quanjun 阅读(275) 评论(0) 推荐(0) 编辑
摘要: Largest palindrome product A palindromic number reads the same both ways. The largest palindrome made from the product of two 2 digit numbers is 9009 阅读全文
posted @ 2020-02-17 17:23 quanjun 阅读(207) 评论(0) 推荐(0) 编辑
摘要: Largest prime factor The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number 600851475143 ? 最大质因数 13195的所有质因数为5 阅读全文
posted @ 2020-02-17 17:17 quanjun 阅读(255) 评论(0) 推荐(0) 编辑
摘要: Even Fibonacci numbers Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 t 阅读全文
posted @ 2020-02-17 15:50 quanjun 阅读(248) 评论(0) 推荐(0) 编辑
摘要: Multiples of 3 and 5 If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. 阅读全文
posted @ 2020-02-17 15:39 quanjun 阅读(197) 评论(0) 推荐(0) 编辑
摘要: 题目链接: "https://www.luogu.com.cn/problem/P4017" 解题思路: 定义 $f[i]$ 为到点 $i$ 的方案数,则: $$f[i] = \sum_{j \to i}{f[j]}$$ 其中 $j \to i$ 表示存在一条从 $j$ 到 $i$ 的边。 实现代码 阅读全文
posted @ 2020-02-17 11:27 quanjun 阅读(219) 评论(0) 推荐(0) 编辑
摘要: 题目链接: "https://www.luogu.com.cn/problem/P1964" 对于第 $i$ 件物品: 如果 $a_i$ 能被 $c_i$ 整除,则将其转换成 $\frac{a_i}{c_i}$ 件体积为 $1$,价格为 ${c_i} \cdot b_i$ 的物品; 如果 $a_i$ 阅读全文
posted @ 2020-02-17 10:28 quanjun 阅读(247) 评论(0) 推荐(0) 编辑