### MasterMind's blog

By MasterMind, history, 23 months ago,

Greetings everyone!

I was inspired by this blog post of how young orzdevinwang became LGM. I really would like to know the story of how he became LGM at a young age. Did he undergo some special training or was it his parent who helped him become LGM. I also want to ask experienced coders; Did they get help from their parents, if yes, how?!.

I am asking these questions, because I am a father myself, and I would like to give my kids an opportunity to pick up competitive programming hoppy. (I am well aware that CP might not fit everyone! but I want to give my kids a chance and if they like it, I want to offer my help, and if they don't; they can pick up whatever they like, and I will still help them in anyway they go).

As you can see from my ratings, I am below average coder. If my kids like CP, I can teach them up to a certain level, and beyond that I do not know what to do or how to help them.

• +28

By MasterMind, history, 2 years ago,

Hello there,

While I was trying to solve the following problem Multiple of 2019

Which is in short: Given a string of digits, Find the number of substrings that are divisible by 2019.

Example: 1817181712114 has $3$ substrings which are $(1, 5)$ "18171" , $(5, 9)$ "18171" , $(9, 13)$ "12114".

Now the solutions uses prefix sum by transforming the string into:

$1817181712114 = 1 \times 10^{12} \mod 2019 + 8 \times 10^{11} \mod 2019 + 1 \times 10^{10} \mod 2019 \dots + 4 \times 10^0 \mod 2019$

and for each residue count how many of the same residue has appeared before, and that will be the answer.

They said, this solution works for 2019 since 2019 is coprime to 10. and It does not work for 2020.

(2020 does not satisfy such conditions, so 2019 is used for this problem)

May I know why it does not work for 2020? and How to solve the same problem assuming that it is 2020.

Thanks

• -8

By MasterMind, history, 3 years ago,

Hello everyone,

I need help with the following problem E. Paired Payment.

I have read the tutorial but honestly I did not understand it much (maybe I am to blame for that), later I found a video by galen_colin on his youtube channel, the video link, He did an excellent job explaining problem E. However, he did not go into implementation details.

My question is:

• Is this some common technique used, if yes where can I read about it.
• How to plug these fake vertices into the graph and how to identify fake from original vertices? (I need the answer from implementation perspective)
• I also need similar problems to solve to strengthen my understanding with these kind of problems

• +29

By MasterMind, history, 3 years ago,

Hi there,

I solved the following Problem using $0-1$ bfs.

In the first submission 95671950 I got WA on test 7. I only changed the initial placement in the deque and got Accepted on this submission 95669200

Here is a picture that shows the comparison between the two submissions.

I suspect that the test data is weak (because both submission should get Wrong Answer Or both submission should get Accepted) or I am missing something about $0-1$ bfs.

If you can shed some light into this, I would be thankful.

UPD: dorijanlendvaj has found a case that breaks my accepted solution, which means that the test data of the problem is weak or there is a problem with model solution. Thanks dorijanlendvaj

Test Case that should be added to test data

TestCase

I hope someone would add this test case using the uphacking feature

• +7

By MasterMind, history, 4 years ago,

Hi everyone,

My name is Amjad, and I am a university instructor at Hebron University in Palestine. We host a competition for Palestinian universities once a year usually in mid March to motivate students and bring them together to competitive programming world.

The difficulty of the problems is very close to Div.3 rounds.

The competition is usually hosted onsite in Hebron Uni Campus using my own private server, and then after the competition, the problems will uploaded to codeforces gym for everyone to participate. You can take a look the last year competition on this link

I started this initiative purely for fun and because I love this sport.

Now, the competition will be held in about a month from now. and I need help from the community to prepare a beautiful round for the contestants. So if you have a problem not necessarily 100% original or if you would like to be a tester please PM me. (The problems should be prepared in polygon).

I should mention that all of this is not sponsored by anyone and therefore all of this is a volunteer work. I won't be able to pay neither setters nor testers. All I can do is that if you come one day to my country Palestine by any chance I would invite you for lunch and take you around the city.

Thank you

UPD1: Some of you messaged me, but I cannot reply right away because codeforces only allow messages to 2 distinct recipients per hour. Please add your polygon username in the Private message when you PM me.

UPD2: I created a server on discord because it is easier to communicate, and will be sending the invite link when you PM me.

• +36

By MasterMind, history, 4 years ago,

I am running a private mashup contest. I am unable to view contestants codes while I am the manager of the contest. I wonder if this is intended or a bug! I hope MikeMirzayanov can look into it. As far as I remember I used to be able to see codes of the contestants.

• +9

By MasterMind, history, 4 years ago,

Disclaimer: The content might only be beneficial for people with rating less than 1600

Today, I want to share with you a very cool thing I learned in Problem C in the last Div.3 contest.

I prepared a 13 minutes video on youtube to show you what I learned, and hopefully you will learn something too.

Enjoy the video!

• +10

By MasterMind, history, 4 years ago,

we are given a grid of $n x m$

for example the following grid: You are at position A and you need to move to any of the borders cell. '#' represent a wall while '.' represent an empty spot, 'M' represent a monster. knowing that, each time you take a step, all monsters can take simultaneously a step. The question is there a way to reach one of the borders cell without ever sharing a cell with a monster. You can assume that the monsters already know the path you are taking.

5 8
########
#M..A..#
#.#.M#.#
#M#..#..
#.######


YES
5
RRDDR


I have been thinking about a solution for a while, all my solutions would end up TLE. Any ideas or hint that would help solve this questions?

• 0

By MasterMind, history, 4 years ago,

The link to the problem Problem

I read the tutorial but I cannot make sense out of it.

would any one explain how to come up with the solution.

any help is really appreciated

• +2

By MasterMind, history, 4 years ago,

Hi there,

I need help in understanding the editorial of this Problem

The Editorial written in Japanese mentioned 4 methods to solve the problem which I translated using google translator and I managed to understand the first two methods. The last method mention Binary search, I am interested in a the binary search solution.

Anyone can shed some light on this would be really helpful.

• +1

By MasterMind, history, 4 years ago,

The coloring of code is not shown when clicked on the submission ID, is that a glitch or the feature is removed?

UPD: The color feature is back and Thank you codeforces!

• +61