### Warawreh's blog

By Warawreh, history, 8 months ago,

Hi fellow Coders!

Shanks, Salem_Alwarawreh and I are glad to invite you to take part in Codeforces Round #699 (Div. 2), which will take place on Feb/05/2021 17:35 (Moscow time). Round will be rated for participants with rating less than 2100. Participants from the first division are also welcomed to take part out of competition.

You will be given 2 hours to solve 6 problems, each problem has a picture and a story above it. The stories are skippable if you want to focus on the real problems.

We would also like to thank:

Score distribution will be announced before the start of the round, hopefully.

We hope you like the problems and enjoy solving them!

UPD: Scoring is 500 — 750 — 1500 — 2000 — 2500 — 3000

UPD: Editorial

UPD: Congratulations to the winners

Div1 :

Div2 :

Thank you all for participating!

• +552

 » 8 months ago, # | ← Rev. 2 →   +22 Finally an expert in problem setting :)
•  » » 8 months ago, # ^ |   +86 I don't know what's wrong with your comment. You mentioned a rare fact and some people just demotivated you. A couple of contests before I wrote a fact that if code is not optimized then it shouldn't pass pretest and I got negative contributions for saying that. And a red coder just puts a dot and he gets a 100 contribution. This is what it is now.
•  » » » 8 months ago, # ^ |   +95 yes bro I am also wondering why I am getting too much downvotes :(
•  » » » 8 months ago, # ^ |   -43 Codeforces is a huge competitive programming community. People expect some worth in reading comments. Useful comments may get hidden by "not so useful" comments/facts like yours. So in my opinion, we should comment only if it's highly necessary.
•  » » » » 8 months ago, # ^ | ← Rev. 2 →   +100 No one expects anything useful in comments before the contest.
•  » » » » 8 months ago, # ^ |   +12 1-gon usually just puts a dot, and he ridiculously got first in contributions, while Errichto did hundreds of explanatory comments and helped a lot of people, and he really deserves his place.
•  » » » » 8 months ago, # ^ |   +1 You are right! Many new coders like me hesitate to ask something in the comments as maybe it is very trivial and easy for some people and could lead to a downvote! (I don't want to have negative contributions!) [ Please don't downvote on this comment :) ]
•  » » » » » 8 months ago, # ^ | ← Rev. 2 →   +1 Why are you afraid of negative contribution? It means nothing. Contribution points are not intended to scare you off from seeking help from the community.
•  » » » 8 months ago, # ^ | ← Rev. 2 →   -19 And about the thing u said about red coders is not always true. example: http://codeforces.com/blog/entry/86048?#comment-738203
•  » » » » 8 months ago, # ^ |   +5 I haven't said always... And about the worth reading part, see below u will find it's not always about knowledge sharing or "highly useful" comments. You should have checked this comment section below first before replying. You should have.
•  » » » » 8 months ago, # ^ |   +1 I knew that you are gonna point to HealthyUG's comment. XD
•  » » » 8 months ago, # ^ |   +12 But why do you care about contributions? Is it worth having +100 contributions( What you would do with those contributions trade them with money? ), rather we are here for CP and most importantly to enjoying solving problems.
•  » » » » 8 months ago, # ^ |   -8 No, I cared once but not anymore. I thought people with more contribution points are providing something that others aren't. So I even tried following someone like Errichto.
•  » » » » » 8 months ago, # ^ |   0 See there is a difference between doing something for contribution and getting contribution for what you did.
•  » » » » » » 8 months ago, # ^ |   -8 Yeah... for saying that if my code isn't optimized then it shouldn't pass protests. And after that, hearing, nearly thousands of submissions failed in system test because of TLE. What do you think, was I smiling?
•  » » » 8 months ago, # ^ |   0 So true i have been trying to comment from 3 past contests and all i get is downvoted because i am green. I even commented on this blog but i dont know what was so offensive in this below comment to get down voted.as just a noob participant hoping if my comment gets upvote or i am able to solve c in the contest... either will make me happy.
•  » » » 8 months ago, # ^ |   0 I said good luck to everyone and got negative feedback for that. I don't know why
 » 8 months ago, # | ← Rev. 2 →   +63 As a non tester, I just commented to make I_Love_YrNameCouldBeHere's comment appear further down.
•  » » 8 months ago, # ^ | ← Rev. 3 →   +40 As a tester, :(P.S: Amazing Round! Recommending everyone to participate!
•  » » » 8 months ago, # ^ |   -47 as just a noob participant hoping if my comment gets upvote or i am able to solve c in the contest... either will make me happy
•  » » » » 8 months ago, # ^ |   -63 as a noob participant considering my duty to upvote and help other noobs
•  » » » 8 months ago, # ^ |   -6 sure :)
•  » » » 8 months ago, # ^ |   0 Sure!!!
 » 8 months ago, # |   -69 As a non tester, I just commented to make SlavicG's comment appear further down.
 » 8 months ago, # | ← Rev. 2 →   -53 As a non tester, I_Love_YrNameCouldBeHere orz
 » 8 months ago, # |   +58 Jordanian round ❤
 » 8 months ago, # |   +360
•  » » 8 months ago, # ^ |   +55 That's real.
•  » » » 8 months ago, # ^ |   +5 omg meet you huh.Howevr F is too hard...
•  » » » » 8 months ago, # ^ |   +3 Kevin090228 became Master at the age of 11!stO Kevin090228 Orz
•  » » » » » 8 months ago, # ^ |   +5 WTF! mind blown. There's crazy talent on this site Lol. I'm a decade older than he is. gj Kevin.
•  » » » » » » 8 months ago, # ^ |   +3 Yeah.I'm a year older than him but he is much stronger than me.
•  » » » » » » » 8 months ago, # ^ |   +5 Wow, good job to you too, keep it up! An advice I'll give is, if you'd like, try and build some projects too with your skills. I do wish I had started programming a bit earlier, not that I'd have been as good as you guys, but that would have been fun. I started in college.Above all, keep having fun, even if you don't like building any projects.
•  » » 8 months ago, # ^ |   -38 Me, an intellectual: How to solve F?
•  » » 8 months ago, # ^ |   0 How to solve A? :)
•  » » » 8 months ago, # ^ |   +40 I don't even want to see what that dog looks like.
•  » » 8 months ago, # ^ |   +24 Your memes are great.
•  » » 8 months ago, # ^ |   -18 Me on problem B: Got WA on pretest 2 :(
•  » » » 8 months ago, # ^ |   +1 how to solve problem B
•  » » » » 8 months ago, # ^ |   0 If one boulder falls into the collection system,the ones after it will end up in the same place.We can simulate the boulders' actions until one falls into the collection system.Then we can simply output -1.If no boulders fall into the collection system,we can just output the result of the last boulder.There will be at most 100n boulders that end up on a mountain,So this is an $O(100n)$ solution.
•  » » » » » 8 months ago, # ^ |   0 thanks bro <3
•  » » 8 months ago, # ^ |   +1 Absolutely your are true.
•  » » 8 months ago, # ^ |   +1 then comes me How to solve B?
•  » » » 8 months ago, # ^ |   +1 wrong test
•  » » 8 months ago, # ^ |   0 How to solve C :<
•  » » » 8 months ago, # ^ |   0 Is this The Most Handsome Dog pageant?
»
8 months ago, # |
Rev. 3   +28

Thank U Shanks, Warawreh & Salem_Alwarawreh so much for setting problems on this round, I am sure the problems are gonna be so much fun to think of, also to solve ^^ Can't wait to participate!

# Jordanian round ❤

 » 8 months ago, # |   +16 Even though final exams, we don't have contest prepared by our neighbors everyday.Jordanian round ❤
 » 8 months ago, # |   0 Thanks Warawreh for preparing Div.2 contest.
 » 8 months ago, # |   +10 As a participant, I thank Khaled for drawing pictures for all the problems.
 » 8 months ago, # |   +30 Looking forward to the colorful pictures!
 » 8 months ago, # |   +14 Thanks for the stories and also making them skippable. They are really fun to read, but only when the contest is over :D
 » 8 months ago, # |   +44 We definitely need more picture problems :) Also, please lesser of these
 » 8 months ago, # | ← Rev. 3 →   +26 It's a joyful thing to me to see Arabic round again. Hope our contribution in problem solving community keep it's progress and see more Arabic rounds in the future.I am realy intersted to praticipate in your round ,thank you guys.
 » 8 months ago, # | ← Rev. 2 →   -34 I wonder who's gonna read all those interesting stories?
•  » » 8 months ago, # ^ |   +155 Div. 1 participants)
•  » » » 8 months ago, # ^ |   0 XD
 » 8 months ago, # | ← Rev. 4 →   -34 Stories are skippable :) fun to read them after contest
 » 8 months ago, # | ← Rev. 2 →   -8 It's gonna be Haki round ⚔
 » 8 months ago, # |   +27 It feels so good having a contest in your birthday when you're lifeless and have nothing to do.
 » 8 months ago, # |   +15 My Pledge for round #699: I will solve at least Three problems! And then declare the Fourth great Ninja War!
•  » » 8 months ago, # ^ |   +3 No Worries Shanks will be there to end the war once kaguya finishes you :)
 » 8 months ago, # |   -29 We hope you like the problems and enjoy solving them!How to enjoy when one is not able to solve them? reading stories xd?
•  » » 8 months ago, # ^ |   +37 The more you think about your delta, the less interesting the round becomes.Play your favorite song before the contest, have a sportsman spirit, and try your best not to think about failure/success during the competition.Have fun solving problems :D
•  » » » 8 months ago, # ^ |   +3 Playing my favourite song before the contest actually worked in my last contest!!
•  » » » 8 months ago, # ^ |   +18 Play your favorite song before the contest Doesn't it gives earworm sometimes ? It ruins the concentration .
•  » » » » 8 months ago, # ^ |   +1 Not during the contest but before the contest!
•  » » » » 8 months ago, # ^ |   +2 You are right, though I can't remember having this issue. It seems like for me, the problems are too interesting to be distracted from :)
 » 8 months ago, # |   +22 As a tester, I recommend enjoying problems!
 » 8 months ago, # |   -19 Shanks == Thanks :D
•  » » 8 months ago, # ^ | ← Rev. 3 →   +4 std::string Shanks("Shanks"); Shanks.front()++; Shanks == "Thanks"; 
•  » » » 8 months ago, # ^ |   -32 yo how can u add one to a letter, this would runtime error.
•  » » » » 8 months ago, # ^ |   0 each character has a unique ASCII code where The 'S' ASCII code is 83 and the 'T' ASCII code is 84 So char('S'+1)=='T'.
•  » » » » » 8 months ago, # ^ |   -13 I guess c++ is weird.
•  » » » » » » 8 months ago, # ^ |   +4 You came to the wrong place saying this. :)
•  » » » 8 months ago, # ^ |   0 Best comment seen in a while... eugalt
•  » » » » 8 months ago, # ^ |   0 Thanks. I've been enjoying watching the vote count bouncing to positive territory after falling down to -20. :)
 » 8 months ago, # |   -9 As a participant, good luck to everyone!
 » 8 months ago, # |   -14 thanks for the skippable stories :hearts:
 » 8 months ago, # |   -22 Pictorial explaination of all the problems, nice !! It seems an interesting round.
 » 8 months ago, # |   -13 As a noob , participatin’ in such a div gonna help me improving my PS skills?
 » 8 months ago, # |   +56 As a tester, I wish everyone good luck!
 » 8 months ago, # |   -30 As a tester, I can confirm that the problems are very hard.
 » 8 months ago, # | ← Rev. 3 →   -57 Downvote this comment for ancient goodluck curse !
 » 8 months ago, # |   -30 As a participant, good luck to everyone!
 » 8 months ago, # |   -30 I hope the problems tag are data structures/algorithms instead of constructive.
 » 8 months ago, # |   +110 Irrelevant
 » 8 months ago, # |   +4 As a participant, I'm happy with the frequency of the contests! ;)
•  » » 8 months ago, # ^ |   0 As long as you are happy with the frequency of your rating increases. ;)
 » 8 months ago, # |   +7 Hope it will be a good round
 » 8 months ago, # | ← Rev. 2 →   -19 Hopefully, everyone will enjoy this contest. Wish me good luck. I'm new but still learning.....
 » 8 months ago, # |   0 Hope I will again become pupil. Finger Crossed!!!
•  » » 8 months ago, # ^ |   0 Same bro :3
 » 8 months ago, # | ← Rev. 3 →   0 What's the point of stories in problems if they are skippable? Like tourist mentioned in one of his streams, the stories must sync in with the problems themselves, similar to like Google Codejam's problems. Otherwise, why not just remove stories altogether for the problems that do not require such?In any case, hopefully, the contest will be enjoyable.
•  » » 8 months ago, # ^ |   +18 It has happened where the story and the statement do sync up, but the authors just choose to separate it to make it easier for participants. They separate the informal statement and the formal one, so participants can choose whether they want to read it or not. I personally like this choice, because it makes the problems more enjoyable for the participants (and the authors to write), without getting in the way of the actual problem solving if the participant doesn't actually want to read it.
 » 8 months ago, # |   +17 .
 » 8 months ago, # | ← Rev. 3 →   -9 Hello.
•  » » 8 months ago, # ^ |   +6 Go to your profile's blog, and create a new blog in the corner .
•  » » » 8 months ago, # ^ |   0 Oh, thanks you.
 » 8 months ago, # |   -32 Tonight I can write the saddest lines.Write, for example, “The night is starry and the blue stars shiver in the distance.”The night wind revolves in the sky and sings.Tonight I can write the saddest lines. I loved her, and sometimes she loved me too.Through nights like this one I held her in my arms. I kissed her again and again under the endless sky.She loved me sometimes, and I loved her too. How could one not have loved her great still eyes.Tonight I can write the saddest lines. To think that I do not have her. To feel that I have lost her.To hear the immense night, still more immense without her. And the verse falls to the soul like dew to the pasture.What does it matter that my love could not keep her. The night is starry and she is not with me.This is all. In the distance someone is singing. In the distance. My soul is not satisfied that it has lost her.My sight tries to find her as though to bring her closer. My heart looks for her, and she is not with me.The same night whitening the same trees. We, of that time, are no longer the same.I no longer love her, that’s certain, but how I loved her. My voice tried to find the wind to touch her hearing.Another’s. She will be another’s. As she was before my kisses. Her voice, her bright body. Her infinite eyes.I no longer love her, that’s certain, but maybe I love her. Love is so short, forgetting is so long.Because through nights like this one I held her in my arms my soul is not satisfied that it has lost her.Though this be the last pain that she makes me suffer and these the last verses that I write for her. Pablo Neruda
•  » » 8 months ago, # ^ | ← Rev. 2 →   -26 Me but for orange rating.
 » 8 months ago, # |   +13 The contests are very rewarding I will be participating in the upcoming contests.
•  » » 8 months ago, # ^ |   0 Yeah, a nice contest. What is your age
 » 8 months ago, # | ← Rev. 2 →   0 Seems like the contest is going to be extremely hot. Personally, I Recommend everyone to participate. Thanks to Warawreh, Shanks, and Salem_Alwarawreh.
 » 8 months ago, # |   +1 Hope to be Master
•  » » 8 months ago, # ^ |   0 All the best man.
 » 8 months ago, # |   +13 Shanks, Salem_Alwarawreh and Warawreh thankyou to all of you for another contest.
 » 8 months ago, # | ← Rev. 2 →   -44 .
 » 8 months ago, # |   -13 Expecting the problems difficulty order to A
•  » » 8 months ago, # ^ |   +3 And Shorter queues as well..
 » 8 months ago, # |   +3 All the best to everyone participating in the contest.
 » 8 months ago, # |   0 trying to become specialist after this contest.
 » 8 months ago, # |   0 If existing muti-solve in problemC, just output a random one?
•  » » 8 months ago, # ^ |   +1 Any valid answer is ok.
 » 8 months ago, # |   0 Hello who can point me to a good tutorial covering graphs topic?
•  » » 8 months ago, # ^ |   0 Go for Competitive Programmer's Hand book by antti laaksonen. There graphs are explained very well. the you can simply try for simple problems.
 » 8 months ago, # |   0 Tasks was interesting. Thank you
 » 8 months ago, # | ← Rev. 2 →   0 In problem C — Can two planks be of the same color? edit: just saw the examples, they can
 » 8 months ago, # | ← Rev. 2 →   -24 .
 » 8 months ago, # |   +29 Why are C's and D's implementations so dirty?
•  » » 8 months ago, # ^ |   +30 don't know about C, but D wasn't implementation heavy.
•  » » » 8 months ago, # ^ |   +38 C wasn't too.
•  » » » » 8 months ago, # ^ |   0 I agree
•  » » » » 8 months ago, # ^ |   +17 C wasn't dirty, but it was confusing... I couldn't find error in my code... :sob:
•  » » » 8 months ago, # ^ |   +1 How to solve D?
•  » » » » 8 months ago, # ^ | ← Rev. 6 →   +7 For odd $m$, we can see that any sequence of the form $i, j, i, \ldots$ is valid as it will either be something like $ab \ldots ba$ or $a \ldots a$.For even, lets notice that a sufficient condition for the answer to exist is at least one of the following two conditions: A node pair of nodes $x, y$ such that $x \rightarrow y$ and $y \rightarrow x$ are coloured similarly (the sequence will be of the form $a \ldots a$ or $b \ldots b$) A node $x$ such that it has an edge $i \rightarrow x$ into it and an edge $x \rightarrow j$ out of it with the same colour, then $j \rightarrow x$ and $x \rightarrow i$ will have the opposite colour (or condition 1 will hold). So we can just generate a sequence of the form $aa(bbaa)*$ or $(abba)*$ as needed to satisfy $m \mod 4 = 2$ or $m \mod 4 = 0$ respectively. Clearly if neither of these conditions hold, any sequence generated will be of the form $abab\ldots$ or $baba\ldots$, so it is necessary as well.While unneeded, it can also be shown that this condition will always exist for a complete graph of $3$ or more nodes.Out of curiosity, is there something wrong with this proof for general graphs or is problem D just a complete graph for the sake of elegance? I think this find the answer if it exists for any arbitrary graph given that both directions exist for each edge in $O(n + m)$.
•  » » » 8 months ago, # ^ |   0 How to solve D?
•  » » » » 8 months ago, # ^ |   +3 Case working. 1. if m%2 = 1, it is possible.(1, 2, 1, 2, ..) 2. if i -> j = j -> i, it is possible (i, j, i, j, ..) 3. if n = 2 and m is even, it is impossible 4. if n >= 3 and m is even, it is always possible. It needs only 3 vertices
•  » » 8 months ago, # ^ |   +1 I can see how the implementation for D could be tricky, but C's implementation seems fine, the core part of the logic could be coded in 20-30 lines using an array of vectors.
•  » » » 8 months ago, # ^ |   0 In D, is ans always possible expect for the case when n=2 and m%2=0?
•  » » » » 8 months ago, # ^ |   0 Yes.
 » 8 months ago, # |   +10 2 WA submissions on C for writing n instead of m and half an hour to find this bug that feels like shit especially I fu**ed in B (dying sad dog picture)How to solve B?
•  » » 8 months ago, # ^ |   0 brute force
•  » » 8 months ago, # ^ |   +3 After some boulders are thrown , the heights of mountain will become such that no case of hi
•  » » » 8 months ago, # ^ |   0 that's what I did I'm really pissed off I have no idea why it's WA
•  » » » » 8 months ago, # ^ |   0 Same bro I keep getting WA on test 2
•  » » » » 8 months ago, # ^ |   0 Bro You know more than me, but I think your code is computing the total need element to level from right to left on every term smaller than the next one. But you have to give the solution as sequence way for eg: 10 7 1 1 1 1 1 1 1 1 1 3 your code will give 6(for 9 k-2, for 8 k-2,for 7 k-2 and for 6 k-2) now k=-1; but the answer is 3(for 9 k--,for 8 k--,for 7 k--,for 6 k--,for 5 k--,..,for 3 k--) now k=0; it your code you can change a[0]=INT_MAX; and make it 1 based index then, if(i==n){co "-1\n";break;} if(a[i]
•  » » 8 months ago, # ^ |   +2 As heights are less than or equal to 100 in the worst case (1,1,1..100) after throwing around 10000 stones all remaining stones will fall into waste system. So if k is greater than 10^4 answer is no else just brute force.
•  » » » 8 months ago, # ^ |   +1 idk about the limit when the answer will always be "NO" . I was too lazy to find out so i just break my loop when my counter reached 10^4.
•  » » 8 months ago, # ^ |   0 use 2 pointer
•  » » 8 months ago, # ^ |   0 Your comment made me realise the bug.AC after contest. Lol FML
•  » » 8 months ago, # ^ |   0 Simple simulation.One fact to know is that once an boulder falls into the collection system,the ones after it will also do that.
 » 8 months ago, # |   +56
 » 8 months ago, # |   +49 How to solve E?
•  » » 8 months ago, # ^ | ← Rev. 2 →   0
 » 8 months ago, # |   -9 bad experience
 » 8 months ago, # |   +2 Can someone give a test-case for which my code fails for problem C WA_CODE
•  » » 8 months ago, # ^ |   0 did u check if the map was empty at last?
•  » » 8 months ago, # ^ | ← Rev. 2 →   +13 This is invalid input. See a fixed input in a comment below.Try this: 1 2 2 2 1 1 1 3 1 The only possibility is to assign both painters to the first plank.
•  » » » 8 months ago, # ^ |   0 Can you tell me a test case for which my code fails?
•  » » » » 8 months ago, # ^ | ← Rev. 2 →   +1 This is invalid input. See a fixed input in a comment below.Try this instead: 1 2 2 1 2 1 1 3 1 Both painters should have chosen the second plank.
•  » » » » » 8 months ago, # ^ |   0 Anyways i figured out bug in my code due to this test case and got AC. Thanks
•  » » » 8 months ago, # ^ |   +5 Is this a valid test case? Cause $1 \le c_j \le n$
•  » » » » 8 months ago, # ^ |   0 Right, I missed that restriction.How about this instead 1 3 2 1 2 1 1 1 1 3 1 
 » 8 months ago, # | ← Rev. 2 →   +13 A great and well balanced problem-set. Also, C was a nice question, although it took me an hour to implement it and fix bugs :(.
 » 8 months ago, # |   0 I think who passed the first test case of the c problem he must pass all pretests
•  » » 8 months ago, # ^ |   +1 No. I pass the first test case and wrong in test case 2 :D
•  » » » 8 months ago, # ^ |   0 Same, my logic seems fine tho. Probably a stupid bug im missing
•  » » 8 months ago, # ^ |   0 Is that the case because if pretest are weak many people's solution will fail on real test in these implementation heavy questions
•  » » 8 months ago, # ^ |   0 The NOs in pretest 1 can be identified with just observing whether the color of the last painter appear in the required array. This is insufficient alone.Pretest one does not cover the possibility that there is not enough painters to paint all fences to the required color.For me, I still have not identified all the cases where it is a NO. I return NO if my own checker finds a fault in my constructive solution. This passed the pretests.
 » 8 months ago, # |   -9 I have codeforces account and wanted to participate in above contest. But I haven't registered for it. Why CodeForces don't allow to participate unregistered coders like me in Contest.
•  » » 8 months ago, # ^ | ← Rev. 2 →   0 According to rules: If you are late to register in 5 minutes before the start, you can register later during the extra registration. Extra registration opens 10 minutes after the contest starts and lasts 20 minutes.
 » 8 months ago, # |   +16 B turned out to be a bluff
 » 8 months ago, # |   0 I was so close on solving D just did not have had the time... You just had to notice that when there is no such pair that edge[i][j] = edge[j][i] and when m%2 != 1 (which are the 2 conditions that one can solve very easily with constructive solutions) then you could see that if you had 3 vertices again a constructive solution is possible.
•  » » 8 months ago, # ^ |   0 can you tell me what is wrong with this submission for problem C https://codeforces.com/contest/1481/submission/106608493
 » 8 months ago, # |   +2 Loved the art! Thanks for a great contest!
 » 8 months ago, # |   +1 One of the best CF rounds I have recently taken part in. Finally, we had WriteSomeCodeForces rather than omnipresent Notice1E9ThingsAndWriteOneLineForces. Kudos!
•  » » 8 months ago, # ^ | ← Rev. 2 →   +7 More like ThinkNothingAndWriteCodeMindlesslyForces. At least till C.
•  » » » 8 months ago, # ^ |   +5 Are you sure about "codeMindlessly" in C ?
•  » » » » 8 months ago, # ^ |   0 Pretty sure.
 » 8 months ago, # | ← Rev. 2 →   0 Can someone please provide me a case where my Solution of C is failing? I tried for 45 minutes but couldn't find one :(
 » 8 months ago, # |   0 Can anyone help me find why my code for B always get TLE? I thought the complexity for my code is O(10^6) Thanks ;w; http://codepad.org/Nf4Rkb1n
•  » » 8 months ago, # ^ |   0 Is it the problem of n=1?
•  » » » 8 months ago, # ^ |   +1 Exactly.
 » 8 months ago, # | ← Rev. 2 →   0 May I know what is pretest 2 of B?UPD: Managed to solve it, my brute force was not brute force enough and missed some corner cases sigh
•  » » 8 months ago, # ^ |   0 Hey, please have a look at my latest solution. I'm unable to figure out why is it failing test 2. Would be of great help!
•  » » » 8 months ago, # ^ |   0 I think you misread the question? With the following input 1 6 4 0 0 0 0 0 100 the correct output is 2. The four thrown boulders will go to the 5th, 4th, 3rd, and 2rd mountains in that order.
 » 8 months ago, # |   +1 Nice pictures in problems! I like them.
 » 8 months ago, # |   0 How to solve B?? I was getting TLE on 2nd test case.
•  » » 8 months ago, # ^ |   0 Brute force worked for me, although since k can be large you have to stop as soon as a rock goes off the end.
•  » » 8 months ago, # ^ |   0 check if your code goes wrong when n=1
 » 8 months ago, # |   +16 Very nice problems set in this contest. Can anyone explain how to solve E?
•  » » 8 months ago, # ^ |   0 A dp approach:https://codeforces.com/contest/1481/submission/106600288
 » 8 months ago, # |   0 In part D , what was needed to handle the case when there is no such pair of nodes (i,j) such that a[i][j] = a[j][i] and M was an Even number. I think this was the entire question , because rest all part were quite easy. How to solve for this case?
•  » » 8 months ago, # ^ |   +1 Hint 1: Suppose a valid path exists when m is even. This implies that there must exist some nodes u, v, w such that a[u][v] = a[v][w] (Think of the middle two characters in palindromic string).Hint 2: Consider the case when you start at u, and the case when you start at v, and only travel between these three nodes in a cyclic fashion.
•  » » » 8 months ago, # ^ |   0 Yeah, thanks lavish315 for this. Now, it is evident that if there are 3 such nodes such that a[u][v] = a[v][w]. I can complete (M-2)/2 visits between (u,w) and then end at either u or w. Take 2 more steps to go to the alternate vertex w or u. And then , continue another (M-2)/2 visits.
•  » » » 8 months ago, # ^ |   0 I was wondering the proof of the existence of (u,v,w) is quite satisfactory. But , if such a (triplet)/(a cycle with all edges of same letters) does not exist , can we say for sure that solution does not exist?
•  » » » » 8 months ago, # ^ |   0 Yes, we can claim so. Consider m = 2k, and let say there is no such triplet. Assume that a possible path exists. Then, again by the same logic, character at position k and k+1 are same, and by contradiction, this implies that such a triplet/cycle exists.
•  » » 8 months ago, # ^ |   +3 You can proof that there must be a method in three random vertices
•  » » 8 months ago, # ^ |   0 If m is even and If there are 3 edges that form the pattern aabb/bbaa when you go from 1-2-3-2-1 then answer exists and you just have to repeat the pattern or else answer is No.
•  » » 8 months ago, # ^ |   0 Hint 1: You're right, that's the case you need to figure out to solve the problem.Hint 2: In this case, consider 3 vertices and the path between them.Hint 3: In this case, if there exist distinct i,j,k such that a[i][j] = a[j][k] then does it work? What values of M does it work for?Hint 4: Can you make it work for the remaining values of M?Extra credit: What about if they don't exist, can you prove that it doesn't work? Even stronger, you can actually prove that for n>=4 there will always be i,j,k that satisfy the condition.
 » 8 months ago, # |   0 Can anyone tell me whats wrong with my code (Problem B) https://codeforces.com/contest/1481/submission/106604962
 » 8 months ago, # |   0 Anyone please help me where my solution B is wrong -->https://codeforces.com/contest/1481/submission/106591564
•  » » 8 months ago, # ^ | ← Rev. 2 →   0 Check this case: 1 3 5 3 4 8 The answer should be 1.
•  » » » 8 months ago, # ^ |   0 why should it 1 i think for 3 4 8 1st b 4 4 8 2nd b 4 5 8 3rd b 4 6 8 4th b 4 7 8 5th b 4 8 8 it will stop at i=1 itself
•  » » » » 8 months ago, # ^ |   0 The sequence should be like: 3 4 8 (initial) 4 4 8 (1st) 4 5 8 (2nd) 5 5 8 (3rd) 5 6 8 (4th) then the 5th one will stop at 1.
•  » » » » » 8 months ago, # ^ | ← Rev. 2 →   0 Hey, please can you explain why is this code failing in TC 2? Would be of great help!! Spoiler#include using namespace std; #define ll long long int main(){ ios::sync_with_stdio(0); cin.tie(0); int t; cin>>t; while(t--){ ll n, k; cin>>n>>k; vector A(n); for(int i=0; i>A[i]; int flag=0; ll res; ll mx= A[n-1], diff=0; for(int i=n-2; i>=0; i--){ if(A[i]diff) cout<<-1<<"\n"; else{ int i=0; while(i0){ if(A[i]
•  » » » » » » 8 months ago, # ^ |   0 i did the same mistake lol u are subtracting directly ai+1-ai from k which will give wrong ans take k=5 1 1 1 1 6 1 1 1 2 6 1 1 2 2 6 1 2 2 2 6 2 2 2 2 6 son on :(
 » 8 months ago, # |   0 Really loved the problems! While I didn't really give my best performance (something close to the opposite actually xP) but the experience was definitely appreciable.Huge thanks to everyone involved in the creation and conduction of the contest! :)
 » 8 months ago, # |   +2 I felt this round to be more implementation based !!
 » 8 months ago, # |   -52 Problem D is a trash and third-class problem. Stop setting such brain-dead problems. They take away time from the really interesting problems.Pretty sure this garbage D would have been rejected if Anton was the coordinator.
•  » » 8 months ago, # ^ |   +4 problem C wasn't world class too . It was also just mess implementation .
•  » » 8 months ago, # ^ |   +33 Bruh problem D is very anton-style. Your code is just awful.
•  » » » 8 months ago, # ^ |   +13 Most of it is just copy-paste. I am not angry about the code length. I am disappointed that it was just very obvious and all you had to do was code.
•  » » 8 months ago, # ^ |   +12 Why? since when are (prove->code) problems brain-dead third class problems?
•  » » 8 months ago, # ^ |   +50 I liked problem D, I don't see what here is copy-paste or brain-dead. Even more, I liked DEF, thanks setters for the contest!
 » 8 months ago, # |   +26 Got to say, a great contest finally after a long time. Loved the problemset !
 » 8 months ago, # |   0 How to solve D ??and Is CF little bit slow to browse ??
•  » » 8 months ago, # ^ |   0 You can proof that there must be a method in three random vertices
 » 8 months ago, # |   +7 I didn't like problem D because even though I had the entire idea it took way too long to code it. I don't find these types of problems enjoyable. If they are interesting that is another case. But it was neither interesting nor easy to code.
 » 8 months ago, # |   +6 Despite having done horribly in this contest, I'd like to say that this was a nice contest!
 » 8 months ago, # | ← Rev. 2 →   +41 In problem A & C there are sentences like You can print each letter in any case (upper or lower). but in problem D there's not. This is only a minor issue but i think it's better to be consistent about the case of YESs and NOs.
 » 8 months ago, # | ← Rev. 2 →   0 Why h in B is not <= 10e9 too? With h<=10 it's just straight simulation, Div2B should be something more difficult than it.
 » 8 months ago, # |   +6 Loved the problems... This went too good to be true for me...
 » 8 months ago, # |   +14 When I saw problem B and see 1
•  » » 8 months ago, # ^ |   +3 it took me the entire contest and I realized it in the last second :/
•  » » 8 months ago, # ^ |   0 Even with h <= 10^9 code is simple enough.
•  » » » 8 months ago, # ^ |   0 Hey, can you please explain why my code is failing in TC 2? Would be of great help!! Spoiler#include using namespace std; #define ll long long int main(){ ios::sync_with_stdio(0); cin.tie(0); int t; cin>>t; while(t--){ ll n, k; cin>>n>>k; vector A(n); for(int i=0; i>A[i]; int flag=0; ll res; ll mx= A[n-1], diff=0; for(int i=n-2; i>=0; i--){ if(A[i]diff) cout<<-1<<"\n"; else{ int i=0; while(i0){ if(A[i]
•  » » » » 8 months ago, # ^ |   0 for 3 2 1 1 3 your code will give 2, but correct ans is 1
 » 8 months ago, # | ← Rev. 2 →   0 I'm lost 1 hour and 30 min to find the bug in problem C and I can't find it :(. I can AC D but I'm lost too much time in problem C :( This is my big lesson. Specialist time.
 » 8 months ago, # |   0 one step back to accelerate (rating -23)
•  » » 8 months ago, # ^ |   0 They updated ratings?
•  » » » 8 months ago, # ^ |   0 no you can see your rating changings with cf-predictor
 » 8 months ago, # |   0 https://codeforces.com/contest/1481/submission/106608013 Div2C could someone kindly provide me a test which causes wrong answer?
•  » » 8 months ago, # ^ | ← Rev. 2 →   0 1 3 2 3 3 3 5 5 5 5 5 The answer should be NO in this
•  » » » 8 months ago, # ^ | ← Rev. 2 →   0 No its an invalid test case.b[i] <= n and c[j] <= n
•  » » » » 8 months ago, # ^ | ← Rev. 2 →   0 Ok my bad, take 1 3 2 3 3 3 2 2 2 2 2 Answer NO
•  » » 8 months ago, # ^ |   0 Try this: 1 2 1 1 1 2 2 2 
•  » » » 8 months ago, # ^ |   0 thank you! i fixed it and got AC https://codeforces.com/contest/1481/submission/106615717
•  » » » » 8 months ago, # ^ |   0 Lol just look at my time 1996ms Thin ice :)
 » 8 months ago, # | ← Rev. 2 →   0 Why am I getting Memory Limit exceeded on this? Any help?Submission: 106602826
 » 8 months ago, # |   0 Need help for problem D,case 1: i -> j is same as j -> i (possible for any length) case 2: i -> j is not same as j -> b (possible for odd length) case 3: i -> j is not same as j -> b and m is 2 (not possible) case 4: i -> j is not same as j -> b and m is even, possible, but how to add vertices ?
 » 8 months ago, # | ← Rev. 2 →   -17 106611585This is my code for Round 699 div 2 task b. I have used dynamic memory allocation for the array. In this approach i am getting memory limit exceeded. Whereas the same approach with static memory allocation works just fine. I know that i haven't deallocated the memory after every iteration but it was given that sum of n over all test cases is less than 100 so i dont see why deallocating that array after every iteration is required because at the end of the day i am only making a long long array of size 100Please Help and point out my mistake here if any.
•  » » 8 months ago, # ^ |   +5 My Condolence.Probably the worst way to get System Test Fail.Thanks for letting us know though.
 » 8 months ago, # |   0 My solution for D is wrong answer on test 2's 145th test case! Can someone give me a smaller example to debug?106582694
 » 8 months ago, # |   0 106598727 (My submission for Problem B) . Can anyone please point out why this code is failing ? I am really not able to figure out the possbile reason. Thanks.
•  » » 8 months ago, # ^ |   0 Reread the question again? If the heights of the mountains are 1, 1, and 100, then the first thrown boulder goes to the 2nd mountain, but the second thrown boulder goes to the 1st mountain.
•  » » » 8 months ago, # ^ |   0 that is why I have dont i=1 after every increment.
•  » » » » 8 months ago, # ^ |   0 But if I'm reading your code correctly, with two boulders, you'll throw them together at the second mountain?
 » 8 months ago, # |   +69 To not keep you waiting, the ratings updated preliminarily. In a few hours, I will remove cheaters and update the ratings again!
•  » » 8 months ago, # ^ |   +6 Thanks for the quick rating change and the extra work that you have to put in for removing the cheaters!.
 » 8 months ago, # |   0 How to solve C?
•  » » 8 months ago, # ^ |   +4 The tutorial is already available, you can check here...
 » 8 months ago, # |   0 I can't seem to figure out the mistake in C. My idea is the same as given in the tutorial. Some help would be really appreciated. Here is my submission Submission
•  » » 8 months ago, # ^ |   0 Try this: 1 2 3 1 1 2 2 2 1 2 
•  » » » 8 months ago, # ^ |   0 Thankyou got the error
 » 8 months ago, # |   +5 Thanks for fast tutorial release
 » 8 months ago, # |   0 Here is my Screencast for today's contest, if anybody is interested in watching a noob attempt this round xDYouTube Video
 » 8 months ago, # |   +5 Thank you very for the contest
 » 8 months ago, # |   0 Awesome contest!!!Actually, questions are awesome after many contests, XD.
 » 8 months ago, # |   +3 In Div 2 Problem C: Fence PaintingI read the editorial and tried writing it's code however it is giving me TLE, can someone please help me out?We must first see that the most important painter is the last one (and he will paint plank x where bx=cm) because of two reasons: when he paints plank x it won't be changed and if some other painter have a color that we don't need we can make him paint plank x, which will be repainted later.Now we need to find x where bx=cm, there are three options:bx≠ax. bx=ax. There are no bx=cm this case is impossible and the answer is "NO". If the first two are true we choose x such that bx≠ax, then we greedily distribute all painters j (1≤j
•  » » 8 months ago, # ^ |   +3 The continue statement in line number 56 does not continue the outer while loop but it continues the for loop in which it is present. Hence the value of k is becoming negative there itself and so the outer while loop becomes an infinite loop, giving TLE.
•  » » » 8 months ago, # ^ |   +3 Thanks for helping out!
 » 8 months ago, # |   0 What are the common reasons for ratings getting roled back? Just curious
 » 8 months ago, # |   0 Weak pretests :( In problem C, by mistake i did l=mid-1 and r=mid+1. I should have to assign l=mid+1 and r=mid-1. But still it passed the pretests. It's just the reverse which we have to do with some extra element from other side. Link
 » 8 months ago, # |   0 I'm unable to ask question in the contest problems section, it doesn't let me do so, when I click "send" button nothing happens, can anyone please help me with this. I want to ask a question as the solution that I submitted for 2B problem got tle on test#12, but when I resubmitted it (after modification of constraints), it got accepted so I want coordinators to please look into it.TLE submission: 106816040Accepted one(with exact same code): 106847496
•  » » 8 months ago, # ^ |   0 You're commenting on the wrong post!
 » 8 months ago, # |   0 can someone help me with thiscan the problem c have multiple solutions
•  » » 7 months ago, # ^ |   0 yes it can, say taking the first test case one of the answer could also be 1 2 rather than 2 2 because we can get painter 1 to paint 1st wall and painter 2 to paint 2nd wall..
 » 7 months ago, # | ← Rev. 2 →   0 MikeMirzayanovProblem ratings for this round have not been updated, although the ratings for the round after this (Round $700$) have been updated.EDIT: wow, that was fast :P