自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(186)
  • 收藏
  • 关注

原创 Project Euler Problem 87 (Python和C++代码实现和解析)

Problem 87 : Prime power triplesThe smallest number expressible as the sum of a prime square, prime cube, and prime fourth power is 28. In fact, there are exactly four numbers below fifty that can be...

2019-03-12 16:15:34 411

原创 Project Euler Problem 86 (Python和C++代码实现和解析)

Problem 86 : Cuboid routeA spider, S, sits in one corner of a cuboid room, measuring 6 by 5 by 3, and a fly, F, sits in the opposite corner. By travelling on the surfaces of the room the shortest “st...

2019-03-12 15:30:44 411

原创 Python编程: 多个PDF文件合并以及网页上自动下载PDF文件

1. 需求有时候,我们下载了多个PDF文件, 但希望能把它们合并成一个PDF文件。例如:你下载的数个PDF文件资料或者电子发票,你可以使用python程序合并成一个PDF文件,无论是阅读或是打印都更方便些。2. 分析首先,我们要读取某一个目录(为了简化,我们假设Python代码和PDF文件都放在此目录下)的所有PDF文件,然后调用 PdfFileMerger 库进行合并,最后打印输出文件完成...

2019-02-28 11:48:05 1868 2

原创 Project Euler Problem 85 (C++和Python代码实现和解析)

Problem 85 : Counting rectanglesBy counting carefully it can be seen that a rectangular grid measuring 3 by 2 contains eighteen rectangles:Although there exists no rectangular grid that contains ex...

2019-02-26 15:10:00 347 1

原创 Project Euler Problem 84 (C++和Python代码实现和解析)***

Problem 84 : Monopoly oddsIn the game, Monopoly, the standard board is set up in the following way:A player starts on the GO square and adds the scores on two 6-sided dice to determine the number o...

2019-02-25 14:09:09 426 3

转载 100道Python编程练习题

100+ Python challenging programming exercise100道Python编程练习题,这些题如果能坚持每天至少完成一道,一定可以帮大家轻松 get Python 的编程技能。目前,这个项目已经获得了 2924 Stars,2468 Forks。首先,这 100+ 练习题根据难易程度分为三个等级:Level 1、2 和 3。下面对如何定义这三个 Level 进行...

2019-01-31 17:15:57 49428 7

原创 Project Euler Problem 83 (C++和Python代码实现和解析)***

Problem 83 : Path sum: four waysNOTE: This problem is a significantly more challenging version of Problem 81.In the 5 by 5 matrix below, the minimal path sum from the top left to the bottom right, b...

2019-01-30 10:23:26 457 1

原创 Project Euler Problem 82 (C++和Python代码实现和解析)

Problem 82 : Path sum: three waysNOTE: This problem is a more challenging version of Problem 81.The minimal path sum in the 5 by 5 matrix below, by starting in any cell in the left column and finish...

2019-01-28 16:16:47 346 1

原创 Project Euler Problem 81 (C++和Python代码实现和解析)

Problem 81 : Path sum: two waysIn the 5 by 5 matrix below, the minimal path sum from the top left to the bottom right, by only moving to the right and down, is indicated in bold red and is equal to 2...

2019-01-25 18:12:49 276 2

原创 Project Euler Problem 80 (C++和Python代码实现和解析)

Problem 80 : Square root digital expansionIt is well known that if the square root of a natural number is not an integer, then it is irrational. The decimal expansion of such square roots is infinite...

2019-01-24 14:51:09 376 2

原创 Project Euler Problem 79 (C++和Python代码实现和解析)

Problem 79 : Passcode derivationA common security method used for online banking is to ask the user for three random characters from a passcode. For example, if the passcode was 531278, they may ask ...

2019-01-22 18:19:42 595 1

原创 Project Euler Problem 78 (C++和Python代码实现和解析)

Problem 78 : Coin partitionsLet p(n) represent the number of different ways in which n coins can be separated into piles. For example, five coins can be separated into piles in exactly seven differen...

2019-01-17 19:04:21 308 1

原创 Project Euler Problem 77 (C++和Python代码实现和解析)

Problem 77 : Prime summationsIt is possible to write ten as the sum of primes in exactly five different ways:7 + 35 + 55 + 3 + 23 + 3 + 2 + 22 + 2 + 2 + 2 + 2What is the first value which can b...

2019-01-16 15:21:03 370 1

原创 Project Euler Problem 76 (C++和Python代码实现和解析)

Problem 76 : Counting summationsIt is possible to write five as a sum in exactly six different ways:4 + 13 + 23 + 1 + 12 + 2 + 12 + 1 + 1 + 11 + 1 + 1 + 1 + 1How many different ways can one...

2019-01-16 13:35:29 467 1

原创 Project Euler Problem 75 (C++和Python代码实现和解析)

Problem 75 : Singular integer right trianglesIt turns out that 12 cm is the smallest length of wire that can be bent to form an integer sided right angle triangle in exactly one way, but there are ma...

2019-01-15 15:49:58 376 3

原创 Project Euler Problem 74 (C++和Python代码实现和解析)

Problem 74 : Digit factorial chainsThe number 145 is well known for the property that the sum of the factorial of its digits is equal to 145:1! + 4! + 5! = 1 + 24 + 120 = 145Perhaps less well known...

2019-01-15 11:45:43 381 1

原创 Project Euler Problem 73 (C++和Python代码实现和解析)

Problem 73 : Counting fractions in a rangeConsider the fraction, n/d, where n and d are positive integers. If n<d and HCF(n,d)=1, it is called a reduced proper fraction.If we list the set of redu...

2019-01-14 15:35:56 265 1

原创 Project Euler Problem 72 (C++和Python代码实现和解析)

Problem 72 : Counting fractionsConsider the fraction, n/d, where n and d are positive integers. If n<d and HCF(n,d)=1, it is called a reduced proper fraction.If we list the set of reduced proper ...

2019-01-13 20:07:16 423 2

原创 Project Euler Problem 71 (C++和Python代码实现和解析)

Problem 71 : Ordered fractionsConsider the fraction, n/d, where n and d are positive integers. If n<d and HCF(n,d)=1, it is called a reduced proper fraction.If we list the set of reduced proper f...

2019-01-13 19:56:14 276 1

原创 Project Euler Problem 70 (C++和Python代码实现和解析)

Problem 70 : Totient permutationEuler’s Totient function, φ(n) [sometimes called the phi function], is used to determine the number of positive numbers less than or equal to n which are relatively pr...

2019-01-11 17:31:37 275 2

原创 Project Euler Problem 69 (C++和Python代码实现和解析)

Problem 69 : Totient maximumEuler’s Totient function, φ(n) [sometimes called the phi function], is used to determine the number of numbers less than n which are relatively prime to n. For example, as...

2019-01-11 13:20:47 291 2

原创 Project Euler Problem 68 (C++和Python代码实现和解析)***

Problem 68 : Magic 5-gon ringConsider the following “magic” 3-gon ring, filled with the numbers 1 to 6, and each line adding to nine.Working clockwise, and starting from the group of three with the...

2019-01-09 17:54:49 323 8

原创 Python入门到提高

1. 列表1.1 列表赋值下面是比较经典的列表赋值方法:my_list = [] for i in range(1, 11): my_list.append(i)print(my_list)我们使用了 my_list.append(i) 来赋值。或者my_list = [] for i in range(1, 11): my_list += [ i ]prin...

2019-01-07 17:49:56 340

原创 Python快速入门

1. Python 入门1.1 Python 简介Python 是一种易于学习又功能强大的编程语言。它提供了高效的高级数据结构,还有简单有效的面向对象编程。Python 优雅的语法和动态类型,以及解释型语言的本质,使它成为多数平台上写脚本和快速开发应用的理想语言。Python 解释器及丰富的标准库以源码或机器码的形式提供,可以到 Python 官网 https://www.python.or...

2019-01-06 15:32:12 670

原创 Project Euler Problem 67 (C++和Python)

Problem 67 : Maximum path sum IIBy starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bottom is 23.37 42 4 68 5 9 3That is, ...

2019-01-05 15:57:40 278 2

原创 Project Euler Problem 66 (C++和Python)

Problem 17 : Diophantine equationConsider quadratic Diophantine equations of the form:x2 – Dy2 = 1For example, when D=13, the minimal solution in x is 6492 – 13×1802 = 1.It can be assumed that the...

2019-01-04 18:57:21 254 1

原创 Project Euler Problem 65 (C++和Python)

Problem 65 : Convergents of eHence the sequence of the first ten convergents for √2 are:1, 3/2, 7/5, 17/12, 41/29, 99/70, 239/169, 577/408, 1393/985, 3363/2378, …What is most surprising is that th...

2018-12-30 21:10:52 382 1

原创 Project Euler Problem 64 (C++和Python)

Problem 64 : Odd period square rootsAll square roots are periodic when written as continued fractions and can be written in the form:It can be seen that the sequence is repeating. For conciseness, ...

2018-12-29 16:38:47 219 1

原创 Project Euler Problem 63 (C++和 Python)

Problem 63 : Powerful digit countsThe 5-digit number, 16807=75, is also a fifth power. Similarly, the 9-digit number, 134217728=89, is a ninth power.How many n-digit positive integers exist which ar...

2018-12-28 19:28:27 270 1

原创 Project Euler Problem 62 (C++和Python)

Problem 62 : Cubic permutationsThe cube, 41063625 (3453), can be permuted to produce two other cubes: 56623104 (3843) and 66430125 (4053). In fact, 41063625 is the smallest cube which has exactly thr...

2018-12-27 18:12:23 230 1

原创 Project Euler Problem 61 (C++和Python)

Problem 61 : Cyclical figurate numbersTriangle, square, pentagonal, hexagonal, heptagonal, and octagonal numbers are all figurate (polygonal) numbers and are generated by the following formulae:Tri...

2018-12-27 16:19:48 273 1

原创 Project Euler Problem 60 (C++和Python)

Problem 60 : Prime pair setsThe primes 3, 7, 109, and 673, are quite remarkable. By taking any two primes and concatenating them in any order the result will always be prime. For example, taking 7 an...

2018-12-26 13:49:42 320 3

原创 Project Euler Problem 59 (C++和Python)

Problem 59 : XOR decryptionEach character on a computer is assigned a unique code and the preferred standard is ASCII (American Standard Code for Information Interchange). For example, uppercase A = ...

2018-12-23 21:38:08 385 2

原创 Project Euler Problem 58 (C++和Python)

Problem 58 : Spiral primesStarting with 1 and spiralling anticlockwise in the following way, a square spiral with side length 7 is formed.37 36 35 34 33 32 3138 17 16 15 14 13 3039 18 5 4 3 12 ...

2018-12-21 18:50:45 266 2

原创 Project Euler Problem 57 (C++和Python)

Problem 57 : Square root convergentsIt is possible to show that the square root of two can be expressed as an infinite continued fraction.√ 2 = 1 + 1/(2 + 1/(2 + 1/(2 + … ))) = 1.414213…By expandin...

2018-12-21 17:53:27 236 1

原创 Project Euler Problem 56 (C++和Python)

Problem 56 : Powerful digit sumA googol (10100) is a massive number: one followed by one-hundred zeros; 100100 is almost unimaginably large: one followed by two-hundred zeros. Despite their size, the...

2018-12-21 16:39:30 208 1

原创 Project Euler Poblem 55 (C++和Python)

Problem 55 : Lychrel numbersIf we take 47, reverse and add, 47 + 74 = 121, which is palindromic.Not all numbers produce palindromes so quickly. For example,349 + 943 = 1292,1292 + 2921 = 42134213...

2018-12-20 17:23:46 291 1

原创 Project Euler Problem 54 (C++和Python代码实现和解析)***

Problem 54: Poker handsIn the card game poker, a hand consists of five cards and are ranked, from lowest to highest, in the following way:High Card: Highest value card.One Pair: Two cards of the s...

2018-12-19 14:58:45 573 2

原创 Project Euler Problem 53 (C++和Python)

Problem 53: Combinatoric selectionsThere are exactly ten ways of selecting three from five, 12345:123, 124, 125, 134, 135, 145, 234, 235, 245, and 345In combinatorics, we use the notation, 5C3 = 10...

2018-12-19 14:29:54 197 1

原创 Project Euler Problem 52 (C++和Python)

Problem 52: Permuted multiplesIt can be seen that the number, 125874, and its double, 251748, contain exactly the same digits, but in a different order.Find the smallest positive integer, x, such th...

2018-12-19 14:18:12 177 1

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除