본문 바로가기

Programming/Project Euler

(43)
510. Project Euler #510 : Tangent circles. This is a recent problem, so not now, difficulty rating is not determined. I think difficulty rating is about 50%. At my middle school hood, math teacher said that geometry problem can be solved if you draw lines properly. This problem is sam. This picture is that added lines and triangles on original problem image. Make repairs to the line L in circle A, make repairs to the line L in circle B, ..
10. Project Euler #10 : Sum of primes Difficulty rating is 5%.  The task is to calculate all prime numbers below 2 million.The solution is straightforward: use the Sieve of Eratosthenes to find primes below 2 million.There are several algorithms to check if a number is prime, such as Miller-Rabin and AKS. However, for this problem, I believe the Sieve of Eratosthenes is the best approach. #include #include int main(){ int primes[..
9, Project Euler #9 : Special Pythagorean triplet Difficulty rating is 5%. A Pythagorean triplet is a set of three natural numbers, a
Current my project euler status. Solving problems ordered is sometimes very boring. So I am solving recent problems as possible. Solving 3-digit problems is not easy to me. The maximum difficulty level is 70% currently. Generally, solving greater than 50% is comsume 2 or 3 days. Sometimes, I gave up. Almost problems I made my own solutions. But 2 or 3 problems, I cannot find solution. For example problem #78. My best solution i..
8. Project Euler #8 : Largest product in a series. This is a useful problem for searching substrings within a document. Hashing can be applied to search for a substring efficiently. In this problem, calculating the product is required, but special care must be taken to handle overflow and multiplication by zero.The product of the digits in a number with a base of 13 can yield a result as large as \(9^{13} = 2,541,865,828,329\). Since a 32-bit in..
7. Project Euler #7 : 10001st prime Looking for large prime numbers obviously have to use mathematical searching prime number algorithm.Sieve of Eratosthenes is good algorithm for finding small prime numbers. 10,001st prime number is small, so, sieve of Erotosthenes algorithm is enough. Algorithm itself is very simple. Hold the array space to store a few, here and put on top of each put a few on top of each.Once a small number is ..
6. Project Euler #6 : Sum square difference In fact, this problem is equivalent to the previous problem #1, to obtain the sum. (http://odev.tistory.com/8) As you know, you can get the answer using for-loop. I think that you'd better to use summation fomula. Using fomula is more efficient to use for-loop, as you know already. The performance betwwen them, bigger range for sum larger performance difference is. int main() { int n = 100; int ..
5. Project Euler #5 : The smallest number that can be divided by numbers below 20. The difficulty of the problem, I feel that a little bit goes high. This is a problem that can exert sufficient efficiency. The algorithm is easy,As will be easily solved sequentially from 1 to find the first number evenly divisible by the number 1 through 20 for all you can, then you need to check on you when so many do. Here, find the greatest common divisor by the Euclidean method, I think the..
4. Project Euler #4 : Largest palindrome product. Simply think this problem, Determine multiplied result of two three-digit numbers a and b is palindrome number and take largest palindrome number. However, In order to get largest palindrome number, we have to multiply all three-digit numbers each, and the complexitcity can be 100 million order. So I implemented the algorithm, 1) Generate 6 digit palindron numbers ordered from large to small. (u..
3. Project Euler #3 : Find the biggest prime factor. This problem is making a program to find the largest prime factor for a given number. In fact, no choice but to use the body of elastomer Ness Te find the largest prime factor. It is one that is required is to continue to divide a given number. Is beyond the scope of this program as well. The general form for a small number of bit to speed, all except 2 is an odd prime number. Is an odd prime fa..