분류 전체보기 (60) 썸네일형 리스트형 [C/C++] Project Euler #25 1000-digit Fibonacci Number When learning C/C++ programming, one of the things everyone seems to try at least once is implementing the Fibonacci sequence. The Fibonacci sequence often appears in examples involving recursive functions and is also a frequent example for dynamic programming problems.The Fibonacci sequence originated from a quiz-like scenario about the growth of a rabbit population. However, it can also be app.. [C/C++] BOJ #1012 organic cabbages There are cabbages planted in your vegetable garden, and you want to grow them organically by releasing cabbage whiteworms. A single cabbage whiteworm is sufficient to prevent pests, as it can move to adjacent cabbages in the cluster.This problem is similar to the “number of islands” problem and other common problems. It can be solved using the basic DFS or BFS algorithms in graph theory. You ca.. [C/C++] Project Euler #24 Lexicographic Permutations The problem in Project Euler #24 is to determine the millionth lexicographic permutation of the digits 0 through 9. Understanding the Method with Base SystemsHow do we calculate a number in a specific base system?For instance, to convert 723 to base 8:We repeatedly divide the number and record the remainders. Recalling middle school mathematics, this calculation is performed as follows:\( 723 \d.. [C/C++] Project Euler #23 - Non-Abundant Sums Project Euler #23 - Non-Abundant Sums asks the following:A number is classified as either a “Deficient number,” a “Perfect number,” or an “Abundant number” based on the sum of its proper divisors. If the sum of the proper divisors of a number is less than the number itself, it is classified as deficient. If the sum equals the number, it is called perfect. If the sum is greater than the number, i.. [C/C++] Project Euler #22 Names Scores The problem requires calculating the total of all name scores in a given text file containing names. The steps to solve the problem are:1. Parse the input file: Read a file that contains a single line of comma-separated names, each enclosed in double quotes.2. Sort the names alphabetically: Sort the list of names in ascending order.3. Compute name scores:• Assign a score to each name based on th.. [C/C++] Project Euler #21 Amicable Numbers This problem, while not at the level of a Millennium Problem, belongs to the realm of long-standing unsolved mathematical challenges, similar to the proof that no odd perfect number exists. Many people might already be familiar with the concept of a perfect number. A perfect number is defined as a number that equals the sum of its proper divisors (excluding itself). Examples include 6 and 28, wh.. [C/C++] BOJ #1011 Fly me to the Alpha Centauri This problem is about finding the minimum number of times a warp drive needs to be activated to travel to Alpha Centauri. Though it sounds like a space exploration problem, it essentially boils down to finding the largest number 'k' where the sum 1+2+3+...+k is less than half the distance to Alpha Centauri.Warping to Alpha CentauriAlpha Centauri is located approximately 4.37 light-years away fro.. [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 #19 Counting Sundays I believe this problem is designed to test whether you can correctly identify leap years.In C/C++, you can easily solve this problem using the `mktime()` function in the `time.h` header file. However, I tried to find a slightly different approach. (When using the `mktime()` function, I wonder if leap seconds are also calculated. The day of the week for 0:00:00 on the 1st day of the month in year.. [C/C++] Project Euler #18 Maximum Path Sum I(Dynamic Programming) This program seemed interesting to me personally.Problem 18 of Project Euler is about finding the path from the top to the bottom in a triangle of numbers that gives the maximum sum.Starting from the top number in the given triangle, you move downwards by selecting one of the two adjacent numbers. The goal is to find the path that gives the maximum sum of the numbers you choose along the way.The.. 이전 1 2 3 4 5 6 다음