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

unable to solve this question, need help

Правка en1, от playinwithfire, 2023-10-15 19:25:08

You have two arrays A and B. They have the same length and values are from positive integers. For example:

A = [6, 3, 4, 8, 3] B = [2, 4, 2, 1, 2]

You need to find such two indexes i, j where i != j such that expression A[i] * B[i] + A[i] * B[j] + A[j] * B[j] is maximized. For example here it is i = 3, j = 1 which gives maximum of 52

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский playinwithfire 2023-10-15 19:25:08 382 Initial revision (published)