Home Forums Job Interview 후기 기본적인 알고리즘 문제좀 여쭤 볼께요 (Time limit error) 기본적인 알고리즘 문제좀 여쭤 볼께요 (Time limit error) Name * Password * Email OK. I just looked it up. The inequality is: n * ln (n/e) + 1 <= ln (n!) <= (n+1) * ln ((n+1) / e) + 1 You can use above to filter out most big m and n. (obviously, you need to compare it with ln (2**n) == n * ln (2) ) 1. you first take log of m and use the above inequality to essentially filter out most m and n input combination. But your professor would surely to have m and n pairs that can't be filtered out using above inequality. Then, you would have to calculate actual number in order to compare, but problem is the number can be very very big and you're going to run into all sorts of problems (even if you're using big number package). Below is what I would do. 2. count the number of factor of 2 in the factorial ( m! ), and subtract them from n. I think you can do this systematically by building a table. and then you do the multiplication of the remaining numbers. I agree to the terms of service Comment