Hi Codeforces,

I am honored to present you "Adolescent Grigore Moisil" (AGM) International Programming Contest (8th edition).

AGM is addressed to high school students who can form teams of up to 3 members, ICPC style. The contest has a qualification round on **6th March 2022** at **13:00 GMT**. The problems are set up fully by (former) university students.

We are looking forward to international participants. Both the qualification and final round will be held online due to the pandemic situation. You can register here until **5th March 2022** at **13:00 GMT**.

Besides diplomas for the first 10 teams in the final round, the first team will receive a prize of 1200 RON, the second team a prize of 900 RON, and the third team a prize of 600 RON.

Finally, I am more than delighted to present you our team: patrick.sava (the heart of the project), average_frog_enjoyer, munteanuvlad98, Stelutzu, Alex18mai, teoionescu, carabet.cosmin, Stefan_Radu, Mihai22e, vreaudelftpls, GinguIonut, caesar2001, georgerapeanu, MiricaMatei, popovicirobert, tinca_matei, Usu and me.

Take a look at our problem-sets from the last edition:

Also, don't hesitate to contact us: contact@agm-contest.com

Thank you very much,

George

moldova will win

You can also message me or George if any question about our contest.

Where can we find the editorial to the problems from the last qualificational round?

the editorials were live; the problems were presented after the contest by the proposers

Was the live saved somewhere?

No :(

Hey everyone! There are less than 2 weeks till the start of the contest! :)

Several teams registered until now.

Qualification Round is at the same time as Open Olympiad in Programming. Many CIS school students won't be able to participate.

But do the times overlap? The contest is scheduled to take place at around 3pm in most of the Eastern Europeans countries.

Hello, are the team members must come from the same school? And also, will there be an unofficial mirror contest for non high schoolers?

As long as you and your mates are eligible, you can team up with anyone from any country. About unofficial mirror, there isn't, but if you really want to participate, we could offer you an unofficial (no prizes) account :) In case anyone else sees this message, we reserve the right to limit the number of unofficial accounts and these will be awarded on first come first served basis.

Please grab our email from the official website and text us there — in case you don't hear from us in ~24 hrs do text me.

Hi!

My friends and I have a question...

our transcripts are not in english(actually, they are in persian) and we don't know the equivalence of student id in our country.

how can we prove we are students? do you accept our transcripts?

thanks.

Hi! It's fine to upload your transcript in Persian. I guess it should be quite straightforward using Google translate to see that you are students.

The team doesn't strictly have to contain 3 members right? I mean, you can have 1,2 or 3 members in a group. I'm asking this because the form mandates that I fill info about the second and third participant.

No, it doesn't have to. There can be 1 or 2 students in the team. Sorry for the google form. Can you please fill with blank (N/A or something) details and upload a random blank picture? Thank you!

Hello, May I ask you a question? I've already registered, but how can I enter the contest at that time? Which website is the competition on?

I read the Rules ..

Each round will be hosted on the platform of the contest (which is a modified clone of DomJudge ).

This manual can help you .

Thank you very much!

We will send an email with credentials and the link to the DomJudge before the contest.

OK, I will pay attention to it. Thank you.

So when will you send the email to us?

We will start sending then tonight after 22:00 GMT. We will post a message here when we are done. If you didn't get them by tomorrow morning please send us a message. Please check spam as well! Thanks!

The registration has been extended until

5th March 2022at13:00 GMT. You can register here!The login credentials will be sent in the next couple of hours. Please do check your spam folder and in case you don't have them up to 2 hours before the competition kicks off, do email us at contact@agm-contest.com or alternatively PM either of me or George.

When will the final Scoreboard be announced?

You can join https://meet.google.com/ips-xecg-fur. We will present the solutions and then unfreeze the scoreboard. We will start in 5 minutes.

great problem.

Where will be posted the solutions ?

You can join https://meet.google.com/ips-xecg-fur. We will present the solutions live and then unfreeze the scoreboard. We will start in 5 minutes.

Will there be a document with the solutions? (If I want to revisit the solutions)

I am not sure about the document, but we do record the meeting now -- so we hope that you'll be able to access it!

Where/When will you post the recording of the meeting?

Not yet determined but we'll probably email you or post here a link shortly.

So when will you show the whole scoreboard? And can we know whether our team will enter the next round?

Please join https://meet.google.com/ips-xecg-fur for the live presentation of the solutions. Afterward, we will unfreeze the scoreboard. Thanks to everyone for participating in the contest!

Will there be posted the tests and official solutions (code)?

We are going to export the contest to CF's Gym; if you really wish to see the model solutions you could email us. About the tests, I am not sure, probably not.

Why though? Can't you do a drive with them?

In an ideal world yes, but this is a volunteering project in which 15+ people get involved and invest their time for free. We strive to find a balance between the quality and the effort invested by each of them and that's why we can't do absolutely every thing. We can try and do our best but we won't commit on every request.

A little advice. Perhaps you could increase the number of the international teams that qualify to the Final Stage of the competition in the next year?

I agree. It's quite frustrating to solve 9 problems and not get qualified while teams with very poor scores as 3 are qualified simply by being romanian. Perhaps 16 romanian teams would suffice?

I don't know where to write this. But I'm really really sure that the probability for Johnny's siblings to be sick is $$$75\%$$$ and not $$$66.67\%$$$. I submitted $$$66.67\%$$$ as a joke and it worked (we got first AC). I told the contest organizers because I believed many people were affected but they did not seem to believe me.

Chat history (I think it's ok for me to share)Me:

The testdata for genetics is wrong i think

The probability that Johnny's siblings will get the dieseas is 0.75

There are 8 cases we want to consider, 4 cases for the chromosome of Johnny's mother and 2 cases for which chromosome Johnny gets. Out of these, there are 4 cases that Johnny gets the dieseas, which is (Xx,left), (xX,right), (XX,left), (XX,right). the probability of the mother's chromosome is 25% Xx, 25% xX, 50% XX. So the probability for Johnny's siblings to get is 75%? I'm quite sure 66.667% is wrong but it passes the testdata

Jury:

Chromsome Y is 100% sick because the entire tree has Y as sick. So now the question is what they get from their mother. Their mother can only have Xx, xX or XX. xx is not possible because it is given that Johnny has the disease. So you have 1/3 probability for each. The probability of X being sick is 1/3 * 1/2 + 1/3 * 1/2 + 1/3 * 1 = 2/3 = 0.666. Good job getting accepted!

Me:

From the statement, I am assuming that below is a valid C++ simulation for what is happening in the world. The mother is chosen from each possible chromosome combination first, then johnny's chromosome is chosen second.

We see that the output is around 0.75. Unless I have intepreted what it means for the chromosome combination of everyone to be uniform?

Jury:

The way to think about it is as follows: You have a world with 25% xx women, 25% xX women, 25%Xx women and 25% XX women. Now in Johnny s case, we know that his mom is not from the first 25%, so his mom must be one of the other cases. Which all have equal probability to be (because they were all 25 in the first place). Since probabilities have to sum up to 1, the probability is 1/3.

Jury:

The simulation program is wrong because it does not compute the probabilities GIVEN THAT Johny is sick. The problem asks you for the conditional probability: P[brother is sick | Johny is sick].

https://en.wikipedia.org/wiki/Conditional_probability.

The problem statement says "We consider that all possible chromosome combinations have a uniform distribution". The "xx" is not a possible combination because we know that Johny is sick. So the possible combinations for the mother given that Johny is sick are Xx, xX, XX, with a probability of 1/3 for each one.

Me:

I know what conditional probability is. I don't understand what "The simulation program is wrong because it does not compute the probabilities GIVEN THAT Johny is sick" means.

I firstly randomly select a random universe where the chromosomes of the mother is randomly chosen over all possible chromosome pairs, and Johnny and his sibling are randomly chosen a chromosome from their mother. Then the if statement only checks those worlds where "Johnny is sick" or he has received X from his mother.

"So the possible combinations for the mother given that Johny is sick are Xx, xX, XX, with a probability of 1/3 for each one." How can you assume that they have equal probability? In a universe where Johnny's mother has XX, Johnny is more likely to get dieseas than if he was in a universe with xX. That is why we weight them accordingly in the weights 25%,25%,50%.

So I don't understand what exactly is wrong with my simulation program

Jury (after contest):

Yes, I agree with you. In a proper mathematical setup, the probability space is defined at the beginning, and after the observation that Johnny is ill, the mother's distribution becomes 1/2, 1/4, 1/4 and the sibling's probability is 3/4 as your experiment showed.

However, our intentions were that this problem should be one of the easiest. Hence, we tried to explain in the problem statement that "We consider that all possible chromosome combinations have a uniform distribution" with the intention to make the solution easier. That is, the contestant should just realize that xx is not valid and that we told them that we have a uniform distribution over {xX, Xx, XX}.

I agree that the problem statement was ambiguous, and together with the fact that "our definition" was different than the conventional definition in the probability theory, the statement became much more ambiguous. We are very sorry for this, but we are glad that you got an AC in the end. Again, we are very sorry for the penalty and the frustration. We hope that, apart from this problem, you enjoyed the contest and we are keen to see your performance tomorrow.

my teammate told me my code is unreadable so I added commentsIkr, I struggled with that problem thinking the probability should be 0.75 for about an hour, and after thinking about all possibilities for what could be wrong I thought why not try with 0.66 since they might have messed up their probabilities. This gave AC, but it also somehow happened to be 1 minute after some other team got AC on this problem, so they then disqualified both of our teams saying we cheated... What can I say? peak organization.

Yea, very fun to know you've been DQ-ed after spending 10 hours to solve problems, out of which 2-3 were spent on trying to figure out a wrong problem. We live in a society

And then they get in a meeting with us and basically tell us "our decision's been made, you will be put on the unofficial scoreboard, and there's nothing you can do to change that because you can't prove you haven't cheated."

Dunno man, but in Romanian we call this "blat"

I'm convinced that they were jealous because you had better gaming chairs than them.

This problem made me feel bad because I skipped all my biology lessons.