playinwithfire's blog

By playinwithfire, history, 13 months ago, In English

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

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By playinwithfire, history, 19 months ago, In English

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

Full text and comments »

  • Vote: I like it
  • +5
  • Vote: I do not like it

By playinwithfire, history, 21 month(s) ago, In English
  • Vote: I like it
  • -1
  • Vote: I do not like it