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

Блог пользователя playinwithfire

Автор playinwithfire, история, 12 месяцев назад, По-английски

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

Полный текст и комментарии »

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

Автор playinwithfire, история, 18 месяцев назад, По-английски

I copied the code for the question 1811E from the gfg site of an almost similar question,and had to do minor change as per 1811E, the source code was published way before the contest. Im attaching the link of the gfg code i used for my soln.

https://www.geeksforgeeks.org/finding-the-nth-term-in-a-sequence-formed-by-removing-digit-k-from-natural-numbers/amp/

Thanks

Полный текст и комментарии »

  • Проголосовать: нравится
  • +5
  • Проголосовать: не нравится

Автор playinwithfire, история, 20 месяцев назад, По-английски
  • Проголосовать: нравится
  • -1
  • Проголосовать: не нравится