Hi everyone!

The rated Codeforces Round #571 (Div. 2) will take place on Jun/28/2019 11:20 (Moscow time). This round is based on the Kremenchuk Summer Programming Cup 2019.

The contest is prepared by Dalgerok, Karasick, stanislav.bezkorovainyi, antontrygubO_o, danya.smelskiy, and me.

You will have 2 hours and 15 minutes to solve 6 problems.

Good luck!

We apologize for the issue that happened with the problem B. The round is unrated. If you want to read my emotional reply about it, please read this.

shortest blog for CodeForces round XD

I mean, you know the saying: Quality over quantity. xD

Anyways, good luck to all participants!

Lol, Quality!

there is one more thing you wanna say

That it will be unrated

I hope the statement as short as the blog :)

Why hope? You won't even participate as far as I know.

UPD: He is my friend, and I asked him about that, he said he won't participate in the whole contest.

I'm sorry but his name is Black_Ghost, not "my friend".

I guess he knew about problem B all along. He's happy now.

I got it all wrong, it was not you

It was wonderful to set the contest for 2 hours and 15 minutes instead of 2 hours.

It will not affect much!

It will not affect you and the people like me Who just solve 1 or 2 questions . :D

And then they are done because they don't try to solve further .

For others it matters a lot .

Me either: I think it may cause lots of influence on somebody who can fix E or F But not for me. I'm a rookie player with only, only nothing.

Karasick vs karasek

You forgot to thank MikeMirzayanov for codeforces and polygon platform.

It is always understood that we owe MikeMirzayanov for this awesome platform of programming.

Somethings are called rituals!

..and the round becomes unrated. LoL

What do they mean when it is said that the round is based on a certain competition? In this case the "Kremenchuk Summer Programming Cup 2019".

it means there was hosted (or there will be hosted) a local competition and they decided to use its problems at cf round

But wouldn't that mean that some coders might have already solved these problems?

They are asked not to participate

This round is during the official competition. Participants have no way to take part in this CF round.

This day is my birthday, I hope I will become yellow

I think you will become Red instead of Yellow because it is your birthday #GPL

lol

Do you mean —

`map<int,int> lol;`

?General Public License?

farmersrice By GPL, he means Birthday Bumps. That's why he thinks y_men9_dva_po_fizike will get red instead of yellow. Happy Birthday y_men9_dva_po_fizike.

Its an Indian Acronym for G**** pe laat, literally meaning kicks on the ass

Happy birthday in advance!

I hope you won`t.

Btw, MikeMirzayanov, ban him. This guy is clearly using multiple accounts:

https://codeforces.com/profile/nomapunk

https://codeforces.com/profile/47th-Draganov

https://codeforces.com/profile/ProgrammerSasha

It doesn't matter.

"It doesn't any matter,OK?" is grammatically incorrect. This is an example of a fact that actually does not matter, because there are few native English speakers on Codforces and almost none English is perfect here (including mine).

On the contrary, if a person has two fakes from which he writes contests, he indeed shows disrespect for the competitive programming community. You may say, that i am writing from a fake account and show disrespect for the community too. This is a valid point, but i do not plan to write contests from this account and, therefore, won`t affect the rating distribution and anything related with contests themselves. Secondly, i just wanted to write this using that exact handle.

Disrespect

Hmm, someone's alarm is set for 4:20...

你好像将Codeforces拼错了

because there are few native English speakers on

CodforcesAnother misprint)), just like yours. You see, i did not blame you for your minor mistake). It was just (probably not very good) example of what does matter, and what does not))

Im curious over how you deducted that this person has multiple accounts.

Firstly, each account contains his name somewhere. Secondly, code styles are exactly the same. Maybe i do not understand something in this world, but Alexandr Draganov is not such a prominent guy that someone will name himself after him and copy his code-style by purpose. At least this is highly unlikely.

Great deductive reasoning; I too arrived at the same conclusion.

Anyway, i do not think that such "experienced" participant as you (Almost yellow!! Wow!! Greetings!!) should litter comments section with such junk. Leave this for some greens and grays (well, i do not want to discriminate people by their rating. Most low rated participants do not do this junk, but almost everyone who does it has low rating. Sorry, if you got insulted).

By the way, how do we know you are not a contribution s**t? Anyone can write this and gets tons of upvotes, and, therefore, contribution. This comment does not provide no useful information, no joke or funny meme, it is not a question. It does not provide anything! Although i realized that i can not understand cf community properly, i still have no idea why this got so many upvotes. So, lets conduct an experiment. I will write a similar comment and will see, whether it will get upvoted or not (i bet it won`t).

Shitposting is a perfectly valid mode of expression online

Nowhere did he question the "validity" of shitposting; he's only referring to its benefits (or lack thereof). This is something I've noticed with Codeforces community lately as well. I hate to be the dry influx of what otherwise seems to be a mostly humorous thread, but I see this as an oppurtunity to engage in some discussion around the current faults of Codeforces.

Many posts are obviously serious, and I believe there can be a variety of serious discussion instigated concerning these questions. A current challenge our community faces is that responses that do indeed offer some amuse, often from a more well-known (or higher rated!) user, but without creating practical benefit tend to get disproportionately upvoted. This encourages a system which ultimately deflects from the very core purpose of these forums: to present useful responses from knowledgeable individuals, and to help out beginners.

Don't get me wrong — I enjoy reading these comments as much as the next one. But there is an undeniable shift in the community towards top accounts getting exposure based on responses that aren't necessarily as contributing to debate as others.

ohho, many many happy returns of the day, Happy Birthday in advance. :)

I hope to become yellow as well because it's nomapunk's birthday

Good luck.Happy birthday!

Happy Birthday!!! I wish you that each problem you solve would be as interesting as this round`s B!

All the best!

Again judges proved that div3 = div2 + div1

The time is unusual.And it is friendly to Chinese！

so strange I feel. Although I think in here, the words Rabbit said seems emotional and rude. But, both sides’ words are really harmful to this fair community and very disrespectful. I don’t know how everybody who looked at these comments, also upvote or downvote to both them thinks. At least I regards these behaviors are unreasonable.

Ok, I’m just using my right to express how my feel, and also, take my downvote. Mmaybe a downvote can’t represent or change anything, there may be a lot of people on the other side. So what, that’s my right¯_(ツ)_/¯

Do i need to register or can i directly participate..I don't see register button..

contest has ended. before contest you will see a register button

May I become an orange color after this round?

No, you shouldn't :)

Unless you somehow get lucky and solve all of the problems,

I'm sorry, but no.

I curse you with 2098 upper limit until a nutella comes and kisses you.

Yeet! My curse is real :3

If this round rated I will get my dream come true.

I have solved ABCDF and rank40, you told me UNRATED?

orange next time:)

New to codeforces and been reading this a lot "based on......". What does thos actually mean?

Are the questions same, similar or based on something taught there??

I'm pretty sure it means they are the same problems.

Hi i'm very new to CP. I'm not sure if this is the right place to ask my question but sorry :-) I've joined CF recently. In my profile it is showing unrated. What should do to get rated.

Please help me I want to improve. Thanks to all in advance

You must participate in atleast 1 contest to get a rating

Hi Thank you But I've participated in code forces round 570 (DIV-3).

Rating takes some time to update after open hacking phase ends.

Thanks a lot for your time Can you also help me how i can improve myself in DS and algorithms,

https://codeforces.com/blog/entry/47516 This will help. :)

:-) Thanks I'll solve

Can someone give more information about the "Kremenchuk Summer Programming Cup 2019"?

It's a nice time for Chinese CFer

It's bad time for some other users

Yes,it's a good Chinese-round.

Orz xukuan

I say nothing

Orz xukuan

orz xukuan

Orz xukuan who created $$$O(n ^ 2 \log n)$$$ Suffix-Array and $$$O(\log n)$$$ Merge-Sort :)

Kek, authors have 3 IMO medals. Why not 3 golds, antontrygubO_o? :trollface:

I think much more important are gold IOI medals of arsijo and danya.smelskiy:)

This day is my birthday, I hope I will become cyan.

How'd your experiment go?

good luck !

hope good color for all ♥

As a Chinese I think the time will be good for us.

However, I'm in Russia now and thus the time is not that friendly for me to participate lol.

I was introduce with programming just 1.5 year ago. I have created my codeforces acount then. But still i don't know about the rating system. Anyone please help me to know about the rating system.

The practice is the only way if you want your rating to increase. I too am practicing.

You can read full details here. https://codeforces.com/blog/entry/20762

Though in a nutshell, it works like, You perform well(compared to similar rated participants) your rating goes up, you perform bad it goes down.

It feels to be good on Codeforces!

Contest time is suitable for Chinese.Good luck for everybody.

Hi everyone I want to solve questions on graphs and trees but i don't know basics about tree and graph.Please anyone help me from where i can learn basics and after that i can solve questions on graph and tree. Thanks in advance.

CP-algo At end of each article there are some problems to practice with.

Try E-maxx.

Why contest delayed by 15 minutes? It's definitely a bad culture of Codeforces!

I think the purpose is to gain more participants, but since the start time is different from the usual contest, the fact that there are fewer participants is not strange. Anyway, it's time to read comments. :)

:)

Delayed by 15 minutes

Sorry about the delay. We have some internet issues onsite.

Thank you for fast explanation

Will there be a 12 hour period of hacks for this round after the contest?

Nope.

No. 12 hours hacking phase exist in Educational CF Round and Div.3 Round (and few more contests).

that internet issue again

Seems that, codeforces is trying to maintain it's dignity(as well as uniqueness) by delaying contests nowadays.

![ ]() we are still waiting

i can't see your text !!! :\

I can not see your comment's photo, too. (the comment that you wrote it 5 minutes ago. please use preview.)

nice key-board . :) Would anyone please tell me the brand of it ??

looks like that code forces is testing it's users's patience !!

yes 15m delay ...…. Thx from Bangladesh !!! its Friday …. ( salat time if the contest start before time)

So real!!!

Score distribution?

I had registered for the contest . but during contest it showed i didn't register for the contest and thus couldn't submit solution . Please , Codeforces solve these type of problems soon.

I went to m2.codeforces.com after contest was lagging at the start, maybe this will help others facing problems

I think the sole purpose of this contest is drop my rating, getting easiest A and level goes high up from B.

it's true about me too ; i'm exactly like you now !

ur lucky,round became unrated

Same here :)

Had some network issues and couldn't submit 1st problem with good speed.

But it's unrated now :D

We are lucky.

When I noticed missing controls in my first attempt I skipped B and opened D (cause it has numbers in its name), quickly solved. C and E also nice problems. Was planning to get +200 rating today but somehow stopped, someone wants to see me in gray zone xD

the contest is unrated now :(

The problem setter of B should stop creating problems.

how to solve c , can u tell me

let sum(l, r) be the number of "1" appears in range[l, r] in the string a.

and the answer is the number of range [l, r] that (sum(l, r) % 2) == (the number of "1" in string b % 2). and of course (r — l + 1) = |b|.

you can see the code of my another account Dilute_ :P

`(sum(l, r) % 2) == (the number of "1" in string b)`

Can you clarify the above line please? Because LHS would always be 0 or 1

I believe Dilute meant sum(l, r)%2 == (no of "1" in string b)%2

because say there are x no of "1" in substring of a and y no of "1" in b and z be the no of "1" that are in same position in that substring and b

then required number of different will be x+y-2z

so if x + y is even, that substring is counted in final answer

Thank you and How you come up with this?! Do you have some similar problems on cf?

how please explain or if u have link of similar problem share it

Proof for problem C. BanazadehAria

Let there be $$$x$$$ number of 1s in substring $$$c$$$ of given $$$a$$$ and $$$y$$$ number of 1s in substring $$$b$$$.

Let $$$t$$$ be the number of 1s that match[overlap] in both the strings. So exactly $$$x-t$$$ number of 1s do not match in $$$c$$$ and exactly $$$y-t$$$ number of 1s do not match in $$$b$$$.

Total mismatches = $$$x+y-2t$$$, we need to find whether this is even. $$$2t$$$ is even, so it's sufficient to check whether $$$x+y$$$ is even.

56238050

Well.. It was my fault and I have fixed it now :D

I just wrote the comment without checking carefully, but I just meant it modulo 2 QwQ

You do know that you are not supposed to have two accounts, right?

LOL! But why? Is it because it was very difficult in comparison to the points assigned to it or because the judge's solution was wrong.

Exactly. I didn't like that problem either.

I'm really interested in why so much people solved B...

and their solution are all the same as the writer's wrong one...

Because a lot of people follow their intuitions blindly :-)

Honestly I'm really happy when this contest is unrated!

anyway, will there be a tutorial for the B ?

I think the answer is (n+1)*(m+1)/6, but I didn't prove it yet.

its wrong

Can you show me the case my answer gives the wrong answer?

Try 6 6 The answer is 7

NO. The answer is 8. And like this:

Oh, you are right.

Also thought of this during contest, but was given WA on 3, also can't find any counterexample.

Apart from proving, could you please explain your intuition?

What is a resoning behing this formula?

It is now understood. An explanation by Noam527 was helpful.

I thought it by finding that when input is 13 17, the answer is 42. :)

Are you kidding me? How could you find the right answer for this input during the contest? (13x17 seems to be too large for brute force.)

It is like this.

Actually not so hard..

But how did you know that this tiling is an optimal?

In fact it is another intuition. So I checked another case:

But this case gave me same answer.

Anyway, I like your choice!

I mean,

the Answer to the Ultimate Question of Life, the Universe, and Everything:)When you solve D problem the first time and contest becomes unrated :/

Don't worry, there are many who found D easy.

Same for F

D was easier than B and C (for me)

The contest became unrated. :(

The luckiest and unluckiest day of my life

What's the answer of this input for problem B?

4

According to my code (which will not pass TCs), it should be 4.

Four

its 4

4

you can put the blocks in a clockwise(or counter-clockwise) way. The answer is 4.

I think answer should be 4. Arrangement can be like:

It looks like the answer is 1488

It's 4:50 a.m. in my timezone.

And the round is unrated.

4:50 a.m. lol :)

where are you ?

How to solve B?

upload

timo14z LOOOOOOL literally This is you :D

arsijo please stop creating problems (с) (2).

Let's solve problems for fun!

Scored well for the first time. Round unrated. Can't laugh anymore at my fate. LOL

crying insideCompletely reverse situation here XD.

Round became unrated => Let's start down-voting the blog post :D

There was some problem in B, it affected a lot of people and hence unrated, doesn't mean we down vote him, it takes a lot of efforts to come up with problem ideas and write problem statements.

I know man I appreciate all the effort, I up-voted him too, but it's some kind of Codeforces tradition.

But it is also true for the problem setters to take responsibility for their mistakes.

calm down...

I wrote down last Div2 contest that from now on I will skip B's and work on C and D, and I managed to solve D while I didn't have even the slightest idea how to solve B (or C). Seriously guys, fix your B's and C's, C's are usually better and easier than B's because you put some stupid string/geometry tasks in B that are unnecessarily hard.

When the contest time is so convenient for you, but the round became unrated. SAD LIFE

Is this round unrated now?

sad to say yes :(

yes

Can anyone give solution to problem C?

In Problem C, Look for every substring of length |b| in string a , Now, for every substring count the number of set bits and if the sum of set bits in a and string b are even then just add 1 to your answer.

If there's an equal amount of 1's and 0's in string b and string(a.substr(i,b)) then their difference must be even.

1010 and 1100 is a good example, no matter how you arrange those 1's and 0's, their difference will still be even.

Ha radiya ;)

I thought that author of problem B was just unlucky. Even many (it could be over 80%, maybe?) oranges or reds are solving with incorrect solutions. So it is not to surprise that all writers and testers solved in incorrect but same way.

So, I can't gaze at the current situation which problem setter said to stop creating problems.

And I don't think that it should be heavily downvoted, as same reason as Codeforces Round #373.

For such problems, I in general expect rigorous mathematical proofs of the claims made. So, I'd like to know if the proof went wrong somewhere, or did everyone else use some greedy-like technique?

Both are possible. It is possible that proof of problem B went wrong somewhere, judging by many orange of red coders tend to at least find a way to prove the optimality before coding.

But it is also possible that authors "verified" their solution by brute-force check for small H and W, then got that it is same as kind of greedy-algorithm result.

I guess, just stresstesting author's solution with O($$$2^n * m$$$) will do the trick. But they are to lazy to write dp for 10 minutes or to prove something. So I think

it should be heavily downvoted.How to calculate the optimal value with DP by $$$O(2n * m)$$$? I thought about it for five minutes and couldn't come up with it. I only came up with something like $$$O(2^{2n+α}×m)$$$ solution because we also need to think about "non-touching combination" and it will be like similar to $$$4×3$$$ tiles.

Also, implementation is difficult. It is inevitable that tester thought that brute-force is enough for testing (if did), contrasting to heavy-implementation DP. Since the complexity of brute-force is about $$$O(2^{nm}×nm)$$$, it is no wonder they missed the minimal hacking case of $$$n=6,m=6$$$.

Ok, all right, O($$$2^{2n} * m$$$). Ok, even brute-force is enough to find 6x6 test, isn't it?

I manage to find optimal answer of $$$n=6,m=6$$$, but it took more than $$$45$$$ seconds with pruning brute-force algorithm written in C++.

Here is the results of all possible testcase for $$$n \leq 6, m \leq 6$$$. The results are represented as the format H, W, the optimal answer, and the number of states in pruned DFS, in one line. My program took $$$67.535$$$ seconds to compute all of them.

Solutions1 1 0 2 1 2 1 4 1 3 1 7 1 4 1 13 1 5 2 24 1 6 2 44 2 1 1 4 2 2 1 11 2 3 2 27 2 4 2 76 2 5 3 201 2 6 3 537 3 1 1 7 3 2 2 27 3 3 2 99 3 4 3 413 3 5 4 1601 3 6 4 6349 4 1 1 13 4 2 2 76 4 3 3 413 4 4 4 2638 4 5 5 15460 4 6 5 92817 5 1 2 24 5 2 3 201 5 3 4 1601 5 4 5 15460 5 5 6 133118 5 6 7 1190848 6 1 2 44 6 2 3 537 6 3 4 6349 6 4 5 92817 6 5 7 1190848 6 6 8 15985259

My pruning algorithm is that "decide if there's a tile, from increasing order of pair (x,y), and prune if $$$size \geq 3$$$ 8-connected components appeared.

I think my pruning algorithm is not perfect. But I at least can say that the situation difference between $$$(H,W)=(6,5)$$$ and $$$(6,6)$$$ is huge.

UPD: Seems like $$$H=6, W=6$$$ was not even a minimal hacking case. I made a mistake in my calculation, and the intended answer was correct. Seems like E869120 made a more efficient brute-force (refer to this comment). But even he could not find the hacking case. It means that efficient brute-force cannot even find challenge case.My brute force code

Sorry, I made a mistake in my calculation. $$$6×6$$$ is even correct. I thought that $$$7×7÷6=7.x$$$. What is the minimal hacking case, though?

$$$7∗7/6=8.16666666666667$$$

Finally we managed to prove that the optimal answer will be exactly $$$⌊\frac{(H+1)(W+1)}{6}⌋$$$. The proof was rather difficult, but I liked it. It was a good example of IMO-like problem.

I even think that the problem can re-appear, because now there exists a correct solution.

That's not how IMO problems look like... Though I haven't proved it yet, this problem absolutely requires lots of casework and details, and that's not the spirit of IMO.

Also, this is a nice problem, but in my opinion, it is not suitable for CP contest since most people will just guess the answer without really proved it and the difficulty of the problem is mainly its proof.

I provide it in Chinese. https://codeforces.com/blog/entry/68048

And thanks to gryphon who translate it into English like this.

how to solve B using dp?

You are right that this problem is not well-prepared. We could fix it. However, I absolutely do not agree that we were lazy. We spent a lot of time preparing this round. We fucked up, that is true. The main reason of this is me, because as a CF employee, I had to check everything. When we started to prepare the main contest, we did not want to hold a mirror. But in a week before the round, KAN told me that there is a need of a CF round at the end of this month. I recalled that we were organizing a contest at that period of time. Therefore, I decided to let people solve those problems too. Why do you think we do it? Why did we prepare round? Money? Shit no, if I wanted to earn money, I would prepare problem for Codechef, as many of my friends do. If we wanted to earn money from this round, we would give these problems to Codechef and earn much more. Instead of this, we decided to satisfy the need of CF users of a round. If you want to blame us because of it, go ahead, downvote the post (I am sure you did it), say that arsijo fucked up.

But this round didn't even have testers

We had cross-testing. Authors of some problems tested other problems.

Well, then at least 1 tester of 5 should have written stress.

So you didn't prepare very well.

everyone makes mistakes, it is fine, ignore the haters

Lol, that is, if you are criticized, then they are wrong?

Nobody said you're doing it for money so I don't see a point in bringing it up. Especially in a comment that you linked in the announcement blog.

So that more greedy coders start writing codechef problems instead of cf rounds :)

I would start with the basic issue: that problem was completely inappropriate as div2 B. Perhaps if it was valued correctly, it would have been tested and proofed better...

IMHO this type of problems should be forbidden in contests at all...

Meanwhile codechef:

Why the fuck are you dragging us into this:D

Codechef: Okay, okay we know we do fuck up every time, but this time it's not us B-)

I just want to say you are really a great man, and selfless. Good luck and look forward to your next contest!

You are absolutely right! But why don't you just stop creating problems? :)

So, will you publish editorial of this round ?

So basically you are saying that it is OK to make problems with incorrect authors solution as long as it is some local contest or Codechef round?

LoL.

When we start system testing ?

arsijo rest are fine but u shouldn't dragged money and codechef in between. No sense of making these points here.

you should really improve your problem quality, first your problem c of your previous round and now this.

&& last thing codechef doesn't pay money to anyone who just come up with a random bad problem and puts it in contest without testing or juding its difficulty. .codechef problem authors get money bro...

hello, I am saying, the way he is saying that if I want money I would have set problems for codechef, i said with these quality of problems and testing codechef will remove you after one contest. I know more than u.

what was wrong with the C problem in last arsijo`s contest?

Can you just run the system test？ I want to try other problems in the problemset.

Efforts can't win respect without taking responsibility.

arsijo fucked up.

upvoted btw*

Who doesn't shoot — will never miss.)

P.S. Ok, maybe, someone didn't understand me. I don't think anything bad about authors of the round. It was a proverb and means "Everyone who does something sometimes makes mistakes" and it NOT BAD. It is a part of process.

Peace.

How to prove that the solution of problem B is (n+1)*(m+1)/6?

Thank you very much! The problems are really interesting

What is

`a lot of time`

by the way? 10 hours?arsijo fucked up.

I completely disagree with this statement. A setter shouldn't try to solve a problem in 5 minutes and then call it a day. It isn't the only job of testers to get AC either.

That being said, I don't like all the

"stop creating problems"comments. To all setters: just make sure you write brute force solutions, you write down proofs, and that somebody will carefully read those proofs.I wholeheartedly agree. I think that with just a little bit of extra testing, the quality of CF rounds in general will increase.

In problem B, the result for "6 6" should be "7" and for "8 8" it should be "13". I guess it's the problem for the solution and the point for my "Wrong answer on pretest 3" * 4 and "unsuccessful hacking attempt" * 2.

For 6x6, the answer would be 8

Well, my fault...So can this problem be solved in O(1) time?

It might be

( n + 1 ) * ( m + 1 ) / 6

YesFirst, if we extend 1x2 pieces to 2x3 (by adding a row to the bottom and column to the right), 2x1 to 3x2, and the board to (n+1)x(m+1), then we now only care about actual overlaps. This gives an upperbound of $$$\frac{(n+1)(m+1)}{6}$$$.

Let's see how it's always possible to achieve the upperbound (from now we consider n and m as increased by 1):

If we can always leave less than 6 free cells then we achieved the upperbound. Also notice that now $$$n, m \ge 2$$$.

First, observe that whenever $$$6|nm$$$, we can cover the whole board. It can be seen easily for small $$$n$$$ (upto 7), and for larger $$$n$$$ we can always break the board into pieces with small $$$n$$$ and areas divisible by 6.

This means that from a big board we can always remove pieces with height and width bigger than 1, and area divisible by 6. It only remains to leave less than 6 free cells when $$$n, m \le 7$$$ (if one of them is at least 8 we can remove 6 and obtain the subproblem).

Looks right, but I could not prove the very first claim myself and then gave up. How to prove that if there is a correct placement of the 1x2 and 2x1 pieces, then the extended 2x3 and 3x2 pieces do not overlap?

Consider most high right point these usual pieces touch. If it belongs to both pieces, they overlap. Now it belongs to one "hightest" piece. They overlap iff extended highest overlaps other one's highest rightmost point. It cannot overlap other one's extended side (the one we added, imaginary)

Thanks! Still can't say I completely understood it but I got the idea.

if extended higher upper piece touches other usual piece, then both extended pieces collide.

If it does not touch other usual piece, it does not touch its extension: (Same as if extended touch, usual pieces touch) If extension covers usual piece, then both usual pieces touch trivial. If both extended areas touch, then: a) Going higher on piece 2 collision (that is lower or right-er) from that point, we get to usual piece from piece 2, that piece also collides with extended 1, trivial case above. It cant go higher because piece 2 is lower. Also, all higher pieces collide and if there are no usual pieces 2 on that path, we can still use that fact. Let's take highest such point b) We get some other extended collision piece. By same argument, we can go left and find usual piece from 2 that collides with extended 1. This time, we know that going left once will get us to usual piece 2 (there is only 1 point with the property for both types of extended pieces). This time, this piece may not even touch extended 1, but be in lower left corner of it. So it touches usual 1 by our rules anyways (this one is extra case, others are trivial).

Extended = piece with border. Extension = border (down and right) usual piece = original one, without extension

Thank you for the detailed explanation

This is the 7x7 case: (in case anyone was wondering)

7x7What does that state mean? I can't find the purpose of that state because the answer of input 7 7 is 10; like this:

and other solution also exists.

In fact we say "7 7" means H+1=7 and W+1=7. So you should use "6 6" as input.

It was in response to Noam527's comment. I think saying n=7 m=7 would be better. It's for a 6x6 grid

From that convert 2x3 blocks into 1x2 blocks and 3x2 to 2x1

OK. I see.

This has to be solved in O(1) time.

me the same. my solution is (m+1)(n+1)/6 but "Wrong answer on pretest 3". I dont know why :((

Because the data of the problem was wrong

but there're still many people AC that problem

Delayed 15 min and turned out to be unrated. What a good round!!!

Something was fishy about this round from the start.

From the announcement. You could see arsijo as author

i still remeber his previous round problem c. such worst problems. he says he doesn't do it for money, actually he does everything for money.

It's ok to complain about the contest, and downvote the blog, because he made a big mistake.

But I don't see any reason to make personal attacks. If you can't find a way to give constructive feedback, just shut up.

A problem in EGMO contest 2019 is just a special case of

Problem Btoday (they just ask to find the maximum with table of size 2n x 2n):https://artofproblemsolving.com/community/c6t520112f6h1818715_yet_another_domino_problem

Nope. Those dominoes have to be 2 blocks away not 1. This problem is more similar to Croatian nationals 2019 where I would have won gold if I didn't misread a problem. (The problem is #3 on page 3, use google translate)

What a shitty contest.Problem A kindergarten problem.Problem B is shit. Problem D is easier than B. Don't know who is testing these rounds.

Agree problem B was shit. And A was very tough :(

I agree with you, but please respect the authors. Preparing a round is difficult.

I also agree that B in this game is very bad.

What the f**k?

I had a great score in this round and I can be a candidate master then it is unrated?

I thank the authers very mucn and I know preparing a round is difficult. But I still think this is a little sad.

Hope everyone can have a great score next time ans hope myself can be a candidate master. :(

Today, somehow I managed to do the problem D and the contest got unrated. karma is a bitch!!

Come on. Keep training. Hope you can get a gratifying score in the next round. (And hope there isn't any grammar mistake in those sentences)

A perfect contest becomes bad because of problem. I feel upset.

How was the contest perfect in the first place?

I am very very disappointed in codeforces. I woke up at 3:30 AM just to do this contest. I was actually pretty happy when I saw the problems because I knew how to solve them and I was predicted to get quite a bit of positive delta. But all of a sudden announcing that the round is unrated because the problem writers for some reason can't make good problems is quite discouraging. Imagine how many times I would have wanted round to be unrated in order to not lose rating. Maybe this should be a wake up call for all those creating contest: From weak pretests, to weak solutions, to weak language. All this can be avoided by testing thoroughly and thoughtfully.

boo hoo cry kiddo hahahahah

Hey I am not a kid! I am almost 4 years old!

Weird difficulty distribution.

For me it is just like A < C < D < F < both B and E

What thE HeLL???

Dude, I had to use SCAN to pass F, wtff ????

My dumbest greedy algo' passed the pretests while I can prove it is neither right nor wrong lmaooooo

And then failed on test 31 XD

finally passed pretest of F have almost +200 on predictor, excited to become candidate master. And the next second it became unrated.....so upset.

real shit contest ! hard B(even writer and many unofficial participant don't have solution). fucking implementation D and E with Case handling !

please when you are writing problems be in participants shoes and don't write shitty problems !!!

What's wrong with shitty problems? Do you ask for nice problems in your real life too?

How does it feel when 6 authors + testers + coordinators can't properly solve 7th grade math?

Moreover, there are 2 gold IOI medalists and 3 IMO medalists among them

Why is it so hard to make good problems? I am genuinely curious.

By the way, it was because of the problem B that I moved to D and could solve it. So, thanks anyway.

UNRATED

That's the result when you forgot to thank MikeMirzayanov for codeforces and polygon platform. :)

I LMAO at this and I don't know why.

it is the K A R M A T R I G G E R E D

(nope

The problem setter of B should stop making questions. At last it became unrated. This was my debut round for becoming specialist XD. Someone wants to see me in green.

OK,I can solve these problems for fun.But in fact it waste my time.But I won't decrease my rating.

It's a lucky and unlucky day.

Can someone give me counterexample to (a+1)*(b+1)/6 in B?

As someone already pointed out, 6x6 can have upto 8 dominoes placed.

7*7/6=8

Ah, my bad. Consider 5x5 then — we expect 5*5/6 = 25/6 = 4 as the answer, but you can get 5.

Edit: Oops, I'll just let someone else answer this before I make more blunders now :(

In 5x5 you can even have 6, and 6*6/6=6 .

for a 5x5 tile, the answer is 6*6/6 = 36/6 = 6