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

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

So there is this known problem: you have 2 arrays (let's say a and b) both of size n and you have to arrange them in such a way that the value $$$\sum_{i=1}^{n}a_{i}b_{i}$$$ is as small as possible. Intuitively, an idea is to pair the biggest element in a with the smallest in b, the second largest in a with the second smallest in b and so on. But I would like to see some sort of proof because this only relies on intuition. Thanks in advance.

Example: initially a = {3, 1, 1}, b = {6, 5, 4}. After performing the algorithm a = {3, 1, 1}, b = {4, 5, 6}. Answer is 3*4 + 1*5 + 1*6 = 23

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

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

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

Hi so I want to practice some problems on Timus that would be the equivalent of 1400-1500 on CF. What difficulty range would be the equivalent on Timus? Thanks

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

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

Автор xanaxxx, история, 3 года назад, По-английски

I want this to be the most down voted post on Cf. So I will say something offensive to make you mad. Programming sux!

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

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