MohamedMagdy's blog

By MohamedMagdy, history, 23 months ago, In English

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$$$?

Full text and comments »

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

By MohamedMagdy, history, 3 years ago, In English

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

Full text and comments »

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