Showing posts with label Maximum Gcd and Sum. Show all posts
Showing posts with label Maximum Gcd and Sum. Show all posts

Monday, July 24, 2017

Maximum Gcd and Sum (III)

July 24, 2017

Introduction


"Maximum Gcd and Sum" is the algorithm related to great common divisor, and prime number technique called sieve of eratosthenes is used in the optimal solution.

The algorithm is the first medium level algorithm in week of code 34 on Hackerrank. Julia spent more than a few hour in the Saturday of July 21, she did not come out the solution to fix the timeout and run time error issue.

Here is the optimal solution after the study of editorial notes.

Plan to do time complexity analysis on test case 1, 400,000 is the length of testing array.


Saturday, July 22, 2017

Maximum Gcd and Sum (II)

July 22, 2017

It takes a lot of time to move forward with timeout issue on this algorithm. Julia likes to check her progress and stay positive all the time.

Here is her code submission in second time, now it is 8:00 pm, 7/22/2017.




The original points for the algorithm is 25, but so far only 16.4 available for Saturday player. Julia only made 20% of available points 16.4. Continue to work on it!

It is 10:27 pm. Julia worked on timeout issues, now she came cross runtime error issue. Most of her issues are runtime error, only two cases are timeout.



Follow up after the contest


July 24, 2017

The code submitted in the contest is here. The idea used in the algorithm is to find prime factors for each number in the array.