mohammad74's blog

By mohammad74, history, 16 months ago, In English

Hi every one. Happy new year! I wish you all the best in 2023.

What do you think will be the most important event of 2023?

Full text and comments »

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

By mohammad74, history, 6 years ago, In English

Hi!

How to solve the following problem if each enemy be a circle with a known radius.

In that case the enemy will be killed if we shot any part of its body.

Han Solo and Lazer Gun

I want a greedy and a divide and conquer algorithm.

Full text and comments »

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

By mohammad74, history, 7 years ago, In English

Hi everybody! Can any one help me solving this problem.

Given an array of n integers in range 1 to 106 (1 ≤ n ≤ 103), find the minimum steps to make the absolute difference of every two numbers less than or equal to one?

At each step we can subtract 1 from one number and add 1 to an adjacent number.

For example if we do one step on 2nd element of this array: 1,2,3. It can become 2,1,3 or can become 1,1,4 ?

Full text and comments »

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