D. Divide and Equalize DIV-3 :- can I implement this idea.

Revision en5, by saptarshikuar2003, 2024-12-27 11:44:17

problem link:- https://codeforces.net/problemset/problem/1881/D

here we have to choose two element in the array let ai,aj and choose a divisor of ai let x and replace ai=ai/x ans aj=aj*x;

after some operation we have to make all the element equal in that array

now let consider an array of two elements a1,a2 now let ai=a1 and aj=a2 x the divisor a1

==>let say a1=a1/x and a2=a2*x; ==>now a1/x=a2*x now multiply these two we get (a1/x)*(a2*x)=a1*a2;

we can generalise after all the operation when we multiply all the elements we get a1*a2*a3*a4...... so we can generalise if the nth root of a1*a2*a3....*an is a whole number then return yes otherwise return no; I don't no how to implement this idea..... also please clarify that the idea is right or wrong.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en5 English saptarshikuar2003 2024-12-27 11:44:17 2 Tiny change: 'lem link:-https://co' -> 'lem link:- https://co'
en4 English saptarshikuar2003 2024-12-27 11:43:31 2 Tiny change: ' (a1/x)*(aj*x)=a1*a2;' -> ' (a1/x)*(a2*x)=a1*a2;'
en3 English saptarshikuar2003 2024-12-27 11:43:07 4 Tiny change: 'a1/x and aj=aj*x;\n==>no' -> 'a1/x and a2=a2*x;\n==>no'
en2 English saptarshikuar2003 2024-12-27 11:41:52 26
en1 English saptarshikuar2003 2024-12-27 11:40:56 836 Initial revision (published)