본문 바로가기

big integer

(8)
[C++/Python] Project Euler #66 - Diophantine equation This problem has a difficulty level of 25%, but without mathematical background, it’s extremely hard to solve.If you try to just follow the formulas mechanically, this problem is very tough to crack.In this type of indeterminate equation where the solution is not fixed, finding integer solutions is something that, apart from brute-force substitution, would be unknown to someone who has only stud..
[C++/Python] Project Euler #57 - Square Root Convergents This problem may appear to be a math problem, but it’s actually just a simple calculation problem.It’s rated as a 5% difficulty problem on the Project Euler site.The content of the problem is that when calculating the square root of 2, it can be expressed as a continued fraction. For more about continued fractions, refer to Pell’s equation.We can express the square root of 2 in such a way using ..
[C++/Python] Project Euler #56 - Powerful Digit Sum This problem is categorized as a 5% difficulty level problem, but users of programming languages without a built-in BigInt module may face the challenge of having to implement or acquire such a module. If you use a language like Python, Java, or C#, which already includes a BigInt module, the problem can be solved quite easily. The problem itself is simple:Given values of a and b less than 100, ..
[C++/Python] Project Euler #55 - Lychrel Numbers This problem is also a difficulty level 5% problem.A Lychrel number is a positive integer that, when expressed in base 10 and added to its reverse, does not form a palindrome. If the result is not a palindrome, the process is repeated by reversing the number and adding again.Theoretically, since the numbers increase gradually, it is assumed that eventually a palindrome (a number that reads the s..
[C/C++] Project Euler #29 Distinct Powers This problem involves handling duplicates, but due to the large range of numbers, you’ll need to either use big integers for processing or come up with some other approach.To calculate the number of distinct \(a^b\) values, consider the following:For different a and b (where b > a), \(a^m\) and \(b^n\) will yield the same result only if b is a power of a. Otherwise, it’s impossible for the same ..
[C/C++] Project Euler #20 Factorial Digit Sum The Factorial Digit Sum problem asks you to calculate the factorial of a given number and then compute the sum of all the digits in the resulting number. For example, 10! (10 factorial) equals \(10 \times 9 \times 8 \times \cdots \times 1 = 3,628,800,\) and the sum of its digits is \(3 + 6 + 2 + 8 + 8 + 0 + 0 = 27\). The problem specifically challenges you to find the sum of the digits of 100!. ..
[C/C++] Project Euler #16 Power Digit Sum(BigInteger) The program essentially revolves around whether you can use a Big Integer implementation or not.Many programming languages natively support Big Integer types, which greatly influences the implementation difficulty depending on the language.The task is straightforward: compute \(2^{1000}\), and then sum all the digits of the resulting number.For instance, if you use Python, this problem can be so..
[C/C++] Project Euler #13 Large Sum(modular operation) Project Euler problem #13, titled Large Sum, is described as follows:• You are given one hundred 50-digit numbers.• Your task is to compute the sum of these 100 numbers.• Then, you must output only the first ten digits of the resulting sum.In other words, the main requirement is: “Find the first ten digits of the sum of the given one-hundred 50-digit numbers.” This problem seems to be better sol..

반응형