Problem Description
Problem Analysis
Code I wrote on November 8th… And then this problem showed up in this week’s practice… -_-|| Anyway…let’s review it once more~ The least common multiple of several numbers This approach is to find the largest number Then keep adding +1+1+1+1+1 And then find a number that every number divides evenly I originally thought it would TLE…but it didn’t…
| |
Let’s learn this way of finding the LCM of several numbers This method really is crude, feels bad I’ll come back and add it once I learn the others
20160403 addendum:
After computing the LCM of the first two numbers, compute the LCM of that with the next one Loop this operation, and the final result is the LCM of them all
Note that because multiplying first and then dividing may overflow with int you need to divide first and then multiply
| |