Question: Hints: Use long long or long long int for C + + Use numpy.int 6 4 if using Python 2 . In Python 3 using

Hints:
Use long long or long long int for C++
Use numpy.int64 if using Python 2. In Python 3 using int will automatically give you long
integer.
Look at example below. Instead of iterating i from 1 to 16, we can jump i from 6 to 8
because we know all the quotients are the same. Similarly we can jump I from 9 to 16
because we know all the quotients are the same. Can we compute the last day the quotient
will stay the same, given the current day?
To analyze the time complexity concretely, you need to observe that n/sqrt(n)=sqrt(n). Our tutor gave this hints. Your given code does not execute within 4 sec for 10^12

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!