print maximum first k pair of product in combinator of two array

Revision en2, by Tboros_kylie, 2024-01-27 04:53:39

We have two arrays of integer with n elements ( n <= 10^5 ) , consider:

a1 a2 a3 ... an

b1 b2 b3 ... bn

( abs(a[i],b[i]) <= 10^9 )

print maximum first k element c=(a[i] * b[j]) ( 1<=i,j<=n)

For example: input: n=3 k=3

a={1,2,3}

b={4,5,6}

Correct output: 6 12 18

I'm trying to solve problem like this , but i don't have any idea for getting "AC" , so i need some helps , thank everybody.

Tags math, combinations, data structures

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English Tboros_kylie 2024-01-27 04:53:39 10 Tiny change: 't output: 4 5 6\n\n\n\nI'' -> 't output: 6 12 18\n\n\n\n\nI''
en1 English Tboros_kylie 2024-01-26 15:01:54 495 Initial revision (published)