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

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

I randomly came up with this problem and tried to solve it, but unfortunately, I couldn't.

The problem is:

Given an array of length $$$n \geq 2 $$$ of positive integers, is it possible to make all elements equal doing the following operation any number of times (possibly zero)? In one operation we can pick any two different indices $$$i, j$$$ multiply $$$a_i$$$ by $$$2$$$, and add $$$1$$$ to $$$a_j$$$.

I've tried to bruteforce arrays of length $$$2$$$ up to $$$20$$$. $$$[1, 2]$$$, $$$[1, 3]$$$, $$$[1, 4]$$$, $$$\dots$$$ $$$[19, 20]$$$, and it is possible to make all elements equal. The question is: Is the answer for this problem always "YES" for any $$$n \geq 2$$$?

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

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

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

My solution 115233513 shares the same idea as 115217322. How can this be cheating? You can see that the coding style is different. All my solutions got skipped, that's not fair.

My solution for A 115216804 his solution for A 115212547. Completely two different implementations!

Help me, that's so frustrating and unfair

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

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