Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

I need help in solving the following problem

Правка en9, от Hando, 2023-03-07 10:56:45

It is an interactive problem.

We have an array $$$a$$$ that we don't know ( and cannot modify ) and we are given an array $$$b$$$ of the same size as $$$a$$$. (length of $$$a$$$ is less then $$$4\ 000$$$).

We need to arrange the elements in the array $$$b$$$ such that the cross product of arrays $$$a$$$ and $$$b$$$ is maximal. ($$$a_1 \ * b_1 \ + \ ... \ + \ a_n \ * b_n$$$ is maximal ).

The interaction consist in giving the array $$$b$$$ and reciveing the cross product with $$$a$$$ every time. (You cannot give an array that is not a permutation of the inital array the we are given $$$b$$$.)

How can we find a rearrangement of array $$$b$$$ that gives the maximal cross product with $$$a$$$, in less than $$$6\ 000$$$ tries?

Edit: I think it is important to mention that $$$a$$$ and $$$b$$$ can have any positive ($$$ > 0$$$) value (and they do not need to be a permutation of $$$n$$$ elements necessarly).

Edit: Also i believe that that jtrh has the right solution, it just needs a little bit of casework when we have in $$$b$$$ multiple elements equal to $$$b[0]$$$ (but I think you can figure out what to do next). My thanks!

Also, thank you to everyone who commented!

Теги need help, interactive problem

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en9 Английский Hando 2023-03-07 10:56:45 24 Tiny change: ' to $b[0]$, after sorting them ofc (but I th' -> ' to $b[0]$ (but I th'
en8 Английский Hando 2023-03-07 10:52:08 544 Tiny change: ' positive value (an' -> ' positive ($ >\ 0$) value (an'
en7 Английский Hando 2023-03-07 10:11:01 61
en6 Английский Hando 2023-03-07 02:45:14 2 Tiny change: 'eing the corss product' -> 'eing the cross product'
en5 Английский Hando 2023-03-07 02:44:22 2 Tiny change: 'ing the arary $b$ and ' -> 'ing the array $b$ and '
en4 Английский Hando 2023-03-07 02:38:31 56 (published)
en3 Английский Hando 2023-03-07 02:34:07 1 Tiny change: '000$ tries' -> '000$ tries.'
en2 Английский Hando 2023-03-07 02:33:57 24 Tiny change: ' array $b$ such that ' -> ' array $b$, in less than $6000$ tries'
en1 Английский Hando 2023-03-07 02:32:23 552 Initial revision (saved to drafts)