Всем привет!
Рейтинговый Codeforces Round #571 (Div. 2) будет в 28.06.2019 11:20 (Московское время). Этот контест основан на Летнем Кубке Кременчуга по программированию 2019.
Контест подготовлен Dalgerok, Karasick, stanislav.bezkorovainyi, antontrygubO_o, danya.smelskiy и мной.
У вас будет 2 часа 15 минут на решение 6 задач.
Удачи!
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 loved the Product oriented recurrence(E) question too much from your last contest.
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 .
Karasick vs karasek
You forgot to thank MikeMirzayanov for codeforces and polygon platform.
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 nomapunk will get red instead of yellow. Happy Birthday nomapunk.
Its an Indian Acronym for G**** pe laat, literally meaning kicks on the ass
Happy birthday in advance!
Btw, MikeMirzayanov, ban him. This guy is clearly using multiple accounts:
https://codeforces.net/profile/nomapunk
https://codeforces.net/profile/47th-Draganov
https://codeforces.net/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 Codforces
Im curious over how you deducted that this person has multiple accounts.
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
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!
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?
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.net/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.net/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.
Delayed!??
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. :)
Разбалловка будет?
я теперь на зачёт по чмам не успею((
Очень тебя жаль
Ты все еще можешь закрыться за 1:30 :)
Вот и успеешь, кек.
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 !!! :\
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 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.
the contest is unrated now :(
Iron Han Han
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 :-)
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.
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. :(
Поясните зачем вообще давать такую задачу как В? Нормальный же контест был, неужели так хотелось дать задачу на "99% участников не будут ничего доказывать, просто напишут разной степени тупости формулы". Это просто смешно.
К слову, E — норм.
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
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 ?
Вот что бывает, когда забываешь поблагодарить MikeMirzayanov за платформы codeforces и polygon.
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 inside
Completely 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.
"основан на Летнем Кубке Кременчуга по программированию 2019"
И как теперь вы поступите с кубком? Он будет кому-нибудь отдан или нет? - А вообще очень жаль, что раунд нерейтинговый. Я так радовался, когда прошла задача D...
Ну по сути тут авторское решение неправильное. А значит на кубок никак не влияет.
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
Unrated at last :( . This round was my debut round for becoming specialist.
Is this round unrated now?
sad to say 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.
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.
1 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.net/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?
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...
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.
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
First, 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)
What 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
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
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.
At last unrated. I was going to become specialist in this round.
A problem in EGMO contest 2019 is just a special case of Problem B today (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!
antontrygubO_o ну и кто из всех этих золотых медалистов IOI проглядел идиотскую задачу? :)
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.
Мы против анрейт раундов
The problem setter of B should stop making questions.
UNRATED
That's the result when you forgot to thank MikeMirzayanov for codeforces and polygon platform. :)
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.
Вы рофлите ??? Почему нельзя просто сказать , что этой задачи нет ????? Те люди которые не могут ее решить должны были решать другие задачи , а те кто ее решил, сделали это очень быстро... Из за оплошности авторов я просидел 1 час пиная мертвый раунд.... Вы думаете я задачи просто так решаю ???? Самое главное в раундах это получение РЕЙТИНГА пусть и не всегда положительного (ИМХО). Поэтому, я ставлю минус данному раунду .
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 .
6x5? I think answer is 6.
(n+1)*(m+1)/2 gives 7.
**.*.*
...*.*
**....
...*.*
**.*.*
5x6 is 7.
this is one possible way to reach that
I think the input
4 10
does not work. The answer is supposed to be8
but the formula gives(5 * 11) / 6 = 55 / 6 = 9
. Here are some possible arrangements of8
tiles in a4 * 10
matrix:I cannot find any arrangement for
9
tiles.The problem statement of B was very unclear. Did C and D and later found that the round was unrated. Many contestants like me are very excited whenever we see a new contest on the contest page and are equally disappointed when the round becomes unrated due to such reasons.
waste time for this contest, 1 min to solve A and 1 hour can't solve shit problem B. And when it remove, i spend 5 min to solve D -_-
That's why I always read B, C, D after solving A. You never know, maybe D is easier than B XD
Why "this round be the UNRATED"? Other problems are perfect. :(
Because many people waste too much time in B,I think
Maybe you are right. Ah.Today is really unlucky.
I stuck with B because my solution is right
On B,My Solution is wrong.
i submitted (n+1)*(m+1)/6 but "Wrong answer on pretest 3". Are you the same ?
I submitted ((n+2)*(m+2)-12)/8+1. I think my solution is wrong.
Last time, one similar contest also became unrated just because the problem A had a small mistake on a special situation. And the mistake was discovered and fixed in less than 15 minutes. But the round still became unrated.
So any mistake which may influence the contestants' score and rating changes is not allowed to be found in a rated Codeforces round. That's the rigorousness of Codeforces.
By the way, if you exactly participate a round like this and you lose the high rating delta, looking forward to next round and try to keep a good mood.
Hope everybody get a good score in the next round.(And hope there isn't any grammar mistake in those sentences)
I think you are right.
Do you say Educational Codeforces Round #64?
Yes. I found it, thanks.
Blacklist all problem setters.. :'/
Серьезно, профукать час с лишним времени на решение раунда, чтобы апнуть кандидата, а он оказался не рейтинговым из-за какой-то там B. Бесит. А так раунд более менее норм
UPD: А еще раунд в 11 часов. Просто а
My mood right now after knows the contest is unrated
Who is here after the round being unrated and before the end of the contest?
The problem maker is cxk
I like contests. We should not forbid the problem setters from setting problems. Without their effort, there will be no contests. Just prepare problems with caution and be aware that thousands of people will suffer because of careless.
I was so happy for a while...
How beautiful the Problem B is!
just like 蔡徐坤
The first time I encountered such a question, no matter how I denied it.
Caixvkun?
Basketball!
Chick problem! You are so beautiful!
Even though the round is unrated, I liked C and D. nice problems!
Since the round is unrated, can anyone give some hints on F?
for each edge if removing this edge does not decrease degree of connected vertices below their allowed minima then remove it. Passed the pretests hope it will pass systests.
I think pretests of F may be weak — I randomized the order in which I check edges, and then greedily take them until I get a workable configuration — others have pointed out just simple greedy also gives pretest passed.
How to solve D?
You can floor all numbers, then add +1 for each one (except integers) while sum of array is less than 0. Too easy for problem D I think.
I think it's easier than B(which needs lots of thinking).
It proves that the task may need more people to check, and tell the reasons. :(
this will be a greater lesson to the problem setters of codeforces :P
Sure :D
It already happened in Contest #373
But that contest was RATED yet.
It proves that problemsetters need thank MikeMirzayanov in the announcement.(Well that's the truth)
Who will win : Div2B or 2 gold IOI medalists and 3 IMO medalists
Sorry, I can't find problem B(
am I the only one who didn't even understand B ?.. I don't get it how they do touch and don't
What was wrong with F?
Plz. say that F is also wrong...!!!
That will make the setters learn something unique today... lol
No, there is a correct approach, but I'm afraid about the strength of the testcases. Most solutions should fail if they are strong enough, for example, the solution of the current winner (pekempey) fails on this test:
18 114
1 3
1 5
1 8
1 9
1 10
1 11
1 12
1 13
1 14
1 16
1 17
1 18
2 3
2 4
2 5
2 6
2 7
2 10
2 12
2 13
2 14
2 15
2 18
3 4
3 5
3 6
3 7
3 8
3 9
3 12
3 13
3 14
3 15
3 16
3 17
3 18
4 7
4 10
4 12
4 13
4 14
4 15
4 16
4 17
4 18
5 7
5 8
5 10
5 12
5 13
5 14
5 15
5 16
5 18
6 7
6 8
6 9
6 10
6 11
6 12
6 13
6 14
6 15
6 16
6 17
6 18
7 8
7 9
7 10
7 11
7 12
7 13
7 14
7 15
7 16
7 17
8 12
8 13
8 14
8 15
8 16
8 17
8 18
9 12
9 14
9 15
9 16
9 17
9 18
10 11
10 12
10 13
10 15
10 16
10 17
10 18
11 13
11 14
11 15
11 16
11 17
11 18
12 13
12 14
12 15
12 17
12 18
13 17
13 18
14 15
14 17
15 16
16 17
17 18
My greedy 56221717 passed that test, but i think that maybe my solution should be wrong.
I dont know, but I had to use SCAN to read input and printf to output. Otherwise I would recieve TLE in test case 10. Probably my solution is wrong.
not always, since reading $$$2*10^6$$$ integers does take tons of time
however my greedy failed on this test XD
Спасибо что отсортировали задачи по уровню сложности!1!!1
This is now a curse to those who don't thanks to MikeMirzayanov and to Polygon. If you don't, your contest will be unrated!
How to solve problem c?
solve it using windows sliding technique in O(N)
Set ans = 0. First, count the sum of 1s in string b and the first |b| letters of string a. If the difference of them is even, add 1 to ans. Then consider shifting string b to the right and change the second sum, add 1 to ans when the difference is even.
That seems like a great solution, I would have never thought about that because in my head, summing up when I need to compare leads to WA, but I guess not in this task.
It's right in this one because a different digit makes a contribution of 1 or -1 to the difference of two sums.
I wonder how my brute force solution for F passes the pretests?
In what case is the answer in B not $$$\left\lfloor(w+1) (h+1) / 6\right\rfloor$$$?
This is at least an upper bound, since the problem is equivalent to tiling a $$$(w+1) \times (h+1)$$$ array with $$$2 \times 3$$$ pieces. To do this, place a $$$2 \times 1$$$ domino to the upper-left corner of every $$$3 \times 2$$$ domino, and a $$$1 \times 2$$$ domino to the upper left corner of every $$$2 \times 3$$$ domino.
Edit: I managed to prove that this can always be achieved
Let's solve when tiling with $$$2 \times 3$$$ pieces. Assume first that width is divisible by 6, and height is at least 2. Then we can tile optimally, since $$$2=2, 3=3, 4=2+2, 5=2+3, 6=3+3$$$ and so on.
Using this, divide the rectangle into four parts, s.t. one part has height divisible by 6, one has width divisible by 6, one has both width and height divisible by 6, and the last one is a rectangle with width and height at least 2 and at most 7.
We can perfectly fill the other three parts, and it only remains that we can always fill a rectangle with these dimensions s.t. at most $$$wh \text{ mod } 6$$$ spots remain unused. If we can achieve this, our solution is clearly optimal, since every piece takes exactly 6 spots, and we have $$$w \cdot h $$$ spots. This is equivalent to placing $$$\left\lfloor wh/6 \right\rfloor$$$ pieces into the rectangle. Now assume width and height are the dimensions of the final rectangle-part.
If width is divisible by $$$2$$$ and height is divisible by $$$3$$$ or the other way around, we can trivially tile perfectly. If either width or height is divisible by $$$6$$$, we can tile perfectly.
If both width and height are divisible by $$$2$$$, the shape of the rectangle is $$$2 \times 2$$$, $$$2 \times 4$$$ or $$$4 \times 4$$$. We can place 0, 1 and 2 pieces to these respectively, satisfying the requirement.
If width is even, then height has to be $$$5$$$ or $$$7$$$, and the shape of the rectangle is $$$2 \times 5$$$, $$$4 \times 5$$$, $$$2 \times 7$$$ or $$$4 \times 7$$$. We can place 1, 3, 2, 4 pieces to these respectively, satisfying the requirement.
If width is $$$3$$$ and height is $$$3$$$, $$$5$$$ or $$$7$$$, we can place 1, 2 and 3 pieces respectively, satisfying the requirement.
The only remaining cases are $$$5 \times 5$$$, $$$5 \times 7$$$ and $$$7 \times 7$$$. In $$$5 \times 5$$$, place the pieces in a windmill-shape to get 4 pieces into it, satisfying the requirement. In $$$5 \times 7$$$, Place two $$$2 \times 3$$$ pieces and three $$$3 \times 2$$$ pieces, satisfying the requirement. In $$$7 \times 7$$$, do the same windmill-shape, using $$$4 \times 3$$$ pieces built from two $$$2 \times 3$$$ pieces. We place 8 pieces, again satisfying the requirement, and all cases have been handled, completing the proof.
Therefore the answer to the original problem is always $$$\left\lfloor(w+1)(h+1) / 6\right\rfloor$$$.
There is no such cases.
For $$$n>1$$$ you can tile $$$6\times n$$$ rectangle by $$$3\times 2$$$ pieces. So it's sufficient that formula holds for rectangles when $$$w,h \leq 6$$$.
can any one explain C ?
First observe that if two binary strings are same at an index, then the sum of the bits is even and if different, sum is odd. So, the total of such sums of bits will be $$$Sum= (No. \, of \, vertices \, at \, which \, bits \, are \, equal)*(Even)+(No. \, of \, vertices \, with \, different \, bits)*(1)$$$ So the criteria for even number of different bits reduces to the sum being even.This can be done in $$$ O(n) $$$ by storing the sum of |b| bits of a and iterating through the remaining bits of a.
Is F really easy or does the greedy not work?
for each edge if removing this edge does not decrease degree of connected vertices below their allowed minima then remove it. Passed the pretests hope it will pass systests.
That's what I'm asking. I also passed pretests but this seems way too easy for an F.
Greedy solution fails. https://codeforces.net/blog/entry/67968?#comment-522844
What is system testing after the contest?
Credits to Rudy1444 for outstanding memes
Here, I don't know why people are angry because this round goes unrated. I am very thankful to the problem setter that I am able to read all the question this time. Otherwise, I got stuck in the 2nd problem.
in F: greedy will always work or we should use DFS + eulerian tour ?
[ [ DELETED ] ]
Chill, if you're red it doesn't mean you have to win every time, so stop complaining to grab contribution. We know B is bad, but if a green complained about it he would've gotten -40 or smth.
Also, you could've focused on harder tasks, since they're obvious close to your level.
[ [ DELETED ] ]
Since there is only a month before IOI, you should weight more in practice with more difficult problems. Not like some shitty Div2 rounds. Or are you actually a blue coder??
[ [ DELETED ] ]
Then you solved Div.2 F this time and learned a lot. What's the problem?
[ [ DELETED ] ]
...why didn't you open E and F first then? Performance and rank are absolutely irrelevant when you're participating in Div2 rounds.
EnumerativeCombinatorics LOloLolOlOollloL. why are you giving others suggestions. I think you yourself didn't get any precious thing from your IOI
"...why didn't you open E and F first then" HAHHAHAH.. why don't you do the same in atcoder grand contest problems. Like ksun, tourist and petr does.
"As a tutor, I am really disappointed with your stance towards OI." LoLOLOl you r a tutor. actually you yourself need a tutor. you can't touch 2600 in these 10yrs of your codeforces and behaving like tourist. LOLolOLol.
And finally, KSUN48
Who hurt you?
You keep messaging me just saying ksun48. Do you love me or ksun48?
These LTDT clones are nowhere near as good as the original
Complete waste of time is reading your crying.
Why are you and square1001 always like this?
No one judges how Div1 people do in Div2 rounds. This is nothing like IOI, and no one doubts you're good
[ [ DELETED ] ]
Okay, I can see why you personally care about Div2 rounds, but maybe read back the post before you send it.
What to you reads as an honest message about 'failure' reads just like matthew99 or geniucos' whining posts after their 'failure's in the IOI — really annoying to most people on CF (in particular, all the Div2 people in this round) who would be lucky to have as good a contest in a year of programming.
Note: I say 'failure' because I do not judge either of the cases mentioned as failure
I'm not an IOI participant this year so I can't say anything, but caring much about "not failing in contest" is a very good concept, because we can't miss gold or some medal. Gold medal probability 80% is better than that of 70%.
So, if we fail even in Div.2 contest, we tend to search why did it fail and we believe that excavation of them may yield mountain of treasures for improvement. Suppose that I solved Div.2 F in 30 minutes but some reds are solving in 25 minutes — we think about what was different between the fastest players, and what was wrong in my thinking, implementation, debugging, or something else, and then think about improvement to decrease the probability to fail in the same way in future.
However, for this time, he claims that the writer was the cause to fail. I wonder what improvement we can find.
UPD: He mentioned in his comment that we should not forget that Div.2 has also many interesting problems, and it is also same as my thought.
Isn't it why you failed to get in the Japanese national team that you always care about "why can't I solve this (Div 2) problem in 30 minutes" rather than "why can't I solve this (OI problem some golds can solve) problem in 2.5 hours"?
You two gotta understand the priority. Why are you always practicing short-term contests and failing (or at least struggling) at training camps for years? As a tutor, I am really disappointed with your stance towards OI.
[ [ DELETED ] ]
I would be very surprised if someone has never gone far lower than their expectations. Ideally, when you fail you need to look for reasons behind the failure, so you could focus on improving said points. On the other hand, taking part in a contest means you need to accept the possibility of failure. I'm not saying you shouldn't care about failing, but rather if you accept it, you can forget about that fear, possibly even perform better, and not take it hard when it happens.
To me it seems that E869120 is devastated about the wrong things. "I spent 91 out of 135 minutes for problem B, and because of this issue, my round result became historic and rare failure. [begin complaint paragraph]" — Okay, you can point out the bad time management, but how about you focus on "next time I can prepare myself for such events and manage time better", instead of ranting about this specific performence? You're worrying too much about things that, frankly, are not under your control;
Maybe having a good day to you is affected by how well you slept the night before, but it's useless to consider it during or after a contest, so what good is it to focus on such things? You need to be aware that it can always happen and move on.
In my opinion you should resolve this mentality before the IOI. If you're driven insane by accidents on CF div2 rounds, I can't imagine how you could feel if you don't meet your exact expectations on IOI.
Could you please loose the time limit of Problem D to 2 seconds? I am python user. Usually the system suggests us to submit through PyPy for faster judgement. But this time PyPy is slower than Python 3.
Mike Meanwhile
SyTest please :)
Now ,why don't admin ban account of this blog's author as they did mine(for 48hours) just ,for asking my doubt. People usually dislike new members due to there low rating. So my negative contribution doesn't mean i am posting bad stuff ... I received a message from SYSTEM named id 3-4 days ago and my id was banned****..
If you posted public blog during contest, then it's rules violation and it's correct if you has been banned after that.
If you have some doubts about correct testing then you should ask your question to jury.
the blog goes negative because of the toxic community the author of this blog did nothing wrong
I see the one who posts the blog as the someone who is responsible for any issues related to the problems. If you are not welling to be responsible in case anything went wrong with one of the problems, simply don't be the one who posts the blog.
Ofc, he shouldn't get downvotes because of problems like server-issues, power outage, or any problems that happens in the round but not related to the setters.
Can somebody share the results of an on-site competition?
What kinds of wrong solutions did people submit to $$$B$$$?
Something like initially fill row with all horizontal tiles then with vertical tiles doing this alternately.Do this for both cases n*m and m*n and output the maximum
If this was the scenario for CF round what happened at the Kremenchuk Summer Programming Cup 2019.
Almost missed submission of my second problem by 5 second ,i was feeling very depressed and angry on myself.. But thank got round become unrated ...
change your profile pic please, this makes me vomit
You child hater , I don't think it's that bad . It's just a cute kid .... It is still better than nothing ,like your profile pic. I will post my real pic after reaching purple on cf.
Should I help you, please? Your profile pic is disturbing.
Yes ,not_working9 Please change your profile picture.
i changed ,how is this ??
By the way when the system testing starts?
can anyone tell me how to solve D.i tried to sum the decimal part of numbers with sign and distribute it among the numbers depending whether the sum is positive or negative?wt is wrong with it?please help.here's the link-https://ide.geeksforgeeks.org/vUNw9LErK6
Well u can just kepp the i terger value and take out the sum of all integer values. If sum is zero then thats the simple answer like testcase 1 and 2 else if its greater then zero than simpy decrease every negative number till sum is not zero and viceversa for if sum is less than zero. This is what is used to solve.
i did the same thing its saying wrong on testcase 7.i took the sum of decimal one.it should be same naa?if decimal sum is positive then integer sum will be negative as the sum should be 0 and vice versa
see my code
be careful about already integer number like 1.0000. I created an ignore list and didn't touch them.
can u give an example where my code is failing .itried on several testcases but it was correct.i tried complete integer an everything
Check this one:
bro the test case is wrong sum is not 0 for this
not important in this case, you can make the sum 0 by changing numbers in upper lower bounds. Edit: looks like it makes difference in your solution, I changed it and it gave correct answer: ~~~~~ 6 2.00001 -1.00000 -0.956778 0.456778 1.456776 -1.956786 ~~~~~
bro read the question it is given sum is 0
Can someone tell me if this is a valid solution for D? 1. Ceil() all the integers up and add them together. 2. Decrement the first "sum" integers by 1.
You can't do it in the case when the fractional part of a number is 0 like 2.00000
Good point. In that case, then keep track of all "fractional zero" valued indexes and skip those?
Yes
A hint; start by rounding down all the numbers and working out the sum.
Cant we do either round up or round down? It should be the same idea either way right?
Yes, would work just as well
Will there be any system testing for this round??
This is very annoying, I don't mind that round is not rated,but I hate "artificial" problems,that don't have proof.I was trying to solve B for 90 minutes,before clarification, I couldn't focus on D or C,because I hadn't solved B... I really got annoyed and wanted to stop studying CP...
First time ever I was able to solve 5/6 problems in Div 2 and my rating was going to increase about+174 and they declared it unrated so unfair.
Your solution for f is wrong don't be that angry. https://codeforces.net/blog/entry/67968?#comment-522844
Why is the contest still "Pending System Testing"? I want to be submit — If the contest is unrated what's the point of not allowing submissions during system tests?
or why they don't even start.
In my opinion, tasks in this round was really good, although they didn't swap C and D and difficulty of B is 9999+. Also they could swap F and E but I don't see any problem here. But contest is not only about tasks solving, so the contest.
Why is the system test still pending? Are you guys intentionally trying to make it the worst contest ever now?
When will the system test start?
Looking at the screen for system testing besides knowing it is unrated.
Before the contest started this blog had over 200 upvotes and now it has 300 downvotes. That means more than 500 people downvoted. People are more interested in downvoting when a contest is declared unrated than upvoting when they see a new contest
Since my randomized (in time) F finally passed with a good running time (888 ms), I wonder if F tests are just weak or if anyone can prove the correctness of randomized solution with a high probability?
Link to solution — https://codeforces.net/contest/1186/submission/56215781
I solved F using a randomized algorithm. 56216823
While I didn't find an answer, I shuffle the edge array and try to greedily remove edges if possible using the random order. It manage to get an AC. I am still confused why would that work. Does anyone got some idea for a proof?
I am waiting for the editorial for problem C.
what's the problem?
wtf testers, check your mum, why I get AC in F with shuffling edges?
+..
Great job with preparation...
Testset in F sucks, many solutions (including mine, but due to a bug, not to being a heuristic) should fail... And most of these which failed, failed on my test from hack... Unfortunately, I didn't have enough people in my room to make tests stronger...
Heuristic in B? Seriously? Prove solutions or stresstest them next time. I'm not telling that everything should be always prepared by 15 people with rating 3500+, but remember, that you show your own quality by preparing a round, so you should do your best, no matter what this "best" means... Here, authors definitely didn't :/
UPD: I totally forgot about it. After making an attempt to hack for the first time, I've received "Unexpected verdict" verdict. Can you explain, please? Was the main solution wrong in some way? If yes, what was the reason? Bug, or similar situation to B?
Can anyone explain wat was the problem with Problem B. My code was able to pass all pretest and I didn't also find any problem in problem statement. Can someone please elaborate!
Can you show here your code? I'm also curious about what was intended.
How will I get that code as they deleted Question B so my submission also went off with it. But here I will explain my logic m n are inputs Ans1 = ((m+1)/3)*((n+1)/2) If m%3==1 Ans1+=((n+1)/3) Ans2 = ((n+1)/3)*((m+1)/2) If n%3==1 Ans2+=((m+1)/3) Print max(ans1,ans2)
I thought that you still have it on your computer, sorry then.
Can you please explain what was wrong with the question!!!
I don't know what was wrong with the problem, but I know that your solution is wrong (still something).
For n=m=4 your solution outputs 3, doesn't it? It's possible to achieve 4.
Code that passed pretests for me (actual method only)
Basically greedily place vertical dominoes with a column gap in between them and repeat with a line gap and if possible place a horizontal row of dominos on the last row with a 1 space gap in between.
Thinking about it after its pretty obvious to create anti-cases but this is what they expected I guess. Really should have been tested better, since even inputs as small as
4 4
can fail it.For the case $$$n=4, m=4$$$ the answer is 4.
Many codes, including this one, prints 3.
I know its wrong, he asked for the code that passed pretests so I posted it, I even mentioned in my post that inputs as small as
4 4
failWhen I started to write the comment, your edit wasn't there.
I wrote but didn't send. After some time, I did, then saw you edit:)
Sorry.
No problem, should have realized something like that was the case, my bad.
I forecast that this contest will be unrated
so what can I say?
Hey, I have one strange question for problem D. Is it not ok that my solution doesn't submit because it prints -0 instead of 0, or i should remember this feature of C++ for the next time? Here is the code: https://codeforces.net/contest/1186/submission/56215735 (Please rejudge it if it was unexpected mistake)
I don't think that it's fair to say 0 and -0 are different. Even mine also, whole solution to D problem got failed on test case 16 just due to that 0 and -0 thing! Just corrected that and it got accepted. :-(
Same case happened with me too
Is there any way to solve problem B with (1<=n,m<=10^9)?
What is the intended solution for F? I gave the contest from my smurf and applied greedy from the start and from the end on the edges given. The solution passed, however I don't think it should have. Please rejudge if the solution is incorrect. Submission: https://codeforces.net/contest/1186/submission/56222396
can you please explain why did you go through all edges two times, first from 1 to m then in reverse order. Is'nt going through only one time enough?
Actually, I wrote code using same greedy approach but with only one loop and it failed on test case 31
my code
I initially submitted the solution by iterating only from forward and the solution passed the pretests. However, I realised that it is was such a naive approach yet a lot of submissions failed the pretests. That's when I realised that the solution undoubtedly depends on the order of the edges. So, I did this in an attempt to make a randomised approach so that odds of the solution passing would be higher. I did not expect it to work though.
How to solve problem B with (1<=n,m<=10^9)?
Here you can find why](https://codeforces.net/blog/entry/67968?#comment-522796)
Why is Problem C tagged fft? Does anyone have an fft solution for C?
Just think about $$$F_i=\sum{(A_{i+j}-B_j)^2}$$$,then if $$$F_i=0(mod\ 2)$$$,the answer adds 1
So you can reverse B and calculate F using fft
56201311
Apart from some questions being too easy and some being too weird, I am interested in question E.
The thing which I found during the contest was, ith block (0 indexed and in the same line ) will be same as first block if number of bits in its index is even. else it will be inverted. Then I will calculate all the complete blocks. (Also the Special case when they are odd). Now comes the question of handling incomplete corner row and column. How to do that ?
Ради таких задач как E и стоит жить.
How to solve F?
Is problem F really easier than E?
I tried to solve F after 45 minutes(before the surprising announcement). However, I didn't find a solution that I can prove in an hour! Then I gave up on it and turn to E, although only one-third people solved it compared with F... Do you know what happened then? I found a $$$q \cdot logn \cdot log{10^9}$$$ algorithm in just 5 minutes, but there wasn't enough time for me to implement it...
What's worse, after finishing the code five minutes after the end, system testing didn't start. As you know, I waited for a long time.
Then comes the questions:
- How to solve problem F? (All of my friends' solutions get FST qwq)
- Is there a faster algorithm for E?
(In fact, preferring 'first' rather than 'easiest' also happened on me in Codeforces Global Round 3)
About problem E, there is a solution with complexity $$$O(Q*log 10^9)$$$
Such an easy F problem, but i can't prove that greedy algorithm is working. Can anybody help? All i do is run through all edges and delete an edge if possible while the number of edges exceeds (n + m + 1) // 2. Very similar to Ford-Bellman algorithm.
Nowadays in every div2 contest- I see the B problem is greedy. What is the reason?
Sorry for the issues with the round 300 more times.
Intended solution for F was:
Create an imaginary node and connect it to all nodes which had an odd degree in the original graph with imaginary edges. Now, all degrees are even. Now find the Eulerian path. Added (imaginary) edges cut it into not more than $$$\frac{n}{2}$$$ chains. Now from each chain of length $$$k$$$ we will choose $$$\frac{k+1}{2}$$$ edges skipping each second if $$$k$$$ is odd and $$$\frac{k+2}{2}$$$ — first edge and then skip every second — if $$$k$$$ is even. It's easy to see that this way we will take not more than $$$\frac{m+n}{2}$$$ edges in total. Also, it's easy to see that the degree of each node will decrease not more than in $$$2$$$ times as in each chain we take at least $$$1$$$ edge from each node in that chain.
The more detailed solution will be posted in editorial soon (I hope).
Thank you!
Guys, why are you so angry at the authors of this round? I understand that you and I expected them to have a well-prepared set of problems so that we can enjoy solving them. They definitely failed in one problem and admitted it. However, why must the authors meet our expectations? We have not hired and paid them. Actually, the authors and CF team owns us nothing. I think we should always take this fact into account while complaining about anything here.
I'm sorry 。I accidentally ordered the bad review.
To be fair, authors are indeed paid for preparing rounds.
I think I have not paid them anything even though I donated money to Codeforces. But I agree that CF team who actually pays authors have rights to require the quality according to their agreement but not participants.
Thousands of participants also paid time to take part in the round, we spend more time on it than the problem setters (the sum of all participants). So, we should thank the problem setters if we enjoyed the round and got help from the problems. If we wasted our time (I admit that some of the problems are good, however, I think there are people struggled with problem B, doubt him/herself, and got accepted with the wrong solution, and thought it was right), if the round didn't "satisfy the need of CF users", we have no reason to thank them.
What's more, this is a CF round. In my eyes, Codeforcces rounds are a symbol of high-quality contests. If it is a round on CF, the problem setters should not only make efforts but also have to work carefully, take responsibility for the participants.
However, as arsijo said, "in a week before the round, KAN told me that there is a need of a CF round at the end of this month", the faults are not only on the problem setters. I also want to ask, why a CF round is needed at the end of this month when there are rounds 2 days before and 2 days after if the round is not well-prepared?
1186F - Vus the Cossack and a Graph accepted with a randomized solution (56231972). Any counter test or proof?
I have slept the round.
Please somebody send problem B preposition because i am curious and it is removed. Tnx
You are given a $$$n \times m$$$ size of rectangle and infinity number of $$$1 \times 2$$$ tiles. You have to fill the rectangle with as many tiles as possible, so that
You can rotate tiles. What is the maximum number of tiles you can place?
Constrains: $$$1 \leq n,m \leq 10^9$$$ (I guess; maybe smaller? I have a bad memory)
Example 1: $$$(n, m) = (3, 3)$$$, answer is $$$2$$$, in which case you can place the tiles as follows (different numbers indicates different tiles:)
I forgot the other example. Hope that helps
The other example was n=4 m=6 and answer 5. The constraints are right btw
Can anyone explain the solution for problem C. Please!!
same in two strings: even "1"s
different in two strings: odd "1"s
So you just need to maintain the xor value (number of "1"s modolo 2) of each character of $$$b$$$ and $$$a[i..i+|b|-1]$$$, and calculate the number of "1"s in the two strings modulo 2.
Can anyone tells me what is wrong with this solution ? 56211719
Some problem in your string/double processing. This is your (modified) code: #.
I don't get it, why using strings is wrong ? or where is the bug in my code
Can the authors correct their decision on problem B and add it to the archive? I would like to solve it in good condition.
In problem D I first converted all the elements to their floor values. I initialised a variable "dif" that will store the sum of (a[i] — floor(a[i])) for every i. Now dif needs to be added to the elements. So I iterated again and if the element was earlier a float value and dif is greater than 0 I added 1 to this element and decreased dif by one. I am using a boolean array "can" to check if the element was earlier a float value or not. Why is this approach wrong 56231283
I believe that it is floating point roundoff error.
How do I handle that? I got WA in python too
Your method is correct except for the floating point error. To fix that, instead of dif > 0, you should use dif > (some epsilon value that works). You could try dif > 0.5 since dif should be equal to an integer when there is no roundoff error after the first for loop.
Double is stored in binary format, hence adding exact decimals may not be 100% reliable. For example, in double, 0.2+0.1 != 0.3 (which is counterintuitive). In this case, your final result after addition could have been 1.001, in which a[i]++ would have been done for 2 different i when the intended number of times is 1.
Alternatively, in Python, you can simply use the Decimal module. The result is exact since everything is worked out in decimal.
Is there someone explain to me how to solve E?
Anyone help me why my code fails on 7 pretest for problem D.
Thankyou.
(-5)+(-9)+10+1+2+0=(-1)
read your answer carefully
arsijo In problem C, if it's required to print $$$f(b,c)$$$ [the number of mismatches] for each substring $$$c$$$ of $$$a$$$, is there an efficient way ?
Yes, it's an easy FFT exercise
Why vote down? This can happen to anyone. Better vote up for the effort made by each setter
Не понимаю людей, что минусуют. В любом случае, ребята старались, спасибо им, и задачи оригинальные.
How to do C? What is the intuition?
Read this: https://codeforces.net/blog/entry/67968?#comment-523140
can any one explain what fft means . problem c has ftt tag .
not ftt but FFT
but how is it related to the question ?
This problem can be solved using FFT as described here
How to solve E?
Problem B Page: It is deleted already. Oh, the picture is rather blurred...
how to solve problem B,if the domino can touch each other?can you give me a practice link?thanks~
In that case the answer is [n×m/2].
sorry, that problem seems to stupid.... what if the area is NxM,and the domino is nxm,how to solve this problem?is there any practice link about this? 3q
Domino is a rectangle formed by two unit squares sharing a side. So it's dimension is always 2*1 or 1*2.
I thinl it is easy to provide that the ans of problemB is ⌊(H+1)*(W+1)/6⌋,but my english is pool. So i can only provide it in chinese.I'm sorry for my pool english. 问题等价于在(H+1)*(W+1)的格子中放2*3的砖的最大个数,砖块间不能重叠但是可以接触。 (1)当1<X,Y<=7时,在X*Y的格子中放2*3的砖的最大个数为⌊X*Y/6⌋。这个可以用暴力或其他方式求证。 (2)当Y>1时,在6*Y的格子可以放满砖块,因为6*2和6*3的格子都可以放满砖块,而Y>1时Y一定可以由2和3组合而成。 (3)由(2)可以得到推论:当X是6的倍数且Y>1时,X*Y的格子可以放满砖块。 (4)考虑1<X<6且Y>6的情况:如果Y%6>1那么我们将Y表示为6*a+d,根据(3)可知X*(6*a)的格子可以放满砖块,而X*d的部分的答案根据(1)可知为⌊X*d/6⌋,所以整体的答案满足⌊X*Y/6⌋;如果Y%6=1那么我们将Y表示为6*a+7,根据(3)可知X*(6*a)的格子可以放满砖块,而X*7的部分的答案根据(1)可知为⌊X*7/6⌋,所以整体的答案满足⌊X*Y/6⌋。 (5)考虑X>6且Y>6的情况:如果X%6>1且Y%6>1那么我们将X表示为6*a+c,将Y表示为6*b+d,把X*Y分解为四个部分:(6*a)*(6*b)、(6*a)*d、c*(6*b)和c*d,前三个部分由(3)可知可以填满砖块,c*d的部分满足1<c,d<6所以根据(1)可知答案为⌊c*d/6⌋,所以整体的答案满足⌊X*Y/6⌋;如果X%6==1或Y%6==1,不失一般性地设x%6==1,那么我们将X表示为6*a+7,将Y表示为6*b+6+d,把X*Y分解为四个部分:(6*a)*(6*b)、(6*a)*(6+d)、7*(6*b)和7*(6+d),前三个部分由(3)可知可以填满砖块,7*(6+d)的部分分两种情况:如果d=1那么问题变为7*7能放多少砖块,可以通过(1)解决;否则将7*(6+d)分为7*6和7*d两个部分,前者可以用(2)解决,后者由于d>1可以用(1)解决,所以整体的答案满足⌊X*Y/6⌋。 Hope somebody can help me translate.Thanks!
Translation
The problem is equivalent to the maximum number of 2*3 bricks placed in the (H+1)*(W+1) grid. The bricks cannot overlap but can be touched.
(1) When 1 < X, Y <= 7, the maximum number of bricks placed 2*3 in the X*Y grid is ⌊X*Y/6⌋. This can be verified by violence or other means.
(2) When Y>1, the 6*Y grid can be filled with bricks, because 6*2 and 6*3 grids can be filled with bricks, and Y>1 must be 2 and 3 Combined.
(3) It can be inferred from (2): When X is a multiple of 6 and Y>1, the X*Y grid can be filled with bricks.
(4) Consider the case of 1<X<6 and Y>6: If Y%6>1 then we denote Y as 6*a+d. According to (3), the X*(6*a) grid can be placed. Full of bricks, and the answer of the X*d part is ⌊X*d/6⌋ according to (1), so the overall answer satisfies ⌊X*Y/6⌋; if Y%6=1 then we represent Y For 6*a+7, according to (3), the X*(6*a) grid can be filled with bricks, and the answer of the X*7 part is ⌊X*7/6⌋ according to (1), so The overall answer satisfies ⌊X*Y/6⌋.
(5) Consider X>6 and Y>6: If X%6>1 and Y%6>1 then we denote X as 6*a+c and Y as 6*b+d, put X Y is decomposed into four parts: (6*a)(6*b), (6*a)*d, c*(6*b) and c*d, the first three parts can be known by (3) Filling the bricks, the part of c*d satisfies 1<c, d<6, so according to (1), the answer is ⌊c*d/6⌋, so the overall answer satisfies ⌊X*Y/6⌋; if X% 6==1 or Y%6==1, without setting the general x%6==1, then we will represent X as 6*a+7 and Y as 6*b+6+d, X*Y is decomposed into four parts: (6*a)*(6*b), (6*a)*(6+d), 7*(6*b), and 7*(6+d), before The three parts can be filled with bricks by (3), and the parts of 7*(6+d) are divided into two cases: if d=1 then the problem becomes 7*7, how many bricks can be put, can pass (1) Solve; otherwise, 7*(6+d) is divided into two parts: 7*6 and 7*d. The former can be solved by (2), and the latter can be solved by (1) because d>1, so the overall answer is satisfied. ⌊X*Y/6⌋.
how to solve problem B,if the domino can touch each other?anyone who can give me a practice link ?thanks~
if dominos can touch each other, it's much easier, since you can basically fill the board completely, except for 0 or 1 square
thanks what if the domino is 2x3,or 3x4,and so on,arbitrary nxm,then how to solve it?
Ok, we apologised your mistakes about problem B, But 3 days had gone but there are no editorial about other problems. This is so sad....
you are wrong , editorial released a 2 days ago https://codeforces.net/blog/entry/68027
UNRATED
That's the result when you forgot to thank MikeMirzayanov for codeforces and polygon platform.
surpasses Codeforces Round #444 (Div.2)