/**  * The sum of the squares of the first ten natural numbers is, 12 + 22 + ... + 102 = 385  * The square of the sum of the  * first ten natural numbers is, (1 + 2 + ... + 1
原创 2012-03-26 13:25:48
599阅读
Project EulerProgressProblem 1 Multiples of 3 or 5If we list all the natural numbers below 10 that are multiples of 3 or 5, we get
原创 2023-05-22 10:49:03
58阅读
  haolloyin 师兄已经在这里介绍了project euler这个很不错的算法练手网站,经过俺的亲身体会,觉得非常有必要推荐给各位同学。而且project euler 最近改版了,新版有很多有趣的奖,看着就激动更不用说得到了。   师兄的文章里全面介绍了project euler 这个网站,我想续写一下,顺便总结这些天玩 euler 题目的心得。通常解一道题
原创 2011-10-20 22:15:59
800阅读
1点赞
2评论
The sequence of triangle numbers is generated by adding the natural numbers. So the 7thtriangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28. The first ten terms would be:1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ...Let us list the factors of the first seven triangle numbers:1: 13: 1,36: 1,2,3,610: 1,2
转载 2011-03-10 21:19:00
141阅读
2评论
题意须要注意的一点就是, 序列是从外层最小的那个位置顺时针转一圈得来的。而且要求10在内圈 所以,这题暴力的话,假定最上面那个点一定是第一个点,算下和更新下即可。 #include <iostream> #include <cstring> #include <cstdio> #include <a
转载 2017-05-12 20:08:00
147阅读
2评论
 Problem 188 winxos 2010-1-26 04 April 2008 The hyperexponentiation or tetration of a number a by a positive integer b, denoted by a&uarr;&uarr;b or ba, is recursively defined by: a&uar
原创 2010-06-12 09:52:05
650阅读
A perfect number is a number for which the sum of its proper divisors is exactly equal to the number. For example, the sum of the proper divisors of 28 would be 1 + 2 + 4 + 7 + 14 = 28, which means that 28 is a perfect number.A numbernis called deficient if the sum of its proper divisors is less tha
转载 2011-03-28 15:26:00
92阅读
2评论
Starting with the number 1 and moving to the right in a clockwise direction a 5 by 5 spiral is formed as follows:2122 23 242520 78 91019 6 12 1118 54 3121716 15 1413It can be verified that the sum of the numbers on the diagonals is 101.What is the sum of the numbers on the diagonals in a 1001 by 100
转载 2011-03-22 10:03:00
83阅读
2评论
The Fibonacci sequence is defined by the recurrence relation:Fn= Fn1+ Fn2, where F1= 1 and F2= 1.Hence the first 12 terms will be:F1= 1F2= 1F3= 2F4= 3F5= 5F6= 8F7= 13F8= 21F9= 34F10= 55F11= 89F12= 144The 12th term, F12, is the first term to contain three digits.What is the first term in the Fibonacc
转载 2011-03-21 21:45:00
79阅读
2评论
A permutation is an ordered arrangement of objects. For example, 3124 is one possible permutation of the digits 1, 2, 3 and 4. If all of the permutations are listed numerically or alphabetically, we call it lexicographic order. The lexicographic permutations of 0, 1 and 2 are:012 021 102 120 201 210
转载 2011-03-22 11:56:00
69阅读
2评论
You are given the following information, but you may prefer to do some research for yourself.1 Jan 1900 was a Monday.Thirty days has September,April, June and November.All the rest have thirty-one,Saving February alone,Which has twenty-eight, rain or shine.And on leap years, twenty-nine.A leap year
转载 2011-03-13 12:07:00
112阅读
2评论
The prime factors of 13195 are 5, 7, 13 and 29.What is the largest prime factor of the number 600851475143 ?1#include<iostream>2usingnamespacestd;34longlongGetFirstFactor(longlongnum)5{6longlongroot=sqrt((longdouble)num);7for(longlongi=2;i<root;i++)8{9if(num%i==0)10{11returni;12}13}1415retu
转载 2011-03-10 20:35:00
65阅读
2评论
题意很明了。 然后我大概的做法就是暴搜了先把每个几边形数中四位数的处理出来。然后我就DFS回溯着找就行了。比较简单吧。 #include #include #include #include #include #include using namespace std;vectorg[7], v[7][10000];int vis[7];void get_three(){ for(int i = 1; ; i++) { int x = i * (i + 1) / 2; if(x >= 10000) break; if(x >= 1000) g...
转载 2013-09-30 22:14:00
55阅读
Usingnames.txt(right click and 'Save Link/Target As...'), a 46K text file containing over five-thousand first names, begin by sorting it into alphabetical order. Then working out the alphabetical value for each name, multiply this value by its alphabetical position in the list to obtain a na
转载 2011-03-14 14:10:00
92阅读
2评论
Let d(n) be defined as the sum of proper divisors ofn(numbers less thannwhich divide evenly inton).If d(a) =band d(b) =a, whereab, thenaandbare an amicable pair and each ofaandbare called amicable numbers.For example, the proper divisors of 220 are 1, 2, 4, 5, 10, 11, 20, 22, 44, 55 and 110; therefo
转载 2011-03-11 22:40:00
159阅读
2评论
Starting in the top left corner of a 22 grid, there are 6 routes (without backtracking) to the bottom right corner.How many routes are there through a 2020 grid?1#include<iostream>2usingnamespacestd;34#definenum415longlongPascalTriangle[num][num];67voidCalcPascalTriangle()8{9PascalTriangle[0][
转载 2011-03-11 17:41:00
114阅读
2评论
Description:If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. T
原创 2023-02-17 10:01:17
42阅读
用python解决  Project Euler 问题 记录由于比较擅长java  对python相对陌生,就用python来解答源码:sumAll =0for index in range(1,1000): if index%3==0 or index%5 ==0: sumAll += indexprint(sumAll)
原创 2021-08-08 11:22:42
202阅读
Project Euler 5 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 positive nu
原创 2013-10-06 13:37:54
420阅读
向着400+进发...
原创 2022-08-11 15:07:27
68阅读
  • 1
  • 2
  • 3
  • 4
  • 5