Hello, Codeforces!
I'm very glad to invite you to the first Cuban round Codeforces Round 659 (Div. 1) and Codeforces Round 659 (Div. 2) which will take place on 24.07.2020 17:35 (Московское время).
All problems in this round were created and prepared by mnaeraxr, gilcu3, dcordb, jcg and me. We tried to make them interesting and diverse and hope that you will enjoy them!
You will be given 2 hours to solve 6 problems in both divisions, and we highly encourage you to read all of them :)
We would like to thank:
antontrygubO_o for amazing coordination of this round.
Um_nik, gamegame, ffao, eatmore, isaf27, balbit, Tlatoani, prabowo, Kuroni, hugopm, MagentaCobra, qlf9, faremy, golions for testing the problems and providing invaluable feedback.
MikeMirzayanov for providing Codeforces and Polygon platforms.
The score distribution will be announced shortly before the round (or earlier).
UPD: Here is the score distribution:
Div2: 500 — (500 + 750) — 1750 — 1750 — 2500 — 2500
Div1: 1000 — 1000 — 1750 — 1750 — 2000 — 2250
Good luck and have fun!
UPD: The editorial is ready Editorial
UPD: Congratulations to the winners!
Especially for tourist, Benq and Radewoosh who solved all the problems!!!
Div. 1:
Div. 2:
I hope for an interesting first cuban round :)
This round was not at all interesting.
It looks like someone forgot to mention that the contest was for Russian 5th to 8th graders. (No offence intended).
Anyways, this just makes it more exciting. Thanks for this round.
New round to avoid : Cuban Round
It became really interesting when I tried submitting the first problem and not to mention, when I started reading Problem B.
I became depressed after reading problem A & B also C
C was the real saviour
I was like A will never left me but today A left me.
Who is this Koa the Koala and why does she want to cross the shore?
Google's first result for "can koala swim?"
"Koalas drown in swimming pools when they are looking for water to drink. Although koalas can swim, if there are no assisted ways for a koala to climb out they will eventually drown."
did someone forget this was a coding round and not a reading round?
why is everyone downvoting because of the contest... :(
I started reading the first problem , and before i could even see the test cases , the round was over...
I suggest improving your reading comprehension before trying a competition. Good Luck!
I would rather do Eva than doing these problems
Score for B1 should be more than C. Currently B1 score is significantly low than that of C. And every one knows the level of these 2 questions.
After seeing too many Red coders as testers, we should prepare ourself for such a lengthy, disordered(e.g. problem B and C order) round.
Shitty memes incoming!!!!!!
Lol you are from Havana University
What's lol about that?
what is cuban round ?
The authors are from Cuba.
oh.
This comment is downvoted. So i can assume my answer is wrong. People who are downvoting can you please tell me what is the correct answer? I really want to know.
The authors are from Kuban
No, the authors are from Cuba
No. the authors are from Kuba.
a bad round
As a tester, I finally get to make one of these posts.
[gets contribution]
[gets contribution]
xD
exit(0);
[gets contribution
as a participant, your tester post sucks
This comment was downvoted by trolls
Come with me sir, we're gonna find out who tf asked.
Last time with this much red coders, we saw something dangerous.
we should have seen it coming
When last contest is rated and you want another contest to participate in and you are happy and confused at the same time!!!:
What is the story behind this image btw?
I put this image, cause there is a happinnes and confusion at the same time, like my feelings
okay
Everyone using this platform should know about him. :P He is MikeMirzayanov
Will it be IQ test round? I like IQ tests.
As a tester, I can confirm you need a brain to solve these problems.
Writing 'As a tester' was really important for that confirmation :p
MagentaCobra How much problems did he reject this time xD :)
I'm pretty sure he rejected ~15 problems
After the contest can we have the rejected problems for practice?
No, they are recycled to be rejected in next contest again.
After the contest, I was convinced that I have no brain :(
Man...I should have read this before the contest:(
As a human being, I can confirm that everyone has a brain smh.
As a tester, I’m glad I tested.
Seems like we are again going to have round 657 with less than few hundreds people solving C
[Enjoy your contribution] .
As a participant, I should've known what you were saying.
Now we know what happens when DEVIL himself wishes Good luck
)
There is an amazing team behind this contest. I'm looking forward to participate. Good rating everyone
As a non-tester, I'm glad that I'll be able to participate in it <(")
So, how did the contest go for you ? XD
My ratings didn't go down, so it was good I guess :\
So happy
Still holding to this opinion after the contest? ¯_(ツ)_/¯
It's irony, the contest is so happy, it's like yesterday's contest.
Imagine getting back from retirement for a Cuban round, writers are all amazing. Looking forward to it, see you in the standings, altho I prolly don't pass a,b :). Удачи
This round makes me want to retire.
The Div1 part of the contest is shown in Calendar on saturday, too. I think this is not intentionally.
We still remember the last red round
After a long time Um_nik became as a tester. I hope this round will be great.
Fake news
It's a good opportunity for me to become PUPIL again :)
Or maybe become Expert B)
well, you don't bacame pupil :)
Congratulations! :)
Yes, i have heard of Cuban. Krasnodar is the best city.
No no no, not that Cuban. This Cuba
Why do you downvoting me? That was just a joke. Of course i know what cuban means. Why do you upvoting some captain obviousness who didn't get the joke and tried to "explain" me what Cuban is?
Some people just don't get sarcasm, man. I upvoted you and am glad that your comment is now receiving upvotes too.
.
Count the number of peaks in the rating graph of dcordb
WA on pretest 2
Count the number of peaks in the rating graph of ruban
Time Limit Exceeded on pretest 6
I wish this was div2A instead of the real one.
As a participant, I am all scared looking at so many Reds
You were right.
You can do it! who want to become green, blue, ...
Who can do what?
you can become red
Ok
shut up!!
Your DP says that you stopped caring a long time ago then why is it bothering you. Everything gonna be alright!
Very excited for my first contest! I have covered all the basic data structures in past 1 month . Now I am looking to take part more frequently . Any suggestions on how to be consistent and any further resources ??
Bad Luck ! You chose the wrong contest.
In codeforces round When I submit the problem and it gets pretests passed in very first submission. Ooh that feelings can't explain in words. When I am writing this I am crying with smiling face
I think you haven't experience that feeling when you submitted it WA 10 times and the 11th time is got Pretest passed. Literally crying with smiling face.
As a tester, I wish every participant good luck and high rating on this (very nice) round!
I Hope Cuban round will be as good as Cuban Cigar. :)
A very interesting score distribution!
score and difficulty level no match at all !
Perfectly balanced, as all things should be
Hmmmmmmmmmmmmm.
Now again
( ° ͜ʖ °)
He should have waited for CF round #666.
How about we reserve CF Round #666 to be held on 13th November, 2020 (Friday the 13th) and ask Devil to hold it?
Only 7 contest in 4 month? I will lose my sanity
Maybe we can try "some" educational rounds!
Round 666 is coming up :)
lets make it 666 again
The cursed contest.
Wait, do we have subtasks in div2(asking because of the score distribution/and that it isn't mentioned)
I suppose because in the format given like (750 + 750 ) suggests so
It is written there will be 6 problems, so I think (500+750) => B1 and B2, B1 being subtask:)
I think that you should also author the seventh round following this one.
hello darkness, my old friend
Will Tourist top the tables today??
Yeah.
Hope,this first cuban round will be very interesting :D
Interesting score distribution! GL & HF!
ups
A sub-task for B? This is going to be wild.
Difficulty 1750, hope I could solve them.
My schedule this summer,
EAT -> PARTICIPATE IN CF CONTEST -> READ EDITORIAL -> SLEEP
REPEAT
ohh...which country are you living here it is rainy !!
Same!
CF has keeping me sane for the summer
you forget one part: LOSE RATING
good luck to you !!!
MikeMirzayanov Just curious to ask when running 2 contests (Div1 and Div2) you use the same server fot both the contests or 2 different servers (with Div1 having less specification server because of load)
Another Anton Round!
tourist registered for the contest, I think he'll take his position today!
i am having 1940 rating. and I don't want it to decrease for next 2 month so just wondering if someone can tell me how much maximum rank can ensure me 0 decrease? like any idea? is around 1000 fine
There is a way:copy code and get "skipped".But your account might be blocked
.
The meme is as hard to understand as solving Div.1F
You mean div2A?
incase anyone didn't get the meme carefully read the second line of the announcement!
I'm very glad to invite you to the first Cuban round Codeforces Round #659 (Div. 1) and Codeforces Round #659 (Div. 2) which will take place on Friday, July 24, 2020 at 20:35UTC+6.
The new strategy to decrease server load is working!
Seems Red Coders doesn't think of beginner coders !!
Again a Div1 type contest :(
Applicable to Div1 participants after solving A and B as well
Glad I didn't submit even a single code!
div2 feels like div1 :(
Last contest was such a class. Back to unnecessary complicated questions. All problem setters should learn something from Monogon and Ashishgup.
I know I am going to get downvoted to hell, but needed to get the truth out.
+1,I love Monogon's problem and this contest is quite bad.
Some of Ehab's math problem are also good.
Second that! mohammedehab2002 is my favourite setter, and Monogon is close second!
Since ^ comment is getting some attention, I want to add if we can come up with a way to voice our opinion about the round? Maybe upvote/downvote a contest or individual problems?
I am not against harder problems but there's a difference between good kind of hard and bad kind of hard.
UPD: Figured what was wrong on pretest 3. Sorry for spreading hate.
I'm a newbie. I didn't even understand the questions.
It's Okay. Nobody did.
my confidence is indirectly proportional to length of questions
My confidence is directly proportional to length of questions. I cannot solve and more people cannot solve.
Reading div2 B1-B2 problems is more difficult than doing a plank.
Worst score distribution i have ever seen in Codeforces!!!
Div-2 contest doesnt seem to a div-2 type.No balance in problems at all.
Seems like that was the case for Div1 as well
Looks like Devil's plan at work here.
Plan of unexpected statements!
If the frequencies of these types of contest increases, it will inculcate the feeling of fear in beginners' mind towards competitive coding. No offense to anyone.
you asked for harder questions, so there you go :P
who the hell asked for it? <(")
Me after reading Div2 A, B1, B2:
Not worth complaining about the difficulty of the problems. Just improve next time and learn from your mistakes.
Do not trust someone whose account name is Devil
Kudos to all problem setters and team. What a contest. I realized that need to learn more practice more.
There are better ways to learn that fact.
i was able to solve the first one phewwww!
That's an achievement. Not kidding at all. You should be proud of yourself. I am unable to figure out where my code is failing for past one hour.
Ok, so here it is: link
However the contest is. It is rated or unrated you must not share any solution during contest.
[Deleted]
Another difficulty staircases
Yeah, and I bet most of users solved problem B by guessing solution, not even having proof...
You'd bet that but you'd be wrong. If you actually could guess the solution, then it wasn't too hard to prove three or four cases.
In my opinion
I thought WA on pretest 2 sucks the most, but today I learnt, WA on pretest 3 sucks the most. Getting WA on pretest 3 in C :(
Nvm I removed an if case and it worked. :)
tourist returns to #1 !!!
(Oh, now it won't be broken.)
Except tourist himself.
Wait... Has Codeforces increased the difficulty of Div.2???
The language of Div.2 B1 was very bad. :(
I happy for tourist, he will return to it's normal position :) tourist
You should not add someone's handle unnecessarily
Monogon's Div.1 contest was MUCH better than today's contest. problems were unbalanced and Div.1 B was terrible problem...
Why do you think div 1 B was a terrible problem?
wtf? Div1B was a really nice problem imo.
Div 1B was pretty interesting in my opinion.
If Div1B was terrible, then please come and read Div2B1 (and B2).
TFW you not only fail to solve div1A, but can't understand why your solution to div1A is wrong.
Same! But I suppose I'm somewhat relieved/surprised to see a grandmaster say this! No offense ofc.
I still have no idea how to solve that problem, although something did pass pretests eventually. Had to move to more trivial problems like E instead :)
Go through all letters in increasing order. For each letter, get the minimum of letters that this letter needs to be converted to (lets aabb — xyxy: a converts to x and y, take the smaller one), then convert all the letters (a) to the lexicographically smaller one (x or y) (note you need to skip letters that are already ok).
What do you mean?
For that one it's
aabb bbbb xbxb xyxy
(according to my code + my manual attempt)
So the transitive reduction of a DAG isn't a subgraph?
Transitive reduction requires that there is a path from a to b if and only if there was a path from a to b in the original graph. This problem doesn't have the "only if" requirement.
24 (Dadgum.)
I thought that adding more edges can't hurt the number of operations...
Acc. to my code, aabb->xxbb->xxxx->xyxy
Yes! Me too. WA on pretest 3...
I also had a wrong pretest 3 at first and then I implemented a (in my mind) equal solution in a different and it worked lol (solution is back down). What I did it first was: go through letters in increasing order, if a letter is not good then convert it to a letter that also exists and needs to be converted to the same letter (ignore if it's already good, convert directly only if there are no such cases). Idk why this approach is any different than my other, could be just a program error since it's a bit more complex.
I spent two whole hours battling pretest 3, only to no avail.
It feels like the contest is based on some olympiad for students of 5-8 grades
at least there were interesting problems
PTSD intensifies
what do u mean. is there similar tasks or what?
That round was extremely tough for a Div2, people were joking about how skilled Russian 5-8 grade students must be to solve it. Now this round has somehow managed to be even tougher.
Normal Div2 round: Kalm
some olympiad for students of 5-8 grades: Panik!
I have a strange question. Who is Koa the Koala?
And why is it ruining my div2?
the devil himself.
Kind request to stop such bullshit Div2
lol, there was a duplicate test case in problem B. ~~~~~ 5 2 3 1 2 3 2 2 ~~~~~
I was unable to reach sample test case left the problem after reading the problem statement only.
Then how about the REAL CF Round #659 div1? Say, div0?
No, In div1, we are crowd in div1 standing!
bad problems , bad statements . didn't enjoyed this contest .
This contest is not worth 2 hours of 20k Div-2 participants.
thanks antontrygubO_o for amazing coordination of this round.
Now I am wondering about him antontrygubO_o. He didn't even realize about the problem statement of $$$Div2B$$$. F.
Anybody else having had problems opening the page of their room?
Devil $$$2B$$$, Devil $$$1C$$$.
Devil Statement, Devil difficulty.
Can someone explain why this idea gives WA3 in Div2-C / Div1-A?
If any letter needs to be changed to an alphabetically smaller one, output -1.
Otherwise, build a directed graph (e.g. a matrix) where
graph[a][b] = 1
iff we need to change a to b at least one index, a<b.Then, drop the unnecessary edges. An edge a->b is unnecessary iff there is another path with more nodes that connects a and b. Note that the path will contain strictly shorter (in the alphabetic sense) edges, so we can start with an empty graph and add edges of alphabetic difference 1, 2, 3, ... 19, at each point checking that the letters are not already connected.
The answer is the number of edges in the final graph. I have no idea what I'm missing.
i did the same thing, WA on tc 3.
So on the test
AB
,DC
you will print 3, becauseA->B->C->D
, right?My answer is 2. The original graph does not contain a->b or c->d, and I only ever remove edges.
Edit: Okay, I see it. The entire problem is that I only remove edges. For example, in
aabb
->cdcd
the optimal solution is to turnaabb
->bbbb
and then two more operations. My solution prints 4 because it cannot add the edgea->b
.Ah ok,
AABB
CDCD
, the answer is 3, becauseAABB->CCBB->CCCC->CDCD
shouldn't it be 2? coz A -> C and B -> D ?
Got it
aabb cdcd
I did something weird, but it passed pretests somehow... basically ignore the fact that the graph is directed, answer = 20 — number of connected components.
this problem can be solved by a simple dfs finding number of vertices in every component.
infxx Can you please elucidate? I tried something similar but it didn't work. 87922305
The major difference I see is that you are making the graph undirected(right?). Why so?
Norrius What is the fix for this approach?
It's really easy: just find the sizes of (undirected) connected components with DFS/BFS, let's say they are $$$c_1, ..., c_k$$$. Then the answer is $$$\sum_i (c_i - 1)$$$, because there is some spanning tree in each of the components, and you know how many edges a tree has.
I don't quite get the intuition behind this fix? Like, how did you get to this? And why does that work? I get this idea that we need to find the minimum spanning tree(taking all edges' weight as 1) for our original directed graph(but there's an issue in it). But I do not get it that how making the graph undirected solves our issue?
well
That was different
each participant's state during contest was exactly like your profile pic ...
For Problem D in div 2., can we solve the problem for each bit independently?
Edit: NVM I just proved it to my self
Proof: if you have an odd number of bits, set at a particular position for all numbers in the array, the winner will be decided in this round Other wise you have an even number of bits, and your opponent will get the same result as you for that bit position.
1384B1 - Koa and the Beach (Easy Version) is my new favorit of shittiest problem statement ever.
Pictures would have helped.
And some other story, mayby one which makes some sense or none at all... I needed to ask twice before understanding that the girl cannot swim if the water is to deep. How can somebody come up with such wired picture? This is simply the opposite of logic. I mean, why?
Yeah, adding "More formally, " just made it harder to understand.
Too time-consuming when reading Div2B problem :))
So laughy to hear, when problems are nice in easy contest, and bad in hard contets. LOL. bad != hard.
Problems were cute && hard, div2 guys just cant solve them and find it is bad && want unrated — it is so stupid && two-faces
The problems were pretty good, it's just the fact that C was a lot easier than B in div2 (You can look by yourself). I find B as a very nice problem, but it took me more than 15 minutes to understand the statement.
Yeah, you are right. I am just angry about people who wrote that problems were bad and shitty
I understood you. I'm also finding this annoying. If you understand the statements of the problems, they are enjoyable (in my opinion). I just hope that in the future, the authors will write the statements more concisely and the problems will go in increasing difficulty.
Finally a really accurated opinion. I left this community two years ago, when i retired from regionals. Now two years without basically coding at all, i return for the first cuban round, and i managed to solve A, B1, C and get a positive score given by the fact that when i retired there were approx 4000-6000 participants per round in Div2. I found out that now there are nearly 20k, but 16k of them at least, only know to cry about problems that a retired person can solve with 0 warn up, thanks so much codeforces, for leaving me this bad memory as about the first round written by my country.
To the person who i'm replying, really my most sincere congratulation, for not being one of those crying babies. Thanks!
Anyone else with wrong answer on pretest 3 in C? What was it??? :/
me :(
I guess that was the first real test with many test cases. Test 2 contained some corner cases I think
Same here. Not sure what it was, but I know I did not handle a case like: aabb cdcd (Answer should be 3: converting a->b, then b->c and b->d)
C was DSU or DFS/BFS/ Spanning Tree loved solving it <3;
It was easy greedy. You overkilled it. Can you briefly say about dsu solution?
I converted all conversions into the form of A to B in a directed graph if at the end of all conversions character A was required to be converted into B . Now if A>B then always answer is "-1" , this is self explanatory. Now I added all the edges to the graph , if A-->B , Now any successful completion or conversion can can be done efficiently if for every pair A to B to which conversion is required we follow exactly one path and no more than that , this conversion can be seen as path from node A to node B in the graph. Now for a connected components if we want minimum paths to follow and connect all characters which are need to be converted into one path, we need to find just a spanning tree of the obtained graph. Thus we can obtain it easily using any technique like BFS/DFS/DSU . Thus it was a good problem of Spanning tree, I think. May be I over-killed it.
Consider the small case graph where aab-->bcc A->B , B->C, A->C. since the spanning tree of above graph will be A->B->C , which is minimum possible answer for this conversion process.
Wow, that's an elegant approach. Thank you :)
Yours Welcome , What is the greedy approach by the way.
Created a directed graph.
Then I traversed from the character 'a'. Assuming our current character is 'C'th.
Using one operation, I changed all character 'C' to the minimal character over all his sons, and now add the new childs to the minimal character.
AM_I_Learning What is wrong with my solution 87922305?
Very interesting approach, thanks for sharing.
Can you please share your approach
replied above you may check it!
Time for antontrygubO_o to resign. What a disaster.
In my opinion Div 2 C (Div 1 A) was waaaaaaaay easier than Div 2 B.
New type of contest to avoid : Cuban Round
derji v kurse, zachem ty napisal ob etom 100 kommentov lol?
Div2D/Div1B solution is really nice:
Notice that for a given bit, if it occurs in an even number of elements, then the players will either both have this bit in their sums or both not have the bit (either both have an odd number or both have an even number of the bit) regardless of the actions taken in the game. Thus, we can look for the highest bit that occurs with odd frequency. If there is no such bit, then it must be a draw. Someone will have this bit in their sum, and someone else will not, and the other bits do not matter since this is greater than the sum of all the lower bits.
So, if we call this bit b, then we can replace all of our numbers with either 1 or 0 depending on whether or not they have bit b. Now we simply need to solve the case where there are only 0's and 1's in our array, which is left as an exercise to the reader.
It wouldn't help me, unfortunately. I got almost all the conditions. I've checked if the number of 1's equals 1 instead of count % 4 == 1. I just considered 1 and 3 and did not notice that for 5, the first person also gets the odd number of elements...
But I just stuck in how to solve 0-1 array!!!Please tell me!
First, think about the case with no 0's. Who wins if there is just one 1? Three 1's? Five 1's?
Now, add a single 0. How does that change things? How about a second? A third?
bad contest with long statments
Nice way of reducing the load of the server and taking care of the long queues :P
I feel lucky for div.1 participants for not having to solve such B.
Awesome problems! From which AtCoder round did you steal E?
Jajaj thanks. It is nice to hear some good feedback. We (setters) are really glad you like the problems.
I think I finally kinda understand people who whine about terse (few details) editorials.
Yesterday I tried to solve AGC 027 E. I found an easy classification about what intervals we can compress into a single element and what the result of that compression is. But I failed to come up with the DP that would count the subsequences.
Today I see 1383E - Strange Operation which is obviously very similar (basically, rules about collapsing intervals are simpler). I decide to read the editorial of 027E in the hopes that the DP might be similar. And what do I find from the editorial?
In other words "lol that's trivial" :/
That's one sure way to make us solve the exercises "left to the reader", just put them in another contest, right?
Can you give a hint to the idea for problem E? I've observed that no zeros from different contiguous components can be in the final string, but I couldn't find a way to count all possible final strings beyond the multiplication when we don't delete any 1's.
In the end I'm not sure how much a more detailed editorial would have actually helped.
Yeah it's basically "count # of distinct subsequences" with that restriction (and some additional fiddling with initial and final zeroes, which is too tedious to think about). For each subsequence let's count only the "leftmost".
Suppose you have just ended a block of 1-s and would like to add a block of $$$k$$$ 0-s to your subsequence. Then you move find the first block of 0-s that's at least $$$k$$$ long and jump to the end of that.
Suppose you have just ended a block of 0-s and would like to add a block of $$$k$$$ 1-s to your subsequence. Then you simply take the next $$$k$$$ 1-s in the original string and jump to that position.
If you build a DP based on that you get $$$O(n^2)$$$ complexity, but it's relatively easy to optimize from there.
Were pretests strong ?
Noooo...A had weak pretests...got WA on test 15 in system testing...this has to be one of the worst contests in recent times...
Owie :(
yeah same here wrong answer on test 22 xD
Now I am eagerly waiting for someone to upload a video editorial of B and C and comment here !!!
Don't know why but I thought
is "LOSE" in div1B for the whole contest :)
what the hell was test case 3 for Div2 C ?
Not certain (I didn't get C, but know one reason mine probably failed on it), but I bet it was something like: aabb cdcd Optimal is to convert a to b, then b to c and b to d, for 3 moves. I know I was still converting a-c,a-d,b-c,b-d.
Don't you think the Div.1 difficulty gap is terrible?
in Problem D I added the following if statement 1.5 minutes before the end and it worked and i was ecstatic XD
I really hope my Python won't TLE because there was a point I thought the pretests didn't pass because I didn't have enough bits so I went all the way up to 50 (even though 30 is enough). So I spend 20*n work for no reason what so ever and it just might cause TLE (on python it's super sensitive).
EDIT: It didn't TLE! But it was sure close. one pretest was 936ms XDDD
DIV 2 A before: You have to come up with something
DIV 2 A now: You have to write a long implementation
This submission is small
What are you talking about? it was like 11 lines of code and I was wasteful. I only used the letters 'a' and 'z'. You just have to use the last string, copy it until the prefix length, and add 'a'/'z' depending on situation.
Python solution:
Usually there was nothing to come up for in past rounds.
Another Russian olympiad for students of 5-8 grades :D.
Highly Undistributed Difficulty Level (Div2)
The Ranks of Participants who solved only A lie from 2745->infinite.
It was FastSolveProblemA Forces. And was someone like me who made a wrong submission on A and faced -50 penalty,it was like like Facing the Real Devil.
Ranking dropped down Dead.
We need better adjusted ProblemSets.
Ciao Rating !
don't worry bro you are not alone.
I wanted to drown myself trying to solve div2B
LOL you killed xD
Damn! this round was soo tough than normal div 2 rounds
Bring back the good old days when DIV-2 was actually DIV-2.
How is B1 easier than C, also why is points for B1 not even one third of C ?
Such a long statement for B1. B1 should atleast be of 1000 points.
tourist comback Top rated
My idea for div1C
Let's make a directed graph G with 20 vertices (= letters) and edges from v1 to v2 if v1 needs to be changed to v2. Then we need to get a topological sorting S for G. Since it contains loops, pick the smallest possible set of vertices which are parts of any loop (so that if we remove these vertices, all the loops will be broken), put them in front of S, delete their inbound edges and sort the rest of the graph.
The answer will be size(S) — 1.
I don't know how to find loops in a directed graph and how to find that set of vertices :/
Hm, I'm not sure I totally understand your solution, but maybe something similar would work with condensation SCC graph? I tried to think of something like that but couldn't make it work.
EDIT: Actually, I read your idea more closely. Wouldn't this imply that on the complete graph the answer is 19 when it should be 39 (I think)?
I had a feeling there might have been some solution involving bitmasks since $$$|\alpha| = 20$$$ rather than 26.
Let's put the idea another way:
You have a directed graph with cycles. First you may spend a move to cut the loop at some vertex V (by removing its inbound edges), then after all the loops are eliminated you perform a toposort on the graph. Suppose you cut the loops in vertices
b, f, g
, and toposort gives youa, m, b, g, q, f, s
. Then the answer should beb -> f -> g -> a -> m -> b -> g -> q -> f -> s
(=9). Arrows show how you should change letters.Yes, this is correct. Finding the set of vertices you described is an NP-complete problem, so you basically have to try all possible sets and see if they break all loops or not (intended complexity is $$$O(\alpha \cdot 2^{\alpha})$$$).
I think there was a lack of coordination in setting the difficulty of the problems to the actual score...what a terrible round.antontrygubO_o
Definately one of My Favourite Contests. Amazing Problem Set. Kudos to the Setters.
I love Cuban girls, but I hate this Cuban round((.
I hate Koa the Koala.
do you remember when codeforces had div1 ,div2 and div 3 it was very good days before they canceled div2
The good thing about this contest series is tourist is back to 1!
*only good thing
Should have had some div2 rated coders test this round too.
Is this div2? The experience is very poor, the topic stem is too long, the language is not refined enough, and the author needs more exercise. Life has a dream, each wonderful. Don't see you again
F was solved by 14 people, C by 18. Considering how many people (me included) read the problems in order, going by just the numbers, C was arguably the hardest problem in the contest o.O
Also, please make some algorithm/data structure problems sometimes. I'm tired of every problem being ad-hoc :(
Yup, I wonder how this difficulty mismatch is possible with so many testers.
Not every problem was ad-hoc. E is dp+DS (at least my solution is).
87911622 for F is mincut/maxflow, does that count as algorithm?
At a glance F seems like it fits the mold. I guess it's more of an issue because algorithm/data structure tasks are usually some of the last problems, and I'm not good enough to regularly get all the way to them.
Well, you can just skip the other problems like I did. Score distribution is also weird af for this round so it's a sign that problem difficulty might be weird as well.
That said, the solves are biased towards higher problems since they are worth more. If someone thought C was slightly easier than E, it would still probably make sense to go for E given that it's worth so much more.
The problems order
Am I really really stupid or was this round was tougher than usual (or both) ?
both
This round makes me realize how much I need to improve
After long time got his throne again !!
Yet another unexpected Div 1 contest (for us Div 2 peeps) :)
Jokes apart, I feel that the questions were unbalanced. We saw the number of submissions for B1, B2 compared to C. Questions were more on the intuition side and getting the right logic. You would spend a lot of time to get the logic, and once you get it, its a few lines of code.
A was nice, but required a lot of thinking. Once you had it, few lines of code. For example 87878449.
A humble request to problem setters. Please make the contests more balanced. the questions are good and interesting, but the resulting rating changes don't perfectly reflect on the competitive coding abilities of a person.
The submission you linked has about 10 LoC (excluding boilerplate) — I think that's reasonable for a Div2A. People were complaining about Div2A problems in the past that had 1-2 LoC solutions, something like
print(int(input()) // 2)
I'm not saying any of the questions were bad. A was a standard one. Just the placement of B and C could have been done properly. And yes, considering some of the previous contests, as you rightly pointed, length of A was good (10 LoC).
Yes, the questions were good but were wrongly placed.
s
Are you inviting downvotes?
I did not see the preview. Sorry
My solution to C: assume that the solution is bitmask DP, write the most random bitmask DP you can think of, AC.
This round was challenging but good.
I'm not sure if the distributions are matched with the real difficulties.
I'm wondering how many people solved B div1 properly (without brute-force). I haven't, btw.
I don't understand what's improper about your solution. Even I did the same way.
The solution came from running the following source code locally:
https://pastebin.com/XB05j0rP
(instead of thinking of a proof)
I figured out that we need to focus on the largest bit that occurs an odd number of times and when (number of elements with this bit 0, with this bit 1) = $$$(a, b)$$$, it's equivalent to $$$(a-2, b)$$$ or $$$(a, b-4)$$$. That leaves 3 cases to figure out manually.
Can you elaborate a bit on the equivalence?
Basically, the first player can group together 2 elements where this critical bit is 0 or (2 and 2) elements where it's 1. Let's say that the 1st player took something. If the 2nd player takes one of the elements in a group, the 1st player can take the other; the critical bit of the XOR doesn't change.
From this, we can directly see that $$$(a, 1+4b)$$$ is winning — the 1st player moves to $$$(a, 4b)$$$ and reacts until we reach $$$(0, 0)$$$ or $$$(1, 0)$$$ with the 2nd player's turn. With $$$(1+2a, 3+4b)$$$, the first player moves to $$$(2a, 3+4b)$$$, from that we reach $$$(0, 3)$$$ and since it's the 2nd player's turn and both have the critical bit 0, the 1st player wins. Seems the last case is losing.
Div1B has an easy proof of correctness. After you observed that you can split the input numbers into 2 groups based on the value of some bit, then you'll have to consider 4 cases depending on whether the sizes of these groups are odd or even. The proof itself is a bit too long to type :/
I'm amused how you framed the answer, by telling the easy part (in my opinion) and omitting the part that I was actually interested in. It reminds me of some professors at university and their "proofs let as exercise for the reader", some of which they don't know how to prove themselves.
Let's say O — is the number with the bit 1, o — the number with the bit 0.
In case OOOOOoooo (O = 5, 9, 13..., o = 2, 4, 6) you take O and then repeat the move of your opponent. In this case you get count(O)/2+1 which will be odd, so you win
In case OOOOOooo (O = 5, 9, ... o = 1, 2, 5) you take O and repeat the move of your opponent. If your opponent takes the last o, then you will take O and force him to take another O after your move. So as the result you'll again get count(O)/2+1 and win
In case OOOoooo (O = 3, 7, 11..., o = 2, 4, 6) the opponent will repeat your moves and you'll end up with count(O)/2 + 1 which is even and you lose
In case OOOooo (O = 3, 7, 11..., o = 1, 3, 5) you take o and the opponent handles the previous case (where he loses) so you win.
The answer
If it is ever optimal for you to take a 0 rather than a 1, it will then be optimal for your opponent to do so (essentially saying “I don’t want to be the first person to take a 1”). So only the parity of 0’s matter when passing is optimal, and it will flip the answer if it’s odd.
Then you can basically assume WOLOG that there are zero 0’s and get the answer from there. Going up to 5 1’s it should be clear that every group of two new 1’s that you add flips the winner.
It is a common insight in problems like this that if the players have some "pass" option available (in this case, taking a 0), only the parity of the number of passes matters.
To see this, assume the number of available passes is even. If the second player would win in the position with no passes, then passing does not help the first player as the second player can simply pass back and eventually the passes will run out.
If the first player would win in the position, then they just make whatever move they would make normally and the second player can't avoid the loss by passing (since they're now in the position of the previous paragraph).
So all positions with even passes are equivalent to the position with no passes; by extension having an odd number of passes is equivalent to having one. Cases with no 0s are obvious, so now you only need to solve the original problem for when you have exactly one 0, which is hopefully a lot easier.
That’s really cool, thanks!
Thank you for the interesting problems! Finally a not-too-easy div2.
Frustrating questions.. imagine how it would have felt if the submissions were at the usual rate lol
the first rule of an anton trygub round is to not forget that it is an anton trygub round
https://ibb.co/8rTRK89
"and we highly encourage you to read all of them :)"
Imagine if you solve the problems according to their order.
I was only able to read them all but unable to solve them :(
Extremely bad contest.Mike please tell them how a contest should be set so that everyone can learn and enjoy from it.I can't switch to other problems unless i solve the first one,because they seem to be way more harder by looking at successful submissions.Hoping for a good contest from good problem authors and testcase seters.These new guys should be trained.
You can learn more by solving older contests rather than this shitty problems.
Mate if this was an impossible contest and i got +88 i should go full back to codeforces, 2.1k is not longer a dream for me :o
Have you tried Codeforces Round #657 (Div. 2) ?
i dont know but even after all the difficult problems why pretest of even A were weak... solved just 1 and that also got wrong test 32....
Awesome problems :) Thank you, Devil et al, for this contest.
But I have a question to cf admins and coordinators: do you ever read Russian statements before the contest? They are awful almost every round.
div2B statement was not bad but rather it was too long I panicked after seeing the statement, I would have solved it if I didn't panic but still, this contest gave me the highest rating delta.
Yeah, problems were hard, but not bad. Yes, it's true that it's not easy to visualize the hard version of div.2 B. But when you can, you may think that it's nice after all. At least, I have the feeling during the contest! :)
Even the stories(which were very long) used in the problems were boring.
Contest is shit bro don't be sad MikeMirzayanov look into it boy is very sad.
This contest reminds me of the round #657 :(
Despite the difficulty, the problems and ideas are great though :D
I agree. Just because of the steep difficulty, a lot of people are unsatisfied with the contest
This round wasn't interesting to me :( . During the contest, I was confused if I entered in the Div1 section :( . Overall, I got my lesson for improving me..........& yep, the writer of the contest has an interest name related to the situation of this contest. -_- .
Well guys what did you expect? The contest was set by Devil himself.
We didn't expect shit of Devil in Div2 B1 ,
Contribution rating of this contest is falling faster than my ratings.
Now Need Quick Editorial :(
I don't know what these div2 rounds are, but definitely not the same as they used to be. In the past D or E was of the same difficulty as this round's B ...
And div2B was more difficult than div1A, so it is tecnically a div1 round for div2 participants. Let's delete divisions, at least then someone would know what to expect.
This round was very different from typical Codeforces rounds. I think the clarity of statements and difficulty for B1 and B2 should have been handled better. The pretests should have been stronger than this. It's been a while since I have seen so many failed system tests. I am not sure whether it is intended but I am not a huge fan of it.
)
I can understand the frustration but 1384D - GameGame is much, much easier than Div1D should ever be.
Weak Pretest for Div2 B1, I wrote a solution for Div2 B2, got wrong answer verdict on test 2, but same solution passed pretest for B1.
To not keep you waiting, the ratings updated preliminarily. In a few hours, I will remove cheaters and update the ratings again!
According to CF rating predictor, tourist will be again first in rating table
Tbh, I don't see how people are comparing today's div2 with div1. I agree the order of the problems was a little messed up. But the difficulty was still of a div2.
Div2B's rating was completely skewed and definitely much harder than a typical B. Having such a hard problem worth so little steepens the curve of the entire round. It IS harder than a typical Div2 because there are less easier problems.
That's what I said. Order of problems was messed up. Apart from that, A and C were pretty normal for a div2. So was B, apart from the fact that it should have been placed higher. So I think the problems weren't that difficult. But again maybe it is just me.
Yeah the main problem was the rating distribution but what I'm saying is that by setting the distribution improperly, the entire round becomes more difficult.
Problem B was problem the equivalent of C-D The other problems were relatively appropriate
So instead of a round with problems of difficulty A-B-C-D-E-F you get A-C-C-D-E-F which is definitely harder
Agreed. But I guess every once in a while you get a slightly harder contest than usual.
I think B1 was very straightforward. Not the same about B2.
please Devil atleast increase the score of B1 and B2 because it is much harder than c
Sorry to say, but this contest was a failure. Hard A with just 6k submissions. Weak pretest of A. Multiple solutions failing on Test 32.
You cannot judge a contest by only problem A. You didn't reach other problems so it is your problem.
Maybe, I lack in skills to solve C. But still submissions are evident of B1 B2 and C. As many as 1100 solutions of A failed in main test. Something is really wrong.
Normal. I remember in the old days where multi testcases did not exist a lot, tons of people were getting hacked. Oh and also, C was considerably easy. Maybe B1 and B2 were a bit heavy, but they were so good and not trivial. In fact, I think what made it hard its because it is non-trivial. For me, I felt it was not that hard. But difficulty depends from person to person.
Agreed. C used to be so much more difficult. I think it was just the order of problems that was a little messed up. Otherwise, it was a nice contest.
This round was definitely not like regular div 2 rounds!
Nice round. Awesome A
If the no of submissions in a rated contest are very low ~5000, is it advisable to submit a wrong solution intentionally to get an increase in rating ?
You cannot actually(i.e ignores new-rating-bonus) increase your rating if you solve $$$0$$$ problems, except your rating is low enough (I think, $$$<0$$$)
A newbie would lose more than $$$50$$$ rating if he didn't solve anything.
Solving $$$0$$$ problems means: being beaten by contestants who have positive score, tying with those with $$$0$$$ score, and possibly beating one or two clowns who made umpteen unsuccessful hacks to get negative score. If there are sufficiently many people with $$$0$$$ score and your rating is sufficiently low this might be better performance than average predicted based on your rating.
I get it. Thanks
Moreover since this was introduced https://codeforces.net/blog/entry/77890 you can get positive difference for "displayed rating", even while getting negative difference on "rating for calculation"
Please help me guys. I am getting runtime error https://codeforces.net/contest/1384/submission/87927572
Thanks for the nice problems.
BTW, does anyone know how to hack this solution? It's just Dinic $$$\times 2^K$$$ but fast on current tests.
I created a test with which the mentioned solution times out, but when I try to uphack it (#657051) "unexpected verdict" is shown. What's this? Is this an issue of the uphacking feature? (ping MikeMirzayanov)
It probably means that a solution which was marked as correct in polygon got TLE on that test.
Hacks are already working.
As pointed out by dorijanlendvaj there were some slow solutions marked as AC in polygon.
cc hackers: maroonrk, neal, tfg, yosupo
Just got another unexpected verdict (#657083). mnaeraxr, please check it.
Here's my generator.
It is working now!
Yet another Unexpected Verdict! (#657086)
My new generator fails even the model implementation in the editorial (on my local machine).
It seems that you are the unexpected person for authors...
+1 for unexpected verdicts
Do you really see “unexpected verdict” for the first time? :o
Name “Polish Mafia” was created because of causing unexpected verdicts :P
Yes, it was the first time I see that because I rarely try to hack other solutions. Anyway, I'm happy to know the origin of "Polish Mafia", which is one of my favorite team names.
I think I saw it for the first time during a round, so it was a bit worse.
I think, B1 and B2 (div2) were so hard for this positions
So who was the target participant of this round? Tourist?
They said "read all problems" :- We should have focussed on it more at that time!!!
If this is going to be a thing from now, we're in for a treat
Am I true that Cuban round was first time conducted? Hence it was full of threats and ...
Back to pupil...T_T
Just don't know am I that degraded or also tilted for WA2 in A?
Nice C/D. B really need some image instead of text notes.
lol this is so disappointing for me , seeing people who solved only A below me by ~500 ranks, and those who solved only C above me by ~500 , and i wasted most of my time to solve 3 problems and gained nothing.
so basically my rating change would have stayed almost the same if i didn't even read B1 and B2 since i solve A quickly.
edit: a problem solved by only 300 people during contest is worth nothing.
just complaining to put it off my chest.
This is very sad for codeforces. It seems that the setters can not come up with unique problems anymore, so they always divide the problems. C should have been <1500 and B should have been a solid problem having >1750 points
Can someone explain how to solve 2C.string transformation 1,
For me,the main observation was that if you need to transform an 'a' to 'c', and also a 'b' to 'c', it is more profitable to transform 'a' to 'b' first.The implementation part is quite easy actually. 87893559
Key idea :
If you want to change a->b at some place and also a->c at some other place, it's better that you first convert a->b at both positions.
Why so ? Because, even if you change it individually, a->b and a->c it is going to cost you 2 operations, but if there are more b->c conversion then changing both of a's to b will help. - So, How to generalize it ?
If there is a x, and we have to replace it by x->y1, x->y2 , x->y3 ,.. such that y1<y2<y3, replace all of these x by y1 first and the now new conversions added are y1->y2, y1->y3, ..
Implementation of this idea
87877844
"Some" people just cant be satisfied with any contest.. When there's an easy contest, people say too easy div 2, div 2 C was very easy, more like a div 3 contest etc. etc. when there's a tough one, they are like div2 was like div 1, very unbalanced contest, bad problems, and make memes about it.. when there are ad-hoc problems they start targetting the coordinator that we want dp problems, data structures/algo problems etc. etc. when there are, people again start whining about the difficulty , say problems were shitty, etc. etc.
P.S. i'm glad we are getting regular contests on CF and every contest teaches something...
(awaiting downvotes)
Feel I'm so stupid that got hacked on Div.2 A.lol
My profile picture depicts my condition after this contest !
.
wasn't much of a hard work then ig, if you lost it in 1 contest.
.
Then how is it lost in 2hrs? You still know coding and your problem solving skills have probably increased.
.
For someone who is Candidate Master, you still act pretty dumb. Since so many people are complaining, don't you think it makes sense that TriumphantEggplant lost so many points. Its kinda sad that a newbie understands this more than a Candidate Master.
Thinking so much about rating is useless. One bad contest's rating is anyways nullified after 4-5 normal contests anyways. What really matters is what you learn.
And yeah of course it is fine to be sad after a bad contest (I also messed up today on B) but my point is your hard work isn't really wasted with one contest.
Don't worry and don't think of rating like that.
If you deserved that rating, you will have it back in a few contests.
If you didn't deserve that rating, you would have soon lost it anyway.
It's very discouraging to lose rating, but it's just a number honestly. Some contests are good, some are bad. What's important is that you can solve problems now that you couldn't have solved before. Just keep practicing and your rating will come back :)
Thank you for this very nice round ! I enjoyed the problems although pB story was too long to read
I thought that for tourist, mike should create another level of legendary grandmaster
I think Legendary grandmaster was made because for tourist.
antontrygubO_o thanks for this amazing contest. You're doing a REALLY great job at making more and more absurd contests. GG.
Why was it absurd:
Aside from HUGEA-- statements and weak pretests, the order of questions was stupid, difficulty was not appropriate. I think you really need to look back and think what you're doing wrong instead of trying to defend yourself.
PEACE.
PS: The problem setters are to be blamed equally.
back to 666 contribution XD
I like Cuban cigars and rum, but not contests...
Funny how it's been an hour and no one has posted Any Video Editorial Link For Div2C/D Yet.
This is my personal opinion, I think the same problem should not be divided into two parts (lowering difficulty in one part). Or maybe the point for the harder version should be much much higher than the easier version. The reason follows,
The points keep deducting from both the version simultaneously.
Let's say, one person solves both the versions separately. Sometimes it occurs as if the solving methods of the versions are completely different. One has to rethink more deeply for solving the harder version. It can take longer than the easier one. But the result is not sweet sometimes. Because for wasting so much time for solving the easier one, a lot of points have been already deducted from the harder version.
Now, if someone wants to solve both the versions at once, there is a huge risk factor. And even if they manage to solve the harder version first, they can't gain as much point in the easier version as those who have solved only the easier version quicker. It is expected that the harder version will take more time to be solved, so they will obviously gain less point in the easier version than others. If the point in the harder was much much higher, then it wouldn't be a problem.
If I have to say more clearly, then basically the harder version needs a harder thinking process, needs more time to solve. But most of the time the harder version has a lesser point than the easier one. Why? It's not like the easier version always helps in the harder version, absolutely not. Most of the time, you can consider the versions completely different on the basis of their solution.
Sorry for being too long. Maybe I am missing something. Let me know what you think.
we're in the same position, basically the same problem i had in the comments above.
the rating distrubution for the problems feels unfair, one could argue that b1 is much harder than C , and b2 is much harder than b1 , yet both b1+b2 < c rating by 500....
very disappointed by this, had i not wasted the time on it , i would have easily solved C which is quite simple but i got nervous having no time left.
I can relate to your situation. We should try to seek the attention of MikeMirzayanov . Boss, can you take a look into it?
Whatever the conditions are, the contest is fair to all the participants since all of them are in the same conditions.
All the things you describe don't give anybody an unfair advantage, they just add some strategy element to the contest.
a fair point , but strategy is all based on the points , seeing that B1 is 1250 points less than C , and the harder version is less by 1000 , after reading B1 anyone would think if you can't solve B1 then you won't solve C.
this problem is caused by the ratings put by the problem setters.
with your argument it should be ok to have F in a contest with 3000 points to simply be print a+b.(extreme exaggeration ofc)
Yes, I think it should be ok. Can you prove the opposite?
can't find a valid argument on my side to be honest,but i just personally think the problemsetters made a mistake with the ratings which caused the standings to look like a mess.
I agree with you, but not completely. Maybe it doesn't provide an unfair advantage to anyone intentionally, but it lets the fate to decide who is better. For example, let's say one guy starts to solve B1 first since it should be the optimal strategy. But imagine that day B2 was not that hard and it may take almost the same time as solving B1. So, on that day whoever started to solve B2 first got 'lucky'.
So, the next day, the same guy started to solve B2 at first, But this time the condition was like today, where B2 is much harder than B1 (and obviously C). And also today he was 'unlucky'?
What's the point of point distribution then? Let's make the contest as per the rules of ICPC or of educational rounds.
You are right, CF doesn't provide any disadvantage to anyone intentionally. But it certainly deceives some contestants unintentionally.
There was no strategy today, but only deception.
Another way to look at it is that such problems give you more options. Once you've read the problem statement, you can then make a choice on which version to solve. You can either solve the easy version and treat it as a problem A, or the hard version and treat it as a problem D. I would not go in with the intention of solving them separately.
The problem with Div2B this round is that the score distribution and positioning is bad, and that's specific to this round. If the points for Div2B was same as Div2C and Div2D, then I think it would be reasonable.
And there is the catch. Even if you can think it as problem D, the outcome will not be the same. Because points will be deducted from both the versions. And most of the time harder version has a lesser point than the easier one. So thinking it as a D doesn't cover up the loss.
I am not against the breaking down of problems. Rather I think harder versions should be more valued than the easier ones.
The deducting of points is percentage based. So if you add up the total points from the easy and hard versions, they will decay at the same rate as a single problem which started with the total score of the 2 versions.
Someone who just solves the easy version might solve it faster, but it's worth less points anyway. It's like complaining that less points are deducted when someone takes 10 minutes to solve A than when some takes 40 mins to solve D.
In this contest solving the easy version is 500, while solving the harder version is 500+750=1250. Maybe the points should be higher when comparing to Div2C/D, but I don't see a fundamental problem here.
you have just said the point should be higher comparing to C or D. And that is exactly I am trying to say. Now you certainly don't want the easier version to have more points than now. So the harder version needs to be valued more. And keep in mjnd that when you think the problem as a whole, there is a huge risk factor involed, but the gain is very low
Time for antontrygubO_o to resign. What a disaster.
Has anyone successfully implemented DIV2 C using a graph ? I tried but it didn't work out.
I solved it using DSU but before that, I implemented it using graph but get WA.
DSU submission https://codeforces.net/contest/1384/submission/87914752
accesss_denied What was your approach? Can you please explain in brief?
First I check the condition of string A any characters are greater than string B then we print -1 else answer was possible.
If the answer is possible then we have to minimize the operations then I match the characters of string A to string B at the ith position. - if the same character occurs then we have nothing to do - if both strings characters are different at the ith position then I find the parent of both characters in a DSU. If the parent of both characters are same then we know we can change this character by directly changing it or indirectly then we did not have to use any operations. If the parent of both characters are different then we have to add s1[i] to s2[i] in DSU which shows these two characters are also interchangeable and increment our answer by 1. After processing whole strings we have our answer.
Just make an edge between characters in the same position between string a and b. If at any point char in
a
is greater than char inb
, it's not possible to convert. With the formed graph, treat it as an undirected graph. Then you at least needsz - 1
edges in each connected component for the conversion. Sum that up in all components and that's the answer.87904929
yaswanth I don't quite get the intuition behind this? Like, how did you get to this? And why does that work? I get this idea that we need to find the minimum spanning tree(taking all edges' weight as 1) for our original directed graph(but there's an issue in it). But I do not get it that how making the graph undirected solves our issue?
Here's the intuition:
u
=>v
. In other words, we want to get from say nodeu
to nodev
after removing the edgeu
=>v
. Which is only possible if the graph is still connected isn't it? You can't reduce the edges less than that. If you do that, at least one of the conversions will not be possible.nodes - 1
, basically a tree.The assumption about treating the graph as undirected is not required. All the above points apply for the graph in question too. I only treated it as undirected graph to make things easier.
If you think about it, the graph is a DAG. You can only get from smaller chars to bigger chars and there might be multiple ways of doing it. Let's take a graph like
a => b
,b => c
,a => c
. We want to eliminate all the possible ways and keep only one way. I just made the graph bidirectional (undirected) to detect the multiple ways easily. Now all the other multiple ways are kind of back edges right? It'd have been wrong had there been a cycle in the initial graph. Coz there's no cycle, the only cycle by making the DAG undirected is going to be an additional multiple way.Thanks, finally implemented it. Submission
Div 2 contests should have atleast one problem which is relatively easy for even lower rated contestants because it sets the momentum during the contest. It was very depressing to get wrong submissions in the first problem itself. Overall I felt the contest was interesting but some aspects need be worked on. I think everyone should cut some slack for the setters because they are inexperienced currently. They are only going to get better. Well done, Devil and team.
You can always solve problems in practice (10 mins before start of the round) to build momentum.
Come on. Come up with a better reason.
aryanc403 I understand that upsolving problems before the round helps build momentum but the bigger issue I felt was that even Div2 A was tougher than most Div2 contests given that it was for 500 points, Div2. C had almost 3x submissions as Div2 B1. That clearly shows that the problems should have been ordered better. I ended up +63 in spite of solving only Div2 A and Div2 C even though those who solved Div2 B1 clearly solved a much harder problem.
This contest gave me the highest rating change in my whole life. Still solved only two problems.
same here vro.
Accidents like this would happen if there is no tester with rating below 1900.
Lots of red people have <3 problems solved. What 1900??
I commented for div2 difficulty level It's no big deal for lots of red coders (as they are well experienced) to solve <3 problems, but for div2 people, it should be balanced as it is the majority in participating in contests, and neither they are well experienced to deal with problems like red coders. If there were two testers with rating 1700 and 1500, then they could have suggested the overviewing of difficulty of div2 contests
Tbh I'm interested in knowing how many testers managed to solve Div1 C.
Generally, the order is decided by looking at the performance of testers in virtual participation.
As far as div 2 testers are concerned. Most of them whom coordinators can trust want to participate instead of testing. That's the reason for 1000000 orange testers and almost 0 purple in div2 rounds.
Hello guys. I found different results in Codeforces IDE and my own pc's IDE with the very same code for problem A.
If you run the following C++14 code in both your pc and in CF's IDE you will get my point https://pastebin.ubuntu.com/p/F8BJvpVd4Q/?fbclid=IwAR1tmO_ZOxMt8lx9l3lSTRpLFzqzMgfkE15Xysz0xz7Aq3uoLUeKyVbwsg8.
Sample Inputs-
https://pastebin.ubuntu.com/p/Kvs8c52tqJ/?fbclid=IwAR1XKcjhr9_DwoRH0roeL7lGR_79oWRw8640Tnhumr98Y8gEw4sYjjpa_4o
Is there anyone to help me out on the reason?
Run this test case:
1 3 10 50 40
seems like.. Mike bhaiya found the solution of avoiding excessive users :D
Don't demotivate the writers. They did a very big mistake but I am pretty sure after such round this mistake will not be repeated. Yes problems were hard for div 2 and some problems like B were too lengthy to read.
I guess there are two groups of people who would take a lesson from this. One is writers and other is contestant.
As a contestant I learned that problem selection is too critical. For the first time I read all the problems during contest. I actually gave a shot to C before B and also gave a shot to D before B.
Second thing is when you feel like this contest is not well suited to participants, then it would be normal to get WA and even no solution at all. In this situation just try to read problems. Work on problem that you feel like it is possible to think of a solution. No matter if you solve only one problem during the contest. Even though you will get reasonable amount of rating change as the contest was more likely to not to suit the contestant.
I am not much experienced competitive programmer and also I am not worthy to be expert right now in my ratings. Infact I can't even stabilize the huge amount of rating plus I got in this contest but still honestly I think there is no point in criticizing the authors.
And for those who lost their rating, they will climb back in next contest as there would be a massive drop of rating in next contest to those who get higher rating this time. For example, Me. I got rank of around 691 but I don't think I would be able to do it for next time based on my current experience.
So just chill. Don't worry about rating they will be back if you perform good in next round.
I agree, it wouldn't have looked that scary if order was A -> C -> B1 -> B2. Kudos to the problem setters for such a beautiful set of problems, just ordering could be better next time :)
I solved that error.
Why are not people discussing how to solve questions, i generally try to go through comments to find interesting approaches. Today i don't seem to find any.
Can someone please explain how to solve div-2 E ? Thanks in advance.
how to solve div2B anyone ??
How to solve Div 2- B1 and B2? Can somebody help?
Hint for B1 : Make a matrix of size (2*k) x n
For Div2 B1 problem, for 7th input, 2nd testcase Jury's answer is 'No'.
test case is:
27 29 16
0 0 0 0 0 0 0 0 0 0 0 0 0 6 6 6 6 6 6 6 6 6 6 6 6 10 10
If we start from t=42 i.e. t=43 for first element, we can cross the sea. Can someone explain me.
I just figure out my mistake. Sorry!!!
Very Bad storytelling in div 2 B1 & B2. It's not good to feel like the director of a movie while writing the problem statements.
My real ranking is 217, but the rating change is based on 434. How to solve this problem?
Well,hacking phase rust in recently Div.2 round till the 32nd test case of A put forward in this round... In my opinion,I have no idea about the distribution before the round and things getting worse when I solve the problems. Apart from the distribution,still a good problemset~:)
Does anyone have a proof for the following greedy for Div2C/Div1A? It gets AC but I do not fully understand why.
First ignore all locations at which the two strings are already equal.
Find all the A's and try to increase every single A, by as much as we could (up to the point where we will exceed a character in the second string).
After this, there should not be any more A's in the string (after ignoring equal locations).
Do the same thing with B's, C's, and so on, ignoring equal locations each time.
See this comment for answer
Proof by matching lower bound. Let X be the set of characters that need to be changed at some point i.e. X = {character c | there exists i such that c = A[i] and A[i] < B[i]}. Any solution needs to do at least |X| operations. The greedy algorithm operates on each character of X exactly once, so it does |X| operations, so it's optimal.
In problem Div2-C, the tags are dfs,trees and dsu. My solution uses greedy. I am not able to prove it and wondering how it passed the system testing also. Can anyone uphack it or prove it? Thanks in advance.
This greedy solution works for a reason. I came up with same solution.
What you are doing is that you are traversing from
a to t
and along the way you are changing the value to the leat possible conversation to be done for that character.Suppose there is character say
c
and all its occurences are with characters sayd,f,h,r,t
so now you are converting allc
tod
, which is least possible conversation. Then withd
you convert to next characters and so on. Eventually you will reacht
at some point which will not have further conversations. So this is why your solution works and so does mine.Question : C2 Koa and the Beach
Can someone explain why the below test case below should have "NO" as a answer:
20 26 32
31 27 14 7 2 23 22 21 19 27 31 12 23 31 0 11 28 20 31 30
Problem A: Getting Wrong Answer for test 2 14th test case which is
3
0 1 1
my output:
aaa
baa
bba
baa
It says "wrong answer Words 1 and 2 have lcp 1 not 0 (test case 14)".
I have count to the 14th test case multiple time but can't find why am I wrong. Can someone explain to me?
Your last submission — 87935568
elif res[-1][i+1] == "a":
looks wrong. I will leave on you to find what is an issue here.I think this is your output.
now you can see yourself the error. I actually counted the output and your 14 output was this one.
I was saved by problem C
I wonder to see that many people keep an alternate account to show their anger. They should have the courage to show up their own account. All people related to the contest try hard to present a good contest, we should not discourage them or be angry to them. We can suggest our opinion in good manner.
unrated?
My screencast, ABE and then trying to solve D https://www.youtube.com/watch?v=rBgnvmd9Qak
Yeah we read all the problems as you highly encouraged.... >:(
Hey I participated in the contest and rating change was also reflected but now my rating is reverted back and site isnt showing that I participated! Is it a bug?
Is the rating temporarily rolled back? Or it became unrated
Have the rating changes been rolled back? My rating increased after this contest and seems to be back to where it was before.
Really hope not. This was my best round, and I got to specialist.
Same lol
[deleted]
A hard contest just motivates you to increase your level.
I think.I have missed a point. First one really motivated me and until the system testing last one also. When I solved at least one problem in each contest. But after the system testing I saw that pretest was so weak in the last contest.And this demotivated me.If pretest was strong then I could debug it.I thought my code was right.
Strong pretests might not be a mandatory feature of a good contest. If every time pretests are strong there hack will become lie. Since there is something called hack then pretests might be weak sometimes so that people can hack.
Also short statement might not be a mandatory ask for good contest. Solving problems with big statement is also a skill which one should practice.
But making B harder than C,D due to boring statements is not a good practice i think.
Actually I'm confused. Why did this contest get such negative comments ._.
I've only played very little rounds so I still don't know how to judge if a contest is "good" or "bad".
Thanks~
Very demotivated after reading the statements of this contest. Was thinking about stop participating in contests for past few days. This contest showed me I need to stop taking part in contests now and learn new things.
Adios Guys for next few days!
I think 2 bad contests (in terms of difficulty levels and somewhat otherwise, like weak pretests) when most of the testers were red somewhat indicates that it is difficult for the reds to gauge the difficulty of the problems that are much easier for them. It is obvious but it still needs to be said as these contests could have been much better with the right problem order. The problems were so good, just the right order would have made the contest awesome.
Please chose testers wisely, as for me C and D were relatively easier than B2. People lost there rating because of the incorrect score distribution. For Div-2 please have some <1900 raters also for testing.
Although I'm a beginner, but div 2 was a bit challenging. The problems gave me a hard time.
Why is the calendar showing codeforces Round 659 Div.1 on 25th that is today, everybody knows it was yesterday (https://codeforces.net/calendar)
tourist
Can we get to know the problem rating mechanism? I wished to know how is Div1 B1 equivalent to Div2 D, just out of curiosity. (In contest submissions for Div2 B1 ~ 800, Div2 D ~ 150, Div1 B ~ 950).
Love Cuba from VietNam <3