saurabhshadow's blog

By saurabhshadow, 2 months ago, In English

Possibly, someone called "MO" once used the trick in a local contest, and the name stuck and later got popular. I have never encountered the name "Mo's algorithm" outside of competitive programming.

The technique, or the term "Mo's Algorithm" ("莫隊算法" in Chinese) was originally thought of and popularized by 莫涛 (Mo Tao) and his teammates. It was first used to tackle a problem from 2009 China IOI Camp: 小Z的袜子(hose) — authored by 莫涛 himself. The problem was: given a sequence of integers, for any given interval, calculate the probability of choosing any 2 numbers and the 2 numbers are equal.

Now let's start. I have here compiled the tutorial, some articles written by me, and problems on Mo's algorithm.

Tutorials:

Basic problems:

I have written some basic articles on Mo's algorithm which has been published on Geeksforgeeks.

List of problems:

Edit:

Thanks for the upvotes! It means a lot to me

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

»
2 months ago, # |
  Vote: I like it +4 Vote: I do not like it

great research saurabhshadow.

»
2 months ago, # |
  Vote: I like it +6 Vote: I do not like it

There must be a bookmark option to save such blogs .

  • »
    »
    2 months ago, # ^ |
      Vote: I like it +8 Vote: I do not like it

    Well said. These awesome blogs must be bookmarked.

  • »
    »
    2 months ago, # ^ |
      Vote: I like it +20 Vote: I do not like it

    There is a bookmark option. You can click star near upvote and downvote buttons and this blog will be added to your favourite blogs. You can watch them in your profile or using this link.

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    There is already such option ,U can star the blogs which you like and these blogs will be saved in favourites section in your profile

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    you can add this to favourites

»
2 months ago, # |
  Vote: I like it +16 Vote: I do not like it

Mo is someone's name, writing "Mo's algorithm" makes more sense, no capital O. Where did that come from anyway?

  • »
    »
    2 months ago, # ^ |
      Vote: I like it +3 Vote: I do not like it

    Thanks for pointing out though. I think it comes from China.

    • »
      »
      »
      2 months ago, # ^ |
        Vote: I like it +14 Vote: I do not like it

      The algorithm of course comes from China ;), but somehow I doubt the capital-O spelling comes from there.

»
2 months ago, # |
  Vote: I like it -13 Vote: I do not like it

Really nice blog. Made my day !

»
2 months ago, # |
  Vote: I like it -16 Vote: I do not like it

I remember a time when I was stuck in a question in Codechef Long Challenge. This blog is really gonna help all.

»
2 months ago, # |
Rev. 2   Vote: I like it +3 Vote: I do not like it

Hey dude, nice blog! Thanks a lot.
Just wondering what made you think the part you have written after edit!

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Great job! Newbie lives matter.

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Very nice blog. Just looking bookmark it.

»
2 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Are there any questions that can only be solved by Mo's Algo? The algorithm is pretty cool in itself but personally; not a really big fan of it. What can be an alternative?

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Thank you so much for this. Please create more blogs like this on Tree and Graphs

»
5 weeks ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

I am at a rating of 1077 right now..Good to see somebody like you who at this stage could at least rise above 1500 hmm ..Good job by the way! I will use this list for my practice