### liouzhou_101's blog

By liouzhou_101, history, 2 months ago,

On Sep/30/2022 17:35 (Moscow time) we will host Codeforces Global Round 22.

Codeforces Global Round 22 is the ${\textbf{2}} \cdot {\textbf{2}} = 4$-th round of a 2022 series of Codeforces Global Rounds. The rounds are open and rated for everybody.

The prizes for this round:

• 30 best participants get a t-shirt.
• 20 t-shirts are randomly distributed among those with ranks between 31 and 500, inclusive.

The prizes for the 6-round series in 2022:

• In each round top-100 participants get points according to the table.
• The final result for each participant is equal to the sum of points he gets in the four rounds he placed the highest.
• The best 20 participants over all series get sweatshirts and place certificates.

Thanks to XTX, which in 2022 supported the global rounds initiative!

The problems were written and prepared by antontrygubO_o, Milesian and me.

We are extremely grateful to the following people who made this round possible:

Round Information:

• Duration: 2 hours and 30 minutes
• Number of problems: ${\textbf{2}} \cdot {\textbf{2}} \cdot {\textbf{2}} = 8$
• Score distribution: 500 — 1000 — 1500 — 2000 — 2500 — 2750 — 3000 — 4000

Kind Tips:

We are looking forward to your participation!

UPD. Editorial

Congratulations to the winners!

And for the winner of each problem:

A. tourist

B. tourist

D. tourist

E. tourist

F. 300iq

G. ksun48

H. rainboy

Announcement of Codeforces Global Round 22

• -112

 » 2 months ago, # |   -38 I don't know how I should feel about this bug... Spoiler
•  » » 2 months ago, # ^ |   +65 funny how I guessed you were going to be here before opening the blog, lol.
•  » » » 2 months ago, # ^ |   +47 funny how I guessed you were going to be here before opening the blog, lol.
•  » » » » 2 months ago, # ^ |   +13 funny how I didn't guess you were going to be here before opening the blog, lol.
•  » » » » » 2 months ago, # ^ |   -27 funny how you didn't guess i'm marinush, lol.
 » 2 months ago, # | ← Rev. 3 →   +48 Good luck & have fun & Orz ! 2022 = 2222 - 222 + 22 = 22(22) * 22(22) - 22(22) * 2 - 2 !
•  » » 2 months ago, # ^ |   0 Loooooooooooooooooong time no Rated contests for div1!
•  » » 2 months ago, # ^ |   +48 $2^{2^{2^{2^{2^{2^{2^{2^{2^{2^{2^{2^{2^{2^{2^{2^{2^{2^{2}}}}}}}}}}}}}}}}}}$
•  » » 2 months ago, # ^ |   -22 So why not $2022=2+2+2+\cdots+2$ ($1011$ twos in total)?
•  » » » 2 months ago, # ^ |   +42 Because no one was able to make such a difficult observation
 » 2 months ago, # |   +202 As a tester I 
•  » » 2 months ago, # ^ |   +109 ..ly encourage us to participate?
•  » » » 2 months ago, # ^ |   +114 i just strong Yep
•  » » 2 months ago, # ^ |   0 Hope that we can make our ...est performance?
 » 2 months ago, # |   +81 but why isn't global on weekend? ):
•  » » 2 months ago, # ^ | ← Rev. 3 →   +2 The weekend is most commonly considered the period between Friday evening and the end of Sunday. from Google So, maybe Codeforces consider Friday as weekend, emmmm, half-weekend at least.
•  » » » 2 months ago, # ^ |   +64 It's indeed on Friday but it's not in the evening for probably one half of the earth due to timezones.
•  » » » » 2 months ago, # ^ |   +4 Any time is not evening for more than half of timezones...
•  » » 2 months ago, # ^ |   +21 Maybe it's because .... 2 days before the week...end?
 » 2 months ago, # |   +305 Can we please make the contest 8 minutes shorter for the memes?
•  » » 2 months ago, # ^ |   +30 If the system had allowed it, it'd be good to make problem D or E worth 2222 points as well, but sadly we can't
•  » » » 2 months ago, # ^ |   -45 isn't 2250 points possible though?
•  » » 2 months ago, # ^ |   +48 Great idea! Can't agree more!But it seems we cannot do that. What a pity
•  » » » 2 months ago, # ^ |   -60 But you can make it 19 hours and 52 minutes longer. Right??
•  » » 2 months ago, # ^ | ← Rev. 2 →   -45 222 + 2*2*2
•  » » 2 months ago, # ^ |   -46 Yes definately
•  » » 2 months ago, # ^ |   0 150 minutes shorter might have been better I think
 » 2 months ago, # |   +55 As a tester, I'm glad that a bad problem was removed from this contest.
•  » » 2 months ago, # ^ |   -54 Is that so?
•  » » » 2 months ago, # ^ |   +9 Yes, I bet.
•  » » » » 2 months ago, # ^ |   -55 Yeah? Why?
•  » » » » » 2 months ago, # ^ |   +50 Maybe bad problem is bad.
 » 2 months ago, # |   +48 :D
•  » » 2 months ago, # ^ |   +75 You did the best. It would be better if my account were liouzhou_202.
•  » » » 2 months ago, # ^ |   +63 Here it is, The art of HTML.
 » 2 months ago, # |   +125 The emphasis on 2 is hinting at WA on pretest 2
•  » » 2 months ago, # ^ |   +92 You can also WA on pretest 22.
•  » » » 2 months ago, # ^ |   +76 Please tell me we won't FST on System test 222
•  » » » » 2 months ago, # ^ |   +6 The 2-nd problem.Is this just a coincidence?
•  » » » 2 months ago, # ^ |   -22 The prerequisite of that is passing pretest 2 first .....
 » 2 months ago, # |   +2 2 much 2 in 2morrow's contest
 » 2 months ago, # |   +567 As a tester, this contest has a couple of nice problems, but the overall quality is worse than average.
•  » » 2 months ago, # ^ |   +45 Lol
•  » » 2 months ago, # ^ |   +70 As a participant, I am surprised to see a useful tester comment.
•  » » 2 months ago, # ^ |   -101 Very interesting, also as a tester, the first time I saw a tester say that the problem is not good, generally speaking, as a tester, no matter what the problem is, I will praise the problem, if the problem is good, I would rate it higher, but I like your personality.
•  » » » 2 months ago, # ^ |   +115 no matter what the problem is, I will praise the problemWhy?
•  » » » » 2 months ago, # ^ |   -66 Because every tester does this.
•  » » » » » 2 months ago, # ^ |   +110 But it's stupid and makes tester comments meaningless.
•  » » » » » 2 months ago, # ^ |   +33 If most testers think like this then that explains a lot...
•  » » 2 months ago, # ^ |   +58 Thank you for your honesty. Your suggestions will make our rounds better in the future.Anyway, wish everyone will find something interesting in this round.
•  » » » 2 months ago, # ^ |   +5 But why didn't their suggestions make your current round better?
•  » » » » 2 months ago, # ^ |   +49 From where do you see that their suggestions did not make our round better?
•  » » 2 months ago, # ^ |   +54 As a tester, I second this.Tired to see testers just praise every contest...
•  » » 2 months ago, # ^ |   -6 Finally Um_nik told the truth! (❁´◡❁)
•  » » 2 months ago, # ^ |   +17 I should have trusted you:)
•  » » 2 months ago, # ^ |   0 A very helpful comment to read before registering to the contest
•  » » 2 months ago, # ^ |   +120 I don't like testers giving any information on the contest before the round. You felt entitled to do it and the community heavily upvoted you, but such a behavior is outside the scopes and the rights of the tester.The usual "Best contest ever" comments by testers are childish and annoying, but they are empty. Your comment is actually giving information. If I were the author I would be very pissed as you have likely reduced the number of participants.
•  » » » 2 months ago, # ^ |   -36 I don't like testers giving any information on the contest before the round. I didn't give any information that can be used to get a better result, did I? I don't think that providing such kind of information is worse than providing the names of the authors, which CF does every time. The usual "Best contest ever" comments by testers are childish and annoying, but they are empty. What do you mean "empty"? What's the difference between saying "the contest is good" and "the contest is bad" from the perspective of providing information? It seems to me like you are applying some imaginary rules. It's like you must answer "I'm good, thanks" to "How are you?". I don't do small talk. If I were the author I would be very pissed as you have likely reduced the number of participants. I couldn't care less.
•  » » » » 2 months ago, # ^ |   +49 I didn't give any information that can be used to get a better result, did I? True, but it's not the point. I don't think that providing such kind of information is worse than providing the names of the authors, which CF does every time. Possibly true, but it's not the point. Codeforces, being the organizing platform, is entitled to do whatever it wants. A tester should respect the not-imaginary-but-implicit-and-useful rule: if someone is given a private information for a specific purpose, he cannot share the information. What do you mean "empty"? I don't deduce anything on a round when a random tester says that the contest is wonderful. It's exactly as saying "I am fine, thank you" when asked "How are you?" as you mentioned. On the other hand, when you write what you wrote, I deduce information about the round (and in fact, a posteriori, I think that your comment is correct). It's because writing "The problems are amazing" is a trend among testers, it's also because I know that you are more reliable than a random tester.
•  » » » 2 months ago, # ^ |   -14 If I were the author I would be very pissed as you have likely reduced the number of participants. I assure you that didn't happen. For example, I participated from alt account
 » 2 months ago, # |   -37 As a comedian Codeforces Global Round 10110
 » 2 months ago, # |   -45 Fun. Why not "200 t-shirts are randomly distributed among those with ranks between 31 and 5000, inclusive". Then I wish to win a t-shirt with probability 200*1/4970
 » 2 months ago, # |   -19 Does it rated?
•  » » 2 months ago, # ^ | ← Rev. 2 →   -23 Yes. And pay attention to your grammar dude.
 » 2 months ago, # | ← Rev. 2 →   -41 Fun fact about the number 22 I just found out: SpoilerIt is $\mathbf{211}$ in ternary and $\mathbf{112}$ in quaternary. Also it is $\mathbf{16}$ in hexadecimal!
 » 2 months ago, # |   +15 The BPM of Freedom Dive by xi is 222.22.
•  » » 2 months ago, # ^ |   -15 I was waiting for this joke since 33 hours ago
•  » » 2 months ago, # ^ | ← Rev. 2 →   +4 While the BPM of GOODRAGE by EBIMAYO is 222.
 » 2 months ago, # |   -29 Is it ture that anton set another $\le 5$ AC difficulty problem H like 1685E - Лучшая задача о LIS?
 » 2 months ago, # |   0 Good luck and have fun! Hope it won't be unrated :D. I have been waiting for a great global round for a long time ^_^.
 » 2 months ago, # | ← Rev. 3 →   -16 Global rounds and Div1 are much better than div2 imo. Some of the last few problems of div2 are too easy and dull and requires no thinking. While problem G/H of most global rounds are interesting. Taking part in div2 contests means no challenge for me.
 » 2 months ago, # |   -14 Hope for having Strong Pretest
 » 2 months ago, # |   -15 is this round rated
•  » » 2 months ago, # ^ |   0 Yes.
 » 2 months ago, # |   0 Can anyone tell me how are the global rounds? I don't have much of a experience.
•  » » 2 months ago, # ^ |   0 In Global Round all the participants from div 1 div 2,div 3 and div 4 participate together. And other rules and regulations are similar to regular contest but duration of Global round are longer than regular rounds. That's the only difference.
 » 2 months ago, # |   0 Actually 1479D - Odd Mineral Resource can be solved by template Mo's algorithm on tree. Though the standard algorithm is interesting, hope such issue won't happen today.
 » 2 months ago, # |   0 Now that looks like a decent score distribution.
 » 2 months ago, # |   -17 You people are too obsessed with 22 number.Grow up kids
•  » » 2 months ago, # ^ |   +17 22-year-old kids
•  » » » 2 months ago, # ^ |   0 HAHAHHA nice one you made me laugh thanks
 » 2 months ago, # |   0 As a participant,I hope it will be a great contest..
 » 2 months ago, # |   0 no need for factorial at the end of the equation)
 » 2 months ago, # |   0 when pro coders make a dad joke
 » 2 months ago, # |   0 Hope it won't be unrated!
 » 2 months ago, # |   +15 Hoping for lesser cheating
•  » » 2 months ago, # ^ |   0 Tons of cheating on C
 » 2 months ago, # |   0 Hope Pretest 2 would be strong enough!
•  » » 2 months ago, # ^ |   0 I wasn't :)
•  » » » 2 months ago, # ^ |   0 Yeah! you could be strong.. so many B and C were Hacked/FSTed :(B could contain the edge case k = 1 in either samples or pretests, sadly I got FST too :(
 » 2 months ago, # |   +1 hoping for +ve delta
 » 2 months ago, # |   0 is there any hacking phase in global round?
 » 2 months ago, # |   +50 I hope there are no copied problems this time.
•  » » 2 months ago, # ^ |   0 Hope So !
 » 2 months ago, # |   -11 Regards coders, can anyone please suggest the resource to learn Number Theory ?
 » 2 months ago, # |   0 i need dalex to butthurt about how statements are hard to understand
•  » » 2 months ago, # ^ |   0 I retired from everything related to CP
 » 2 months ago, # | ← Rev. 6 →   +240 C is the worst problem I've seen.Stop taking these Chinese style shit problem into cf.edit: Sorry D is worseedit: Sorry E is worseedit: Sorry H is worseedit: Statements are too long. I think authors could use spoiler to fold some definition. F is great. Gaps are too small.
•  » » 2 months ago, # ^ |   -54 i guess you are the only one who is worse and ugly here LOL : ( if it is worse who said you to do it dont do it if you dont like it
•  » » » 2 months ago, # ^ |   +28 Because I love both rating and joy of solving problems you such sore loser ^_^Red is much more beautiful than grey I think.
•  » » » » 2 months ago, # ^ |   -13 LOL i dont want to become red so whatever i do its my life and i dont like red i like black and one thing red suit more on girl if you are loving red its are you girl ???puppett hahaha
•  » » » » » 2 months ago, # ^ |   0 Lol you just have low iq
•  » » » » » 2 months ago, # ^ |   0 Your brain is more precious than Einstein's.
•  » » » 2 months ago, # ^ |   +1 If you can't say which problem is good and which is worse then u are a loser.
•  » » » » 2 months ago, # ^ |   0 he is red but he doesn't have brain, so chill!some brain are like this puppet right dXqwq
•  » » 2 months ago, # ^ |   +1 Can't agree moreWeak pretest on B and C ... That's even worse when I get FST on C :(([hit_call]dx[hit_call])
 » 2 months ago, # |   +13 ReadingForces
 » 2 months ago, # |   +19 Why is this contest so hard? :(
•  » » 2 months ago, # ^ |   +16 Worse than just that, the difficulty distribution is very flat. I felt like all problems among BCDEF had pretty much the same difficulty, instead of seeing gradually harder problems.
 » 2 months ago, # | ← Rev. 2 →   +1 Is this WA on pretest 2 contest !? o((⊙﹏⊙))o I think all will get negative delta after this round!!
 » 2 months ago, # |   0 This contest is only good for those with high IQ or great observation skills. Banging my head smh.
•  » » 2 months ago, # ^ |   0 It's not like that You can see my performance in the previous contest and this contest. It's just a matter of what problem types you are more comfortable in.
•  » » 2 months ago, # ^ |   +5 great observation skills C is about as standard as it's possible to be, with no observation skills required.
•  » » » 2 months ago, # ^ |   0 I apologize, I didn't see the constraints. I was thinking of standard even-odd formula.
 » 2 months ago, # | ← Rev. 2 →   +25 why does C give negative elements (sweat)?
•  » » 2 months ago, # ^ | ← Rev. 2 →   0 Did you mean B? In C, all that matters is whether elements are even or odd, so negative elements should not be an issue.Negative elements in B were a bit annoying though. EDIT: nvm, I forgot that a negative odd number mod 2 produces -1 in C++ (and probably some other languages too). I actually dodged a bullet by checking for evens instead of odds (which were covered by the else).
•  » » » 2 months ago, # ^ |   +3 LOL.That's pretty annoying.
 » 2 months ago, # |   +21 wrong-answer-on-pretest2-forces
 » 2 months ago, # |   0 Really difficult contest TAT.
 » 2 months ago, # |   -7 Make a better contest for all. Its not China. :(
 » 2 months ago, # |   +24 I guess, no more The problems were written and prepared by antontrygubO_o rounds for me. Worst contest ever...
 » 2 months ago, # |   -28 I adore Ukraine and Ukrainian people and immensely support her in the current situation, but antontrygubO_o really fucked up. sorry for poor english
 » 2 months ago, # |   -8 How to solve E?
 » 2 months ago, # | ← Rev. 2 →   +27 I mean come on, samples for E were just evil. I think it would have been better ff samples would have been a bit stronger,
 » 2 months ago, # |   0 How to solve Q2....WA 17 times...
•  » » 2 months ago, # ^ |   0 if(k == 1){ YES } if((n-k+1)*(s[1] - s[0]) < s[0]){ NO } for(int i=0; i s[i+2] - s[i+1]){ NO } } YES 
 » 2 months ago, # |   -42 Thanks to Codeforces Global Round 22 and Educational Codeforces Round 136 I will return back to specialist.very bad contests just constructive problems depends only on mentality skills!!!
•  » » 2 months ago, # ^ |   0 Same thing but with green and gray
•  » » 2 months ago, # ^ |   +20 The only constructive problems are F and G, and even then it is a stretch to call them constructive.
 » 2 months ago, # |   +58 D >>>>>> A > E > F > B > C. Change my mind. I have no idea how E&F have 4 times less solves when D is legendary hard.
 » 2 months ago, # |   +22 I don't think problems are bad but I somehow performed really bad :(
 » 2 months ago, # |   0 Todays contest is so Hard .
 » 2 months ago, # |   +1 Great problems! I especially enjoyed C!I couldn't manage to solve D tho :(
•  » » 2 months ago, # ^ |   0 Thank you!
 » 2 months ago, # |   +26 Problem H is straightforward and tedious application of eertree with ridiculous constraints that won't allow $O(n \log^2 n)$ solutions to pass. Otherwise, the main idea (at least the one that I have used) almost completely repeats this and this problems.
•  » » 2 months ago, # ^ |   +6 I bet you will be surprised when seeing the intended time complexity.
•  » » » 2 months ago, # ^ |   +10 Why linear when you can do it polylog way more easily :(
•  » » » » 2 months ago, # ^ |   +8 Indeed, I don't want to make only $O(n)$ pass. Just allow some $O(n \log n)$ to pass.
•  » » » » 2 months ago, # ^ | ← Rev. 2 →   +8 I passed pretests with $O(n \log n)$, but the experience is soul-crushing, as I couldn't just submit $O(n \log^2 n)$ solution that I had from some earlier problems and it ultimately consumed too much time for any meaningful recovery on other problems after passing it :(
 » 2 months ago, # |   +18 Is F easier than E? I found there are many participants who solved F much faster than E.
•  » » 2 months ago, # ^ |   0 The logic for F is easy compared to E. It's just that people have hard time understanding interactive problems
•  » » » 2 months ago, # ^ |   +6 I would say the opposite. The logic of E seems much easier than F, but the implementation is kind of a pain and at least in my implementation there was a special case that I missed (I kind of convinced myself that the logic for 0 0 0 and 1 0 0 0 1 is the same, but it's not). Meanwhile, F was actually kind of clean for an interactive problem.
•  » » 2 months ago, # ^ |   -8 Is AGC easier than some large-coded data structures like 917E - Upside Down?
 » 2 months ago, # |   0 got hacked on B yesterday and today as well, I would have reached pupil otherwise, any suggestions to avoid hacks?
•  » » 2 months ago, # ^ |   0 Well, check the constraints before submitting and think of corner cases as well.
•  » » » 2 months ago, # ^ |   +1 Hello there srikaran_p
•  » » » » 2 months ago, # ^ |   0 Hello Taha_adeel!
 » 2 months ago, # |   +5 Is there any simple solution for A?
 » 2 months ago, # |   +1 i just feel c samples would have been better i feel its just useless why didn't it cover more scenarios?
 » 2 months ago, # |   +8 Errrrrrrrrr... Not bad
 » 2 months ago, # |   +26 How to solve H: Remember that in https://ac.nowcoder.com/acm/contest/33189/F you have PAM with both-side insertions and undo. Remember that in https://uoj.ac/problem/693 you have a "two pointers with one stack". Merge the codes (this is quite disgusting actually) AC
•  » » 2 months ago, # ^ |   +20 How could I have remembered that while I was not feecle6418. :(
•  » » » 2 months ago, # ^ |   -50 Maybe you should mas*****te less make your memory stronger.
•  » » 2 months ago, # ^ |   0 I bet you will be surprised when seeing the intended time complexity.
•  » » » 2 months ago, # ^ | ← Rev. 2 →   +21 I know that in some year's (edit:2017) Chinese IOI Training Essays, there exists a paper that claims "PAM can support arbitary pushfront pushback popfront popback operations in complexity same with only pushfront pushback". (However I have never seen an implementation of it) So I guess it indeed can be solved in less complexity.
•  » » » 2 months ago, # ^ |   +11 The thing that surprised me the most is that the alphabet size is larger than logn.
•  » » » » 2 months ago, # ^ |   +3 Never mind. I just don't want $O(n \log n)$ to fail.
•  » » 2 months ago, # ^ | ← Rev. 2 →   +57 How to solve H: Find that this problem is weaker than range query Google/Baidu/Bing the range query version Get the problem id on LOJ Copy & Paste AC Edit:Some of my friends complained that if you find the solution of BZOJ version you might get TLE.However this situation should be checked before the contest, authors and testers should ensure that there is no googleable problem.
•  » » » 2 months ago, # ^ |   -47 Got it! Next time I will let all non $O(n)$ solution fail. Then, it's not googleable at all. Do you like it?
•  » » » 2 months ago, # ^ |   +3 Could you point to the problem? Intended solution to this one is $O(n \log^2 n)$ and it gets TL.
•  » » » » 2 months ago, # ^ |   0 I actually copypasted main ptz solution to BOJ 19026 (fearful is my alt), then opened the fastest solution by cyanic and constant-optimized it a bit.
 » 2 months ago, # |   0 road to pupil
 » 2 months ago, # |   -8 Sad. The thinking was somehow enjoyable though.
•  » » 2 months ago, # ^ |   +5 Glad to see you enjoy it.
•  » » » 2 months ago, # ^ | ← Rev. 2 →   -8 The first great-positive-delta contest recently for me xD
•  » » » » 2 months ago, # ^ |   0 Congrats!
 » 2 months ago, # |   +11 D had so much reading comprehension, the solution ended up being kinda nice but not worth the like 1 hour of just brute forcing patterns. C was literally you know DP or you don't, unless there's a greedy solution? A and B were kinda insane for A's and B's
•  » » 2 months ago, # ^ |   0 I saw some people in my room doing c using a bunch of if conditions,idk if that solution is right tho...
•  » » 2 months ago, # ^ |   +8 For problem C, DP is not necessary.
•  » » 2 months ago, # ^ | ← Rev. 2 →   +4 I did DP too. Then I printed the array over amount of zeroes and ones. We get regular 2x4 Blocks: OutputTop left is no evens and no odds. To the right I count odds, down evens.
•  » » 2 months ago, # ^ | ← Rev. 2 →   +4 Somebody in my room solved C as follows:Let $n_o$ be the number of odd elements and $n_e$ be the number of even elements.If $n_o \bmod 4 = 2$, Bob wins. If $n_o \bmod 4 = 1$ AND $n_e$ is even, then Bob also wins.Otherwise, Alice wins.Proof: No freaking clue, but I printed my 100 x 100 DP table, and the results seemed consistent...
•  » » 2 months ago, # ^ |   0 C is a bunch of ifs
•  » » 2 months ago, # ^ |   0 C was literally you know DP or you don'tCan you elaborate?
 » 2 months ago, # |   0 i am again going to be gray, too hard for me nothing is passing, need to work on maths i guess, too many edge cases
 » 2 months ago, # |   0 Why it was too tough for me ?
•  » » 2 months ago, # ^ |   0 you need lot's of practice!
•  » » » 2 months ago, # ^ |   0 Yes, I need lots of practice :(
•  » » 2 months ago, # ^ |   +3 Problem A was really too difficult to be A for others too.
•  » » » 2 months ago, # ^ |   0 Note that this is actually a Div1 contest (i.e., rated for everybody), not a Div2 (like most of what we've been having recently), so a bit of challenge is actually justified here imo. I don't feel like this one is too hard by Div1A standards.
•  » » » » 2 months ago, # ^ |   0 I see that you have not given any global round so far. Even in global round, problem A is very simple
•  » » » » » 2 months ago, # ^ |   0 Ah, I see, my bad. I was under the impression that any contest that's rated for everyone is a Div1 contest, so I didn't actually realize that there was a difference.
•  » » » 2 months ago, # ^ |   0 Yes, it was. I made 5 wrong submissions and passed the pretests on 6th submission. It took me a huge time to solve it and then I messed up in problem B. I think this round was not for a newbie.
•  » » 2 months ago, # ^ |   0 dont worry, problem A and B were harder than usual
•  » » » 2 months ago, # ^ |   0 Yes, it was :(
 » 2 months ago, # |   +3 Pupil I am coming
 » 2 months ago, # |   0 Is there a way to solve C other than 4d DP? 4 dimenion = dp[odd][even][alice][needOdd].D is straight forward greedy right?
•  » » 2 months ago, # ^ |   0 Yeah
•  » » 2 months ago, # ^ |   0 Yup, I solved it using simple observations and casework. My Submission
•  » » 2 months ago, # ^ |   0 yes it's simple bruteforces method. my code : 174150204explain: first of all you check how many maximum number of odd alice can get if that is even then definetly alice will win. otherwise you can check that how many time even numbers are if that is odd time then alice choose number such that he got last even number so bob must be select one odd number so now we apply same above approch but number off odd is decreased by 1. and above all condition not sutisfy then bob will win.
•  » » » 2 months ago, # ^ |   0 Do you know what bruteforce actually mean?
•  » » » » 2 months ago, # ^ |   0 ya sorry its greedy.
 » 2 months ago, # |   0 how can i spend nearly two hours and finally realized just some bruteforce is enough for C
 » 2 months ago, # | ← Rev. 3 →   0 Can Anyone Explain me i am got runtime_error on my 1st quetion solution in c++20 language but when i have submit same code in c++17 then i got accepted but for changing language i take 1 hour. so can anyone explain me why this happen in c++20. my c++20 code: 174108183 my c++17 code: 174139409
 » 2 months ago, # |   -8 F is really a great problem and it took me very long time.
 » 2 months ago, # |   +134 Here is some feedback on the problems: A: Nice easy problem. Seemed a bit hard for its position. B: Nice easy problem. C: I don't see the point of this problem. Giving numbers instead of zeroes and ones does not make any sense. The problem is very standard. I did not even try to understand what are the "winning pairs", just wrote a dynamic programming solution since the constraint on $n$ is really small (I suppose that $n$ is left small on purpose, and I assume that the problem can be solved in $O(1)$ for any $n$ up to reading the input). Felt very easy. D: Nice problem. I misread it and solved a different one. Both the alternative one and this one are cute and clean. E: Boring. Immediately after reading the statement I knew how to solve it, there is not even a tiny bit of idea here, it's just about not doing a mess with indices. Did not like solving this one. It seemed very easy for its position. F: Ok problem, easy for its position. It's not particularly interesting but it is clean and easy to implement. G: Wonderful problem. Solving this one (which required me half of the contest) was very satisfying. From the very beginning, I thought that the number $(n-k+1)^2$ had to be special in some way. And in fact it is:if one is allowed to delete $(n-k+1)^2-1$ cells then the answer is always impossible! After that, I still needed to think a lot in order to conclude. Making sure that the $k-1$ antichains are "disjoint" was the hardest part for me. H: Not read. I loved problem G, while I did not enjoy solving the previous problems as it was just speed-solving without thinking. The contest was well prepared and the statements were clear. Thanks to the authors!
•  » » 2 months ago, # ^ | ← Rev. 2 →   +10 How did you end up making sure the antichains are disjoint in G? I read the editorial but it seems to go in a different direction...Edit: I read your code, looks like the key is doing this to the input: for (int i = 0; i < k-1; i++) for (int j = 0; i + j < k-1; j++) { a[i][n-1-j] = 0; a[n-1-i][j] = 0; } It's easy to see that this transformation is valid (because no k-increasing sequence would ever use those elements anyway), but it's very interesting that after doing this the rest just "works".
•  » » » 2 months ago, # ^ |   0 I want to confirm that your interpretation of my solution is correct. I am proud of it, it felt magical when I noticed it.Let me remark that those cells (the ones set to 0 in that for cycle) cannot be deleted, otherwise there will surely be a $k$ chain. So any solution will not delete them and therefore it makes even more sense to make them undeletable.
 » 2 months ago, # | ← Rev. 3 →   +77 I suggest problem A in contests (other than div1 contest) should be at very easy and friendly to all the newbies and incomers, this contest problem A is too hard for its position. Because if a contestant do not make any submission, he will not included in official table. If problem A is too hard, many newbies will quit and not included in the ranking table, and this contest will become another "div1" contest, only strong contestants participate. However, it is more difficult for a contestant to gain rating in a contest surrounded by strong contestants, as I discovered in one of my blogs, it is not good for a weaker contestant who want to challenge him(her)self.
•  » » 2 months ago, # ^ |   0 true, i couldn't solve even one problem
 » 2 months ago, # |   +40 As an ABCDEFG solver, almost all problem was typical and needed at most one idea, but sometimes participating in such a contest is not always bad. (Though it's right that this contest isn't likely a Global Round)
 » 2 months ago, # | ← Rev. 4 →   0 Logic I have used : if Alice Can take even number of odd elements he wins! What's wrong in My logic? 174123447int n; cin>>n; int o = 0; for(int i = 0; i < n; i++) { int x; cin>>x; if(x % 2)o++; } int k = o — (o / 2); string ans = "Alice"; if(k % 2)ans = "Bob";cout<
•  » » 2 months ago, # ^ |   0 you are directly considering that alice can take all the numbers he wants at a time but that is not the case they have to play alternatively selecting only one number at a time.consider case 11 2 3o(odd numbers)=2;e=1;as per your solution alice selects one odd number now o=1;e=1 . now if Bob selects the remaining odd number alice will lose but as per your logic alice wins.
 » 2 months ago, # |   +35 Hardest Div.2A I've ever seen... 174095886
 » 2 months ago, # | ← Rev. 2 →   +2 Very strong indeed.. A was hard, tough contest.
 » 2 months ago, # | ← Rev. 4 →   0 A was quite time taken.
 » 2 months ago, # |   +10 In problem E, I thought for a lot of time that there may be negative numbers. Is it solvable in this interpretation?
•  » » 2 months ago, # ^ |   +25 It seems at least as hard as counting common subsequences in two arrays. Is even that solvable in subquadratic time?
 » 2 months ago, # |   +4 Many failed system test in B
•  » » 2 months ago, # ^ |   +8 But I passed B and failed D XD
 » 2 months ago, # |   0 can anyone explain how to do b
•  » » 2 months ago, # ^ | ← Rev. 4 →   0 when look at the problem we see that K1 ... Kn will not change their initial number so the whole idea is to get smallest number to K0 , then just pass on the array to check if it sorted or not . there is a multiple solution one of them --> if K0 is negative then I just distribute the K0 of the previous position in include K0 by using Pigeonhole principle -->ceil(the number / (the number of position)) but if K0 was negative wee will not take the ceil we take the floor(because it negative number) , else , I just use the ceil ---> and now we have the minimum number in position K0 . you can see my code for more Clarification
•  » » » 2 months ago, # ^ |   0 so i have used these case of if else in my code — lets callsum = k0 element that i have to make with remaining n — k + 1 elements ; num = n — k + 1 ; k = the maximum value i can use for the previous terms if ( k >= 0 ) { if ( sum <= 0 ) { cout << "YES" << endl ; } else { ll prod = ( 1ll * k * num ) ; if ( sum > prod ) { cout << "NO" << endl ; } else { cout << "YES" << endl ; } } } else { if ( sum >= 0 ) { cout << "NO" << endl ; } else { ll prod = ( 1ll * k * num ) ; if ( sum < prod ) { cout << "NO" << endl ; } else { cout << "YES" << endl ; } } }are these assumptions correct ? thank you
•  » » » » 2 months ago, # ^ |   0 don't mind I get wrong answer now in the testing heh :)
 » 2 months ago, # |   0 Hard contest but I think the problems were fun and contain a good ideas
 » 2 months ago, # |   +6 FST... So many FSTs in B...(@Successful Hackers: what's the key of distinguishing correct solutions and wrong solutions in B?)
•  » » 2 months ago, # ^ | ← Rev. 3 →   +42 (-1)/2 == 0 in C++, but many contestants do not understand this...
•  » » » 2 months ago, # ^ | ← Rev. 2 →   -18 IMO, rounding towards zero in C++ is well-intended (It has multiple reasons including consistency and performance), but evil at the same time (most of all, it is counter-intuitive!)upd: This behaviour is also the reason why negative modulo happens on C/C++. It has persisted since C99, and while I think it should change, I guess it won't for a few years at least.
•  » » » » 2 months ago, # ^ |   0 C++ has zero-overhead philosophy. And this is how division works in cpu. So it will never change in c++
•  » » » » 2 months ago, # ^ |   0 What happens in python can you please explainThey did not have to care about thia why?
•  » » » » » 2 months ago, # ^ |   -16 Python uses floor division for integer division, and the modulo is always positive. That's one thing I like about Python
•  » » » 2 months ago, # ^ |   +27 It's more about forgetting about negatives than not understanding this
•  » » » » 2 months ago, # ^ |   0 You are right, I just forget about it.I felt like being tricked, because I counted number of odd and even numbers, and stayed for a lot of time trying to solve a broken problem.But I think I should've noticed that.
•  » » 2 months ago, # ^ |   +10 Probably not handling $k = 1$, also something like this works incorrectly with negative numbers: int threshold = a[n - k + 1] / (n - k + 1); if (a[n - k + 1] % (n - k + 1)) { ++threshold; } if (a[n - k + 1] < threshold) { cout << "No\n"; } 
•  » » 2 months ago, # ^ |   0 The limit for the original array element at the (n-k+1)th index. Many messed up trying to find this
•  » » 2 months ago, # ^ | ← Rev. 2 →   0 that's why one writes a * b <= c instead of a <= (c + b-1) / b D:
 » 2 months ago, # | ← Rev. 2 →   -7 ABC are straight forward annoying casework shit. I would call these problems more or les heavy implementation.D is greedy.Imagine the blocks <= k or > k can be like 000011100011 and figure out the last one from there.
 » 2 months ago, # |   +26 Epic pretests for problem B, thank you!
 » 2 months ago, # |   +6 F (and maybe G) is(are) awesome. But C, E (and maybe H) are shitty casework / Chinese-styled problems.
 » 2 months ago, # | ← Rev. 2 →   +42 Problem E is very boring and complicated to implement.
•  » » 2 months ago, # ^ |   +13 I don't see any submission from you in this contest, Have you participated with alt account?!
 » 2 months ago, # |   +13 unaddictive contest
 » 2 months ago, # |   +319 I'll try to start a new trend of "as a tester" comments. I would like to share my feedback that I have sent to the coordinator after testing. I don't know if it was passed to the authors, but I can see that the changes I proposed were not made.A, B: I guess they are fine, I don't really like either, also I think that both of them are too hard for div2A, and A is a bit harder than B in my opinionC: I just don't understand why this problem exists. I assume there is $O(1)$ solution (once you know number of even and odd numbers), but why would I think if there is an obvious $O(n^2)$ dp? why are there negative numbers in input? just to trip people who will check parity as x % 2 == 1 ? that's just bullshitD: the hardest part is just reading the statement, even though I think that my solution is overcomplicated, because standings say that it is much easier than E and F, while I think it is harder (?). also it is kinda weird that finding k and finding the permutation is totally independent (in my solution at least). the problem is ok though.E: super obvious combinatorics, the problem is kinda ok for div1A maybe, I don't get why testers are strugglingF: nice problem, although it is weird how simple the solution in the end isG: I like this one, I know that it is from Anton :) I don’t think it’s anywhere close to div1D by difficulty, but fineH: "write eertree on queue", wow, such problem. I think that there is eertree on dequeue, so it's not like it's something groundbreaking. and TL is just insane. my $O(q \log q)$ is right on border, either allow it freely or disallow it, but I think it is a bad idea to cut off $O(q \log q)$
•  » » 2 months ago, # ^ |   +10 What's the O(1) solution for C?
•  » » » 2 months ago, # ^ |   +5 Who wins only depends on (number of evens) mod 4 and (number of odds) mod 4.
•  » » » » 2 months ago, # ^ |   0 Only the parity of the number of evens matters.
•  » » 2 months ago, # ^ | ← Rev. 2 →   +6 I did the O(1) solution for C but I am gonna fail system tests because of negative numbers its so frustratingUPD: I don't know how but it passed system testing
•  » » » 2 months ago, # ^ |   +5 if(arr[i]%2!=0)you seem to have won the coinflip^^
•  » » » » 2 months ago, # ^ |   0 ohh yeah right looks like my lucky day lol
•  » » 2 months ago, # ^ |   +20 Well, if C needed O(1) you could still do n^2, print table and pattern is very clearly visible, so i think not asking for it is a good decision
•  » » 2 months ago, # ^ |   0 Completely agree. I also don't like A, B, and C which are the three that I solved. B had extremely weak pretests too, which made me FST.
•  » » 2 months ago, # ^ |   0 I don't know what was wrong but can't even solve A(3 W/A on pretest 4)
• »
»
»
2 months ago, # ^ |
-70

Can someone tell what went wrong?? ~~~~~

# include <bits/stdc++.h>

using namespace std;

int main() { int t; cin>>t;

while(t--){
long long int n,z,o,x,y,op1=0,op2=0;
cin>>n;

vector<long long int>a(n);
vector<long long int>zero;
vector<long long int>one;

for(int i=0;i<n;i++){
cin>>a[i];
}

for(int i=0;i<n;i++){
long long int k;cin>>k;

if(a[i]==0)zero.push_back(k);
else one.push_back(k);
}
sort(zero.begin(),zero.end(),greater<long long int>());
sort(one.begin(),one.end(),greater<long long int>());

z=zero.size();
o=one.size();

if(o > z){
int i,k=0;
for(i=0;i<z;i++){op1+=2*one[i];k++;}
for(i=z;i<o;i++)op1+=one[i];
op1+=2*accumulate(zero.begin(), zero.end(), 0);
}else{
int i,k=0;
for(i=0;i<o;i++){op2+=2*zero[i];}
for(i=o;i<z;i++)op2+=zero[i];
op2+=2*accumulate(one.begin(), one.end(), 0);

if(o==z){
op2-=min(zero[z-1],one[o-1]);
}
}
cout<<max(op1,op2)<<endl;

}

return 0;

} ~~~~~

•  » » 2 months ago, # ^ |   0 I also felt D is really hard. Not sure why so many people solved it
•  » » 2 months ago, # ^ |   +16 G didn't exist when I tested, and it is nice, so it must be from Anton :)Also E was H when I tested (there were 9 problems), authors' and/or coordinators' sense of difficulty must be quite off.
•  » » 2 months ago, # ^ |   +151 You are the only tester who passed all problems, and had a chance to win this round if you were not a tester. Of course you deserved to write down any comments you'd like.Get used to your impoliteness and arrogance as always. Anyway, the following is just to say something you might have ignored.C: Yes, it is obvious that I've already known there are two approaches. But you never tried to have think why I determined to make two possible approaches both pass. To you, either approach is obvious and may be boring. I want to ask: is there really a huge difference for you high-rated guys if only $O(1)$ solution is allowed? It seems you are complaining not large enough constraints, and you think it is good to make higher constraints.If this is Div1 only, of course I will do so. But you never know (at least forget or pretend to forget) what beginners really need. Do they just need to train case works? You can check many comments on how they loved and what they learned from this DP to pass, see 1, 2, 3, 4, 5. For checking the parity, that is also what beginners need to learn, and they did appreciate it.To you, these features are nothing. But please put away your arrogance in your own world, and see my comments on H below.H: Wow, this time you turned your attitude 180 degrees? Let me repeat your arguments to fit in H.I just don't understand why your $O(n \log n)$ solution exists to pass. I assume there is $O(n)$ solution (once you see the constraints are so large and TL is so tight), but why would you think your $O(n \log n)$ can pass naturally? Just to trip people who only know fast $O(n \log n)$ solutions, that's bullshit. The better way is to only allow $O(n)$ solution pass and let $O(n \log n)$ fail. But this time, it seems you are complaining not small enough constraints, and you think it is bad to make higher constraints.So where is your arrogance? You are expected to solve it $O(n)$, not sub-optimal things. Why did you stop your step?The only reason is that You know better solution to problem C. But you don't know better solution to problem H. That's it. So you wish to make problem C harder so that you can pass without pain but wish to make problem H easier so that you can pass without pain.Don't forget that: Problem C aims to let beginners learn more. Problem H aims to let high-rated coders like you learn more. If you did not pass problem H in testing round, I definitely you would shut up your mouth saying that problem H it's not groundbreaking and TL is just insane.At the very last, I am not an impolite person as you may see. When beginners are rude to me, I know they do not fully undertand the meaning of some problems that trouble them. But for you, You deserve to be treated rudely by others, as you always do so. Really shame on you, on your behavior, and on your ignoreance! The last of the last, thank you very much to test our round and give useful feedback. It would be better if you could raise your comments more smoothly. Looking forward to seeing you in the testing round, and leaderboards, in the future, my dear!
•  » » » 2 months ago, # ^ | ← Rev. 2 →   -25 Stop crying, just take your L. I have some tissues here in India if you want.
•  » » » » 2 months ago, # ^ |   +19 hey sows pigmike : ( do you know I have a pig here to fuck you so hard hahahaha
•  » » » 2 months ago, # ^ |   -26 Wow. What the fuck is wrong with you? I don't think that any of my comments were anything close to rude. Saying that your work is bad is not rude.Once again. Those were the comments I wrote BEFORE the round so that you could change something. I don't see where you found any arrogance or 180 turns. I didn't say that you should make problem C harder, I said that in the current constraints it is a bad problem. I didn't say that you should make problem H easier, I said that in the current constraints it is a bad problem. The reasons for that are different, yes. For problem H I literally say "either allow it freely or disallow it", because having reasonable solutions that seem to be fast enough and that are right on the border of TL is really bad. Yes, my opinion is that you should have let $O(n \log n)$ pass freely, but that is one of the options. I think that in the current state the problem is worse than either with higher or lower constraints.If you want to nitpick comments... I think that there is eertree on dequeue, so it's not like it's something groundbreaking.So, yeah, problem H is just shit, and your contest was bad, deal with it.
•  » » » » 2 months ago, # ^ |   0 His contest was bad. And so was the way in which you criticized the contest. You can point out flaws without calling problems outright bullshit because you didn't find them interesting and demeaning testers lower rated than you. If you have to criticize, learn to grow the fuck up and criticize constructively like an adult.
•  » » » » 2 months ago, # ^ |   +6 Everyone knows your polite words, fuck, shit, bullshit. That's amazing. This is your upbringing yourself. Leave it alone anyway.To be honest, I was not aware of your feedback even before the round ended and I had nothing to do with it. Sorry if this makes you misunderstand.Another topic is about constraints. Could you explain why such constraints were bad more detailed? For me, I don't think so. Rather, it was set deliberately by me. I don't know why (and I don't think) the constraints of problem C is bad, as I had already mentioned in my last comment. For problem H, I ever proposed this constraints and explained why to do so to everyone concerning this issue. This is because, as always, we allow sub-optimal solutions to pass just for kindness. As you can see, the TL of every problem is very far away from its intended solution. When you select an algorithm that can probably get TLE, you should take your own risk. Now consider your arguments to support your opinion that H is shit. I think that there is eertree on dequeue Why do you ignore the sentence "However I have never seen an implementation of it"? so it's not like it's something groundbreaking Why do you try to refuse groundbreaking by an $O(n \log n)$ solution? So is there anything other than arrogance in your conclusion?
•  » » » » » 2 months ago, # ^ |   +41 Yes, there's some truth to it. I won't argue that there isn't some arrogance mixed in, but setting constraints such that you allow suboptimal solutions to either AC or TLE by a slim margin isn't kindness, it's basically setting a trap for the contestants. It's also not unreasonable to expect O(NlogN) solutions to pass in 2s for N = 1e6, far from it, such solutions usually are fast enough.From your messages, you seem to be blinded by um_nik being um_nik and thus refusing to accept his (valid) criticism.
•  » » » 2 months ago, # ^ |   -11 thank you liouzhou_101 , i have figured out solving game problems using dp with the help of problem c. although it has taken more time i am very happy that i have came up with a new approach to solve game problems.
•  » » 2 months ago, # ^ |   +54 Something about E, F and G. Indeed, among testers, the grades of E, F and G have very high variance, concerning their easy implementation. Every of them happens to be super-hard or super-easy to different testers. As you may see on the standings, our round is balanced concerning the number of people who passed every problem. So it's our honor to see that we ranked these problems in a right order.That means, you did not grade E, F, and G so accurate, but it's not surprising. Let the statistics speak for themselves.
•  » » » 2 months ago, # ^ |   +39 I mean, I just want to mention the slight possibility that the round appears to be balanced according to the number of solves, solely based on the fact that they were ordered this way to begin with? As such, many would've disconsidered to solve some problem during contest solely due to the pressure of not having solved anythinf earlier (and by extention, you'd think that the problems, the later they appear, the harder they get, so your bet is safer with the easier problems. Although this is a bad mentality)To futher argument this, today I was at school and the teacher assigned us to upsolve this round. For D and E, very few people caught on the solution. But at problem F, almost half found the solution in less than 20 minutes (in this time, some even implemented it)
•  » » 2 months ago, # ^ |   -33 Um_nik we all know you are getting jealous because as the author mentioned you are the only problem setter who solved all the problem and you are also feeling jealous because you can't perform in the contest : )"I know that it is from Anton"what do you mean it is from anton ??and do anton personally request you to solve his problem??I guess you high-rated top coders are always doing something which the world doesn't know as the same as HANS NIEMANN cheating in a fancy way in the chessand if you by chance perform you get a chance to win the global round right??but see how selfish and rubbish you are : ( well, as all the CP world knows how bullshit and ugly you are to criticize anything : ) don't you remember once Russians also do criticize you by shelling bombs when you go under the tunnel : ) we also can say at the time to put your ass in front of the bomb because your ass is so big that it can intake all the explosion too : ( little cheap brat : (
 » 2 months ago, # |   +2 extremely weak and poor test cases in B , is this a joke?
 » 2 months ago, # |   0 can anyone tell me what is room, is it just random members assign to every room? and changes in every contest or there is anything else
•  » » 2 months ago, # ^ |   0 " is it just random members assign to every room? "Yes and you can only make hacks on people in your room.
•  » » » 2 months ago, # ^ |   0 thanks, could you please also tell me what is the meaning of problem locked?
•  » » » » 2 months ago, # ^ |   0 https://codeforces.com/blog/entry/456Read the 5th rule
•  » » 2 months ago, # ^ |   0 Yes, contestants are randomly assigned to rooms. It's only relevant for hacking. If you lock a problem (only possible after passing pretests), you can view the submissions of others in your room for the same problem and try to hack them (construct a test case where you think their submission will fail). The rooms make the hacks more fair, since each person is visible from a relatively small pool. Otherwise, if anyone can hack anyone, then except for those near the top, the probability that somebody's submission would be examined by a hacker, out of thousands of people, becomes extremely small, and getting hacked becomes a case of extreme bad luck.
 » 2 months ago, # |   +7 Nice B, awesome tests
 » 2 months ago, # |   +50 I'm really disappointed with this contest. One would think that, being a global, problems would be great and well prepared. Well... A huge load of FSTs in B and in problem C I still can't figure out why would you include negatives, it doesn't affect the problem and can make people have WA if they do x % 2 == 1 to check if number is odd. Ideas were cool, but bad round in general.
•  » » 2 months ago, # ^ |   +6 Yes
•  » » 2 months ago, # ^ |   0 I thought this was my chance to go a little above 1200 since I became exactly 1200 two contests ago, but instead I'm now back to gray. I'm not intending to blame others for my performance but..
•  » » 2 months ago, # ^ | ← Rev. 3 →   0 If you experienced global round many times, you will never think like that. A global round always taught in a painful way.And I don't know why many FSTs of B matter. Making strong pretests is obviously good to participants, but it is not mandatory. Sometimes FSTs are needed for participants to implement more error-freely and accurately. This time I failed D in system testing, but I don't blame setters.FST means that a participant wrote wrong code, so that participant should be held accountable for the wrong code. But I often feels this fault is completely overshadowed and only setters are blamed. Isn't it?
 » 2 months ago, # |   -16 Testcases for problem B sucks, or maybe the problem itself!!
•  » » 2 months ago, # ^ |   -12 same like Educational Codeforces Round 136 problem b also. really very bad contests
 » 2 months ago, # |   +1 What a tough contest!
 » 2 months ago, # | ← Rev. 4 →   0 ‎
•  » » 2 months ago, # ^ |   +2 Take a look at Ticket 16229 from CF Stress for a counter example.
 » 2 months ago, # |   +10 Weak pretest for problems B and D, also description for D, E, and F can be better.
 » 2 months ago, # |   0 Can someone explain to me how the non-DP solution works for C?
•  » » 2 months ago, # ^ | ← Rev. 2 →   0 It's some caseworks. Let number of odd and even numbers a and b. Answer only depends on a mod 4 and b mod 2. If b is odd, Alice loses when (a mod 4==2) and wins else. If b is even, Alice wins when (a mod 4 == 0 or 3) and loses else. Proof is not so hard, so I recommend you to think about it:)
 » 2 months ago, # |   +15 Why was there no pretest for max value = 2e9 in B((((
 » 2 months ago, # |   +1 what the heck is there in testcase 36 in question B can anyone tell the corner case?
 » 2 months ago, # |   0 Can anyone explain why I'm getting TLE?https://codeforces.com/contest/1738/submission/174127596https://codeforces.com/contest/1738/submission/174136625
•  » » 2 months ago, # ^ |   +6 Oh my gosh you didn't type return after the if statement that checks if the dp value is already calculated. So the pre-calculated values always gonna be recalculated. What a sad mistake
•  » » » 2 months ago, # ^ |   0 Lol...Thankx
•  » » » » 2 months ago, # ^ |   0 I strongly recommend using -Wall -Wpedantic flags when compiling your code.In this particular case you'd get > g++ -Wall -Wpedantic a.cpp a.cpp: In function ‘int DP(int, int, int, int)’: a.cpp:37:60: warning: statement has no effect [-Wunused-value] 37 | if(dp[even][odd][turn][sum]!=-1)dp[even][odd][turn][sum]; | ~~~~~~~~~~~~~~~~~~~~~~~^ `
 » 2 months ago, # |   -26 Thanks for the k=0 in problem D that takes away my LGM.
•  » » 2 months ago, # ^ |   +65 Aren't you already a LGM? Laurie
 » 2 months ago, # | ← Rev. 2 →   +10 How To Solve C in O(1) ??
 » 2 months ago, # | ← Rev. 2 →   +2 SpoilerWork out E in 30 minutes after the competition,and FST in problem B(QAQ).My solution for E:Firstly,consider a special case:there's no zero in array $a$.We notice if we put a "partition" between $a[i],a[i+1]$,we must put a "partition" between $a[j],a[j+1]$ as well,where $(a[1]+...+a[i])=(a[j+1]+...+a[n])$ (except the "partition" in the middle).In other words,the "partitions" are in pairs.So the answer is $2^{k},k$ is the number of pairs.Now let's consider an array $a$ including zeros.Remove all zeros from $a$,we get a new array $b$.The same as the special case above,if we put a "partition" between $b[i],b[i+1]$,we must put a "partition" between $b[j],b[j+1]$ as well,where $(b[1]+...+b[i])=(b[j+1]+...+b[n])$.Because there're zeros,the situaion is a bit more complex:Assume there're $x$ zeros between $b[i],b[i+1]$ and $y$ zeros between $b[j],b[j+1]$,the number of plans to place "partitions" is:$\Sigma^{min(x+1,y+1)}_{i=0}C^{x+1}_{i}C^{y+1}_{i}$.Take care of boundary conditions:-all numbers are zeros-the array has zeros at both the beginning and the end-the "partition" in the middle
 » 2 months ago, # |   +2 wtf is B maintest 36?
•  » » 2 months ago, # ^ |   +2 do you know what is even worse? failing on main test 48.....worst contest for me till now.
•  » » » 2 months ago, # ^ | ← Rev. 2 →   0 that would be yesterday and today both for me, sigh wud have been 1350 by now if yesterday and today both didn't fst, and now I'll be 1100
 » 2 months ago, # |   +13 Why just why :(It was last minute I couldn't fix it.
•  » » 2 months ago, # ^ |   +24 Naturally, as there's not much points expected in hacks nowadays, people start reading when they think they don't have the time to solve the next problem.
•  » » » 2 months ago, # ^ |   +8 Oh that makes sense now, because most of the time you have 10-20 extra minutes after solving last problem so you spend it on hacking :DThanks for explaining.
 » 2 months ago, # |   +4 Div 1.000002
 » 2 months ago, # |   0 how to solve C through Dp?
•  » » 2 months ago, # ^ | ← Rev. 2 →   +16 For every move player will either choose a even or odd number (offcourse only if they are present) At the end if alice has even sum then he wins otherwise BobThere are basically 3 dp states 1. Number of even numbers 2. Number of odd numbers 3. Parity of alex's sum
•  » » 2 months ago, # ^ |   0 Check CSES removal game, DP solution is based on that only imo
 » 2 months ago, # |   0 :(
 » 2 months ago, # |   0 C was not a good problem. It was more like writing all test cases and coming up with a solution.
•  » » 2 months ago, # ^ |   0 I did something quite similar to that
•  » » 2 months ago, # ^ |   +1 Except it was not the intended solution...
•  » » 2 months ago, # ^ |   +3 Back in my days (~5 years ago), green and blue people wouldn't call out the problems as good or bad, unless there was some unavoidable issue like wrong test cases or ambiguous interpretation.Things seemed to have changed over the years... ( some other comments are there on this line as well )
 » 2 months ago, # |   0 When the rating will be updated?
•  » » 2 months ago, # ^ |   0 Why did you wait to see some negative delta lol
 » 2 months ago, # |   -7 Second problem pretests have extremely disappointing quality ^(
 » 2 months ago, # |   -18 B's pretests are weaker than my sperm quality.
•  » » 2 months ago, # ^ |   +20 Instead say "B's pretests are weaker than my jokes quality"
•  » » » 2 months ago, # ^ |   -16 My sperm would still be weaker.
 » 2 months ago, # |   -31 Shittiest round ever made...
 » 2 months ago, # |   -23 Worst contest I have ever seen...B pretest are so weak..
 » 2 months ago, # | ← Rev. 2 →   0 Could someone please look at my submissions for the first question. I kept getting a runtime error(Exit code is -1073741819), I have no idea why. It was running fine on the online compiler for the sample test case. https://codeforces.com/contest/1738/submission/174119493
•  » »