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

Автор saurabhyadavz, 6 лет назад, По-английски

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

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

»
6 лет назад, скрыть # |
 
Проголосовать: нравится +4 Проголосовать: не нравится

great research saurabhyadavz.

»
6 лет назад, скрыть # |
 
Проголосовать: нравится +6 Проголосовать: не нравится

There must be a bookmark option to save such blogs .

»
6 лет назад, скрыть # |
 
Проголосовать: нравится +16 Проголосовать: не нравится

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

»
6 лет назад, скрыть # |
 
Проголосовать: нравится -16 Проголосовать: не нравится

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

»
6 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +3 Проголосовать: не нравится

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

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

For MO's Algo on trees, how to find the LCA of two nodes??

»
3 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

The page https://blog.anudeep2011.com/mos-algorithm/ doesn't load for me. Does this work for someone else?

»
19 месяцев назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

One more problem based on Mo's Algorithm 221D - Little Elephant and Array

»
11 месяцев назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

need an idea on how we can use this to find the distance between the first occurrence and last occurrence of any element in a given range for multiple queries? Any help appreciated!

»
11 месяцев назад, скрыть # |
 
Проголосовать: нравится +32 Проголосовать: не нравится

I've never encountered Mo's algorithm outside of "We tried to cut solutions using Mo's algorithm, but unfortunately some ended up passing."

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Great effort. It is nice to learn about this. I never knew this concept had a name or could be useful anywhere, but sometimes it works. Thank you for the blog and the work.

For anyone facing issues with anudeep2011’s blog not opening, you can try this workaround. It should work: Here you go!!

»
3 недели назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

exactly, in Chinese mo's algorithm means "莫队算法" not "莫隊算法"