You are given an Array of 2N positive integers.There are N rounds in total.You have to choose any 2 positive integers from an array and delete them.
Your score in each round will be gcd(num1,num2) * round_number where num1 and num2 are the. number you have chosen and round_number is the current round. Your total score will be the summation that you have obtained in every round.
Determine the total score.
Round starts from 1.
I try greedy and brute force (maximum gcd * maximum round no.) but wrong ans on some test case. I finded out it was DP problem.
Eg: 6 5 6 30
gcd(30,6)*2+gcd(6,5) * 1
6 * 2+1 * 1= 13 (brute forca)
dude.
constraint for a[i]
1<=a[i]<=10^3 or 10^6 or 10^9
am not sure for contraint but sure 1<=N<=10.
the test is alredy over. @cubefreak777 u want me to prove this qn not from live contest? sorry. i cant. bcoz in india test qns not public after test. but i speak thruth. u can ask anyone who give that contest in hackerrearth. this test already over long back.
these days in codechef proving a qn not from live contest become more tougher than prove correct solution for answer
i got 4 replies for post but no reply help me about problem. sorry to say @admin but am not getting any help by codechef discussion forum. only time waste. people reply to ask problem src but no one help to solve problem
Just hold on, when did any of us ask to prove anything. We just asked for problem source and constraints because without that problem is very hard to solve.
Stop cluttering the forum with this unproductive crap and tagging the admin unnecessarily. Feel free to leave if you think it’s a time waste no one is jobless here.
Now let’s get down to business. Do you have any experience with bitmask dp? This problem can be easily solved in \mathcal{O}(N^22^N) given the constraints are small.
u mean grredy brute force? yes but greedy failed. else i think brute force not possible coz 1st 20C2 x 18C2 x 16 C2 … i think like this brute force will TL