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 number that is evenly divisible by all of the numbers from 1 to 20?
접근방법
// 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
// 4 = 2*2 6 = 2*3 8 = 2*2*2 9 = 3 * 3 10 = 2 *5
// 12 = 2*2*3 14 = 2*2*7 15 = 3*5 16 = 2*2*2*2 18 = 3*3*2 20 = 2*2*5
// 2520 = 2*2*2*5*7*3*3
// result = 2*2*2*5*7*3*3*11*13*2*17*19
이렇게 해서 답은 구했으니 코드로 구현은 시간이 없어서 미완성 ㅠㅠ..
'Computer Science > Algorithm' 카테고리의 다른 글
[Linux] Terminator(창분할) (0) | 2017.12.07 |
---|---|
[Algorithm/C] Project Euler. Largest palindrome product (0) | 2017.12.05 |
[Algorithm/C] Project Euler. Largest prime factor (0) | 2017.12.02 |
[Algorithm/C] Project Euler. Even Fibonacci Numbers (0) | 2017.11.29 |
[Algorithm/C] Zig-Zag 배열 만들기 (0) | 2017.11.28 |