i have found for which input my output is not correct ; but I cant find its solution..............mmonish wrote:jan >>
Thanks. I found my bugs and got AC.
IS MY ALGORITHM OKEY::::
1: take input; if '0' is in set A ; then it will not enter in set A; if '0' is in set B then it should be eliminated from
B ;
2: if set A element has a multiple in set B ; then degree of element A and element B will increase;
3: now find the highest deg of any element; as it is highest it should be eliminated;
if it is in A[x]; then for each element in B if (B%A[x]==0 ) then deg B decrease .deg A[x]=0;
else for each element of A if B[x]%A==0 then degree A decrease'; deg B[x]=0;
thus we eliminate one element;
4. repeat if while degree of all element is not zero.
shovon