351F44's blog

By 351F44, 2 years ago,

Hello Codeforces!

We invite you to Codeforces Round #821 (Div. 2) starting on 19.09.2022 17:35 (Московское время). The round is rated for users whose rating is lower than 2100.

All problems were mainly created and prepared by me. One problem is revised by mejiamejia. I would also like to thank:

You will be given 5 problems with one subtask and 2 hours to solve them. The score distribution will be announced closer to the start of the round.

Good luck, and have fun!

UPD1: Score distribution is 50010001500 — ( 1500 + 750 ) — 2750.

UPD2: System testing has been finished. Congratulations to the winners!

Out of competition

Official participants

UPD3: Editorial is published.

• +401

 » 11 days ago, # |   +292 How is this post 2 years old lol
•  » » 11 days ago, # ^ |   +203 If you create a blog post and save it as a draft, when you publish it, it is labeled with the creation time instead of the publish time for some reason. But it still takes a huge amount of foresight to create a blog post for a contest 2 years in the future...
•  » » » 9 days ago, # ^ |   0 I think contest stock has been elapsed for that reason they took long back created set of problems or like that!!!
•  » » 10 days ago, # ^ |   +17 Does it mean, I have to wait approximately half year more for my contest?)
 » 11 days ago, # | ← Rev. 2 →   +125 2 years ago ◔_◔
•  » » 10 days ago, # ^ |   +28 It might have been a clone of this announcement before it got edited and published, since it is also a contest prepared by the same author two years ago.
•  » » » 10 days ago, # ^ |   -18 That's not how that works. Check SecondThread's comment above
 » 11 days ago, # |   +60 2 years ago!!LOL!
 » 11 days ago, # |   +97 Imagine getting a necroposting warning for commenting on a future contest
•  » » 9 days ago, # ^ | ← Rev. 2 →   +24 "This post was published a long time ago. Please refrain from commenting unless you have a really reasonable cause to leave a comment. Necroposting is discouraged by the community." The reasonable cause is that the contest is starting in 4h :)
 » 11 days ago, # |   +51 This must be a long-term project of creating a VERY VERY HIGH-CLASS Contest.
 » 11 days ago, # | ← Rev. 2 →   +118 Imagine waiting 2 years for a score distribution
•  » » 11 days ago, # ^ | ← Rev. 3 →   -39 LoL,
 » 11 days ago, # |   +41 Imagine preparing a blog and waiting 2 years on round queue to publish the blog
 » 11 days ago, # |   -12 I am coming back every hour to see if any rated contest has been scheduled or not, suddenly there is contest rated 2 years ago! LOL no literally LOL!
 » 11 days ago, # |   +31 Hello, please put more contests on weekends thanks
•  » » 11 days ago, # ^ |   +4 This would be great.
•  » » 11 days ago, # ^ |   +4 I agree
 » 11 days ago, # | ← Rev. 5 →   -51 Lol
•  » » 11 days ago, # ^ | ← Rev. 2 →   -38 .
•  » » » 11 days ago, # ^ | ← Rev. 2 →   -40 !!!!
 » 11 days ago, # | ← Rev. 2 →   +113 Writes blog . . .Gets published
•  » » 8 days ago, # ^ |   0 LOL
 » 11 days ago, # |   +11 wow, what a scheduled site :) They have prepared times of contests since more than tow years ago!
 » 11 days ago, # |   -14 Is it just me who keeps coming back every hour to see if any rated contest has been scheduled ?
 » 11 days ago, # |   +8 wow 2 years ago
 » 11 days ago, # |   +9 Finally getting a canon episode after 2 years of fillers :)
 » 11 days ago, # |   +19 King Arpa orz
 » 11 days ago, # |   +8 2 years ago ? amazing!!!
 » 11 days ago, # |   +9 This is what called " time travel to 2020 " .
 » 11 days ago, # |   +5 2 years ago ? it is ez to flash to see a scoring distribution >
 » 11 days ago, # |   +43 When you use internet explorer to make a contest:
 » 11 days ago, # |   +8 i like how just 2 of the testers are actually in div2
•  » » 11 days ago, # ^ |   +10 More of them were probably Div2 when they tested but their rankings have gone up in 2 years..
•  » » 11 days ago, # ^ |   0 I feel the same way, maybe I should invite some testers with lower ratings.
•  » » 8 days ago, # ^ |   0 but the difficulty balance/overall was amazing for div2 round nonetheless, thanks!
 » 11 days ago, # |   0 Hmm! 2 years ago! It's a long queue then
 » 11 days ago, # |   0 Two years old announcement!! OMG
 » 11 days ago, # |   +17 Eager to participate in a contest which was ideated before I even started Competitive Programming!
 » 10 days ago, # |   -52
 » 10 days ago, # |   +14
•  » » 10 days ago, # ^ |   0 Lmao, Rotavirus day!!!
 » 10 days ago, # |   0 Was this contest planned 2 years ago? :P
 » 10 days ago, # | ← Rev. 2 →   +79 Blog owner waiting
 » 10 days ago, # |   0 I wonder if this round will be more difficult
 » 10 days ago, # | ← Rev. 2 →   0 I also wanna write a contest announcement and save it as draft now and will publish 4 years later ,,btw you are making all of us necropost
 » 10 days ago, # |   0 The round drafted to years ago! Wow!
 » 10 days ago, # |   +3 Blog should also contain:Thanks to 351F44 for coming up with the idea to use the drafted blog.Really a nice idea, I think almost 50+comments will be just on this (at the end of contest).
 » 10 days ago, # | ← Rev. 2 →   0 It's amazing... Still i cannot believe this...it was created 2years ago
 » 10 days ago, # |   0 Imagine creating a blog in corona period and posting it two years later when it's finally over...
 » 10 days ago, # |   0 2 years ago I have only 0 ratings lol
 » 10 days ago, # |   0 I created a blog too in case i become master and prepare a contest :)
 » 10 days ago, # |   +13 OP’s first contest was held on 8/21 two years ago This blog was created two years ago and the Round is 821
•  » » 10 days ago, # ^ |   +24 I didn't notice that until I see this comment
 » 10 days ago, # |   0 Time to upsolve everything from 2 years ago...
 » 10 days ago, # |   0 I think pset might be harder than as usual div.2 :(
•  » » 10 days ago, # ^ |   0 What made you come to this conclusion?
•  » » 8 days ago, # ^ |   0 hahaha
 » 10 days ago, # |   +11 In the spirit of 351F44, I too have created a draft for a future round:https://codeforces.com/blog/entry/107056See you all in 2 years for Round #999
 » 10 days ago, # |   0 2 years ago lol?
 » 10 days ago, # |   +3 when will there be a weekend round T_T
 » 9 days ago, # |   0 this contest will harder for me
 » 9 days ago, # |   +3 I hope this everyone can achieve good results, and I hope I can also break through
 » 9 days ago, # |   +20 Jokes aside, I can think of two plausible explanations for the 2-year-old timestamp: It really did take that long to actually finalize the contest, possibly because people got busy or unavailable, or there was a lot of back-and-forth about the problems, etc. Observe that 351F44 was not involved in problemsetting since August 2021, so they may have been preparing this contest across two years. 351F44 started writing a blog entry two years ago (which may have been completely unrelated to any contest announcement) and then abandoned it for some reason. Two years pass, and they now decided to host a contest, realized that they had a draft from back then, and figured it would be amusing to edit that ancient draft to reflect this new contest, in order to see how people would react to the apparent age of the posting.
 » 9 days ago, # |   -9 2 years later wow
 » 9 days ago, # | ← Rev. 4 →   -17 wow 2 years ago
 » 9 days ago, # |   +8 I hope I'm the Candidate Master this time. Come on！
 » 9 days ago, # |   +2 Though I don't participate because the next day is one of my most important event at my school...But two years for participating, waiting, and then publishing.I have a huge respect for all the people who built this contest!Hope everyone luck!
 » 9 days ago, # |   0 They are preparing for this from 2 years, even tourist will have to think if he participates.
 » 9 days ago, # |   -17 " i think, this contest was made for me only. "
 » 9 days ago, # |   +9 When will the score distribution be announced?
•  » » 9 days ago, # ^ |   0 We will update soon.
 » 9 days ago, # |   -18 Codeforces Language Picker -- chrome extension to fix codeforces language picker.
 » 9 days ago, # |   +9 The score distribution will be announced closer to the start of the round.So, we have to wait 2 years for score distribution.
 » 9 days ago, # |   0 where is score of problems ?the contest will start!
 » 9 days ago, # |   +7 I hope I reach Expert today
•  » » 9 days ago, # ^ |   0 Good_Luck Brother
•  » » 9 days ago, # ^ |   +5 and you did :)
 » 9 days ago, # |   +4 What about "The score distribution will be announced closer to the start of the round."??
•  » » 9 days ago, # ^ |   0 tru
 » 9 days ago, # |   +2 351F44 may be author forgot to update score distribution. It's 3 minutes left to start contest.
 » 9 days ago, # |   0 okay but whats the point of hiding scoreboard?
 » 9 days ago, # |   0 2 years ago^_^
 » 9 days ago, # | ← Rev. 3 →   +19 How many problems can you solve/submit in one minute in a contest ?tourist : yes(tourist orz)
 » 9 days ago, # |   0 Nice to see that this contest is created 2 years ago..
 » 9 days ago, # |   0 It's a nice contest , because I think each promblem is of the almost right difficulty .
 » 9 days ago, # |   +8 How to solve D2?
•  » » 9 days ago, # ^ |   +12 Yes, i also wanna know. I think it is some dp that i'm just too stupid for. My greedy doesn't worked out
•  » » » 9 days ago, # ^ | ← Rev. 2 →   +3 dp solution idea:create array pos of indexes of points we need to changeit's easy to see that we only want to change the neighbors in our array using the x operation several timesdp from left to right, 2 values — cost if used X for points i and i — 1 and if not used. Points modified with x add (pos[i] — pos[i — 1]) * x, other add y / 2 for each
•  » » » » 9 days ago, # ^ |   0 Nice solution, thanks for helping out
 » 9 days ago, # |   0 Was this contest relatively easy compared to other div2 contests or I just had a lucky day?
•  » » 9 days ago, # ^ |   +12 I think it's easier. but obviously, the problems were interesting with perfect difficulty.
 » 9 days ago, # |   +9 Well-balanced contest, thanks for authoring it, loved problems <3
 » 9 days ago, # |   0 After one day's work, I am too dumb to code...
 » 9 days ago, # |   0 how to do C?i could not think of any idea.
•  » » 9 days ago, # ^ |   +3 let the first element of array has parity p . now check for the last element whose parity is p (let its position be j) .now for all 'i' from 1 to j-1 elements whose parity of element is p, apply one operation on i and j since both has same parity arr[i]+arr[j] will definitely be even i.e a[i]=a[j]now for all i from 2 to n whose parity is not equal to p apply one operation on 1 and i since arr[1] and arr[i] are of different parity their sum will be odd i.e arr[i]=arr[1]after this every element in array becomes equal.
 » 9 days ago, # |   0 How to solve C?
•  » » 9 days ago, # ^ |   0 I can describe my algo: Check weather first element even or not (if it is even) Find last occurrence of even element Now go through the whole array from left to right and if we meet even number do (i, lastEvenInd) to make them equal. If we meet odd number do (1, i) to make it equal to the first element Pretty the same if first one is odd, but all "odd" replaced with "even" and vice versa
•  » » » 9 days ago, # ^ |   +30 Just do $l=1, r=n$ as first operation, then you can make all other elements equal to the border ones. Saves you the analysis by cases.
•  » » » » 9 days ago, # ^ |   0 Yep, you're right. Thanks for advise
•  » » » 9 days ago, # ^ |   0 Ohh understood, i was bit close to that logic but not able to solve. Thx
•  » » 9 days ago, # ^ |   +11 Make a[1] and a[n] equal. For i = 2 to n — 1, if a[i] + a[1] is odd, then the operation is (1,i), otherwise (i,n). After this we can achieve an array with the same number using n — 1 operations.
 » 9 days ago, # |   0 nice contest but isn't problem A a little hard for a?
 » 9 days ago, # |   0 The contest is quite tough for me :((((
 » 9 days ago, # |   0 Solved A, B in contest for the first time, yey!!
•  » » 8 days ago, # ^ |   0 congrats!!!
 » 9 days ago, # |   0 Can anyone please tell me where I am getting wrong? My submission is : 172733662
•  » » 9 days ago, # ^ |   0 have you checked the output for different scenarios for the gcd calculator function?
•  » » » 9 days ago, # ^ |   0 Thanks I got it now.
 » 9 days ago, # |   0 Very nice problems!I have really enjoyed C!Congratulations to authors!
•  » » 9 days ago, # ^ |   0 How to do that C?
•  » » » 9 days ago, # ^ |   0 If first value is even, change all evens to last even, then change all odds to the first even (which is now equal to the last even).Similarly, if first value is odd, change all odds to last odd, then change all evens to the first odd (which is now equal to the last odd).In both cases, all values become equal.
•  » » » » 9 days ago, # ^ |   0 Thx. By the way what would be the problem rating of question C?
•  » » » » 9 days ago, # ^ |   0 I don't think that much casework is required.Just Make first and last value to be same -> Operation 1 NThen for all elements k in range 2....N-1,If parity of element is equal to first element, apply k Nelse apply 1 k
•  » » 9 days ago, # ^ |   0 Can i get your C submission ? . i can solve D but C is not ,
•  » » » 9 days ago, # ^ |   0
 » 9 days ago, # |   +26 E is the most ingenious task I have ever seen.
 » 9 days ago, # |   0 https://codeforces.com/contest/1733/submission/172736981 can somebody help me to find a stress test for my solution for c
•  » » 9 days ago, # ^ | ← Rev. 2 →   +6 test case: Spoiler1 4 4 3 1 2 your answer : Spoiler5 1 2 1 3 3 4 2 3 1 2 5 > 4Here is an answer: Spoiler3 1 4 1 2 1 3
 » 9 days ago, # |   0 Is there any chance of FST today? :3
 » 9 days ago, # |   +8 In D1, what would be answer for the following test case Test case1 4 10 2 1111 1001 6 right?
•  » » 9 days ago, # ^ |   +11 in D1,5 <= n <= 3000
•  » » 9 days ago, # ^ |   0 n will be greater than 4
•  » » 9 days ago, # ^ |   0 min array length is 5
•  » » » 9 days ago, # ^ |   +4 You guys just saved me from a heart attack, thanks god
•  » » 9 days ago, # ^ |   0 Not valid, since $n \geq 5$. I was worried about this case too, but they always made sure it's possible to deal with a consecutive mismatch through two $y$-swaps.
•  » » 9 days ago, # ^ |   0 It's an invalid test case.N>=5, Mentioned in the constraints.
•  » » 9 days ago, # ^ | ← Rev. 2 →   0 Thanks for pointing that out! I totally missed this case. (So if not for the restriction on $N$ I would have failed probably pretest but for sure system test. Note: Always think about small cases! The only special case I thought about was with $N=2$, which would have needed a seperate consideration too.)
 » 9 days ago, # |   +63 I feel like D2 should not have been worth only half of D1, since the additional work required for D2 that isn't covered by D1 is significantly tougher than D1 by itself, in my opinion. Like, I understand the argument that D2 by itself is worth 2250, but I think the distribution should've favored D2 more, to something like (1000 + 1250) instead, which would also suggest that D1 is easier than C (which, imo, is the case, if only because it's easy to get confused in C by the two scenarios, whereas D1 is very straightforward).
 » 9 days ago, # |   0 how to solve B and C?
•  » » 9 days ago, # ^ |   0 In B, there will always be at least 1 player with 0 win and at least 1 player with 1 win. So exactly one of x and y will have to be 0 and other one will have to be a divisor of n — 1, since there are n — 1 games. Figure out the rest.
•  » » » 9 days ago, # ^ |   0 I was able to figure out almost everything in the problem but still the test cases were not passing , i submitted the code like 10 diff times.
•  » » 9 days ago, # ^ |   0 B: One of $x$ or $y$ must be 0, because the loser of the first round wins 0. WLOG let $x$ be the non-zero value. Then everyone who won at least once would win exactly $x$ times, so $n - 1$ must be divisible by $x$. Now it's easy to make somebody win $x$ times and then let the next challenger be the winner for $x$ rounds and so on (it's simpler if 2 wins at first, so the winners are all gonna have IDs of the form $2 + ix$). C: If the first value is even, then apply the operation on each even with the last even, to make all evens equal to the last even. Then apply the operation on each odd with the very first value (even) to make all odds equal to the first even (which is now equal to all other evens). Similarly, if the first value is odd, then apply the operation on each odd with the last odd, to make all odds equal to last odd. Then apply the operation on each even with the very first value (odd) to make all evens equal to the first odd (which is now equal to all other odds).
 » 9 days ago, # |   0 A great contest and 200+ rating increment :) Problem D2 is really nice Thanks !
 » 9 days ago, # |   +35 You changed the constraints of D2 after the contest started and didn't even bother to make an announcement? I opened the “complete problemset” at the beginning of the contest. Got so many runtime error because of this. This is pathetic.
•  » » 9 days ago, # ^ |   0 Sorry for that. The constraint changed just before the contest start, and it seems to have taken some time to reflect on the problem page.
 » 9 days ago, # |   0 imo, today contest is a lot of casework. It's not very interesting.
 » 9 days ago, # |   +31 Problem E is similar to JOI 2009 Finals Problem 4. Also Problem D2 can be solved in $O(n)$ time
•  » » 9 days ago, # ^ |   +18 Can you explain your O(N) approach?
•  » » » 9 days ago, # ^ |   +8 What's a non-O(n) approach? I couldn't think of one except an O(n) algorithm.
•  » » » 9 days ago, # ^ |   +42 I used a simple DP whose size is equal to the number of mismatched positions. $dp[i]$ is the optimal way to pair up the first $i$ mismatches, except if $i$ is odd, in which case, one element is left unpaired. The array $mis[]$ stores the mismatched indices.For even $i$ (nothing should be unpaired), $dp[i] = \min (dp[i - 2] + (mis[i] - mis[i - 1])x, dp[i - 1] + y)$For odd $i$ (one element unpaired), $dp[i] = \min (dp[i - 2] + (mis[i] - mis[i - 1])x, dp[i - 1])$
•  » » » » 9 days ago, # ^ | ← Rev. 2 →   0 This can be made even simpler by not separating into an even and odd case and changing the recurrence to $dp[i] = min(dp[i - 2] + (mis[i] - mis[i - 1])x, dp[i - 1] + y/2)$ and setting $dp[1] = y/2$.
•  » » » » 8 days ago, # ^ | ← Rev. 2 →   +4 Hello. For even i, in the second part of the min function, how can you assume that the unpaired index in dp[i-1] is not i-1? Because if it is i-1, you cannot pair it with i with y cost. Thanks.
•  » » » » » 8 days ago, # ^ |   +4 I only use the DP for the case of $x < y$ (D1 has a trivial algorithm that can be copied for $x \geq y$ in D2). If $dp[i - 1]$ has the last element as unpaired, then the minimum of the two considered values will always be $dp[i - 2] + (mis[i] - mis[i - 1])x$. Therefore, the $dp$ array will never store a value that corresponds to spending $y$ cost for an adjacent pair.
•  » » » » 8 days ago, # ^ | ← Rev. 2 →   0 The cost of the operation is x, if mis[i-1] + 1 == mis[i]. Can you please explain, why you are multiplying x with the position difference. Why (mis[i] - mis[i-1]) * x ? Thanks
•  » » » » » 8 days ago, # ^ |   0 Let's say there is a mismatch at index $p$ and the next mismatch is at index $q$. One way to flip both of these is to apply the operation on $(p, p + 1)$, then on $(p + 1, p + 2)$, then $(p + 2, p + 3), \ldots, (q - 2, q - 1), (q - 1, q)$. This will flip index $p$ and $q$ as desired, while indices in between (if any) will flip twice and will therefore be unchanged. There are $q - p$ operations being performed here, each with a cost of $x$, so the total cost of this approach is $(q - p)x$.It is easy to observe that if any $x$-operation is to be performed at all, an optimal solution would apply it to some mismatched index chained to the next mismatched index as described above. Therefore, the DP only considers whether the latest mismatched index should be restored through an $x$-operation chain from the previous mismatched index or not, choosing the minimum of the two options.
 » 9 days ago, # |   0 anyone else totally misread A without the second mod k? just me being uniquely bad at reading problem statements... again? oh.
•  » » 9 days ago, # ^ |   +19 My misreading was more severe. I thought the operation was a[i] = a[i] % k, a[j] = a[j] % k and then swap a[i], a[j]. I have no idea how I could read like that.
•  » » » 9 days ago, # ^ |   0 Same.
•  » » » 9 days ago, # ^ |   0 same
•  » » 9 days ago, # ^ |   0 misread C and didnt note m had to be less than n and wasted 30 mins coming up with a soln then realized after seeing pretest 1 fail and got correct soln 10 mins after contest ;)i should really get better at reading in contest nerves
 » 9 days ago, # |   +7 Solved 3 and one partial problem on Div.2 for the first time. Maybe the problems were a bit easier than usual Div.2.
•  » » 9 days ago, # ^ |   +19 I don't think they were easier, you just did a great job
•  » » » 9 days ago, # ^ |   +1 Thank you.
•  » » » 9 days ago, # ^ |   +4 D is not supposed to be solved by 4k people. This contest was a speedforces.
 » 9 days ago, # | ← Rev. 4 →   -33 ◉_◉
 » 9 days ago, # | ← Rev. 3 →   -10 is D2 just D1 with x >= y, and if x < y then we:get all the indices with different value of a[i] and b[i] clearly we can only make flip the bit pairwise. So the number of differences must be even. lets go from right most index to left most, If the gap (i — j) is D, then cost is D*x, but cost is capped at y. It's clear that it's always best to greedy starting from the right most index.Just greedy imo solved in O(n) time. Idk what's the n^2 solution is given the max input is only 5k
•  » » 9 days ago, # ^ |   0 then why did my approach — 172725963 — get a WA2? what cases did I miss?
•  » » 9 days ago, # ^ |   +16 I think that this does not work in this case: Test8 2 71001100100000000It is better to take indexes 4 and 5 with x and 1 and 8 with y instead of using x twice2 + 7 < 6 + 6
•  » » 9 days ago, # ^ |   +8 This is not correct. It is not necessary that you always match consecutive ones. Consider all non-matching indices to be $[1,3,4,7]$. You might match 4 with 7 and 1 with 3(cost = $min(y,3x) + min(y,2x)$). But matching 1 with 7 and 3 with 4 could be better($min(y,6x) + x$). This may happen when $y = 2x$ for example.
•  » » 9 days ago, # ^ |   +8 This is incorrect. Imagine that the indices where a and b are different are 1, 3, 4, 7, x = 1 and y = 2. Your solution would match 4, 7 and 1, 3 for a total cost of 4. But the optimal cost is 3, from matching 3, 4 and 1, 7.
•  » » 9 days ago, # ^ | ← Rev. 3 →   +10 That should not work. Do you have a submission to try and hack? X_XX_X with $y=3$ and $x=2$ should hack it. EditFunny, 6 people posted the same counterexample nearly at the same time. :)
•  » » 9 days ago, # ^ | ← Rev. 3 →   0 Consider case:12 1 6100001100001000000000000According to you greey algo,the strategy is:-change the 7-th and 12-th bit costing 5;-change the 1-th and 6-th bit costing 5.The total cost is 5+5=10.But the optimal strategy is:-change the 1-th and 12-th bit costing 6;-change the 7-th and 6-th bit costing 1;The total cost is 6+1=7.Maybe I misunderstand you method,can you explain it?
•  » » 9 days ago, # ^ | ← Rev. 2 →   0 Greedy doesn't work. Consider the following test-case: 6 2 5 101101 000000 A greedy approach would pair the first two 1s with a cost of 4, and the last two 1s with a cost of 4 as well, for a total cost of 8. However, the optimal choice would be to pair the middle two 1s for a cost of 2, and then the first 1 with the last 1 with a cost of 5, for a total cost of 7. If your submission was truly accepted, then it could not have followed the greedy approach that you just described (unless the pretests were really bad, but I doubt that's the case, considering how many penalties I observed in D2).
•  » » 9 days ago, # ^ |   0 Ok this doesn't work then. I guess it'd have to be DP.
 » 9 days ago, # | ← Rev. 5 →   -18 Can anyone help me finding the cause of getting runtime error in problem C?This is my submission of CUPD:GNU C++20 (64) giving AC but GNU C++17 and GNU C++14 giving RE. Don't know why!! AC Submission RE submission Can anyone explain?
•  » » 9 days ago, # ^ |   0 The link is not working!!
•  » » 9 days ago, # ^ |   0 I used GNU C++17 (64) and got Accepted.
•  » » » 9 days ago, # ^ |   0 But why?!!!!
•  » » » » 9 days ago, # ^ |   0 You have a problem in this line : ll mn=a[od[od.size()-1]],pos=od[od.size()-1]; Take this test case for example : 1 1 0 Here (od.size() == 0) so od[od.size() — 1] ==> is like od[-1], which is a problem in cpp, I'm not shure but I think it's a buffer overflow.
•  » » » » » 9 days ago, # ^ |   0 Look, there is condition if(a[1]%2) then do the odd part first else do the even part first.so there will be at least one element in the container. so its not the problem.in your case. even part will execute first.
•  » » » » » » 8 days ago, # ^ |   0 sorry, you are right. actually it's this line : ll mn=a[ev[ev.size()-1]],pos=ev[ev.size()-1];for this test case : 1 1 1000 in this case (ev[ev.size() — 1] ==> 1000) so a[1000] will be out of boundary.
•  » » » » » » » 8 days ago, # ^ |   0 ev[ev.size()-1)==>1 not 1000.
•  » » » » » » » » 8 days ago, # ^ |   0 ev.size() == 1ev.size() — 1 == 0ev[ev.size() — 1] ==> ev[0]ev[0] == 1000remember 1000 is even so ev == {1000}a[ev[0]] ==> a[1000]
•  » » » » » » » » » 8 days ago, # ^ |   0 Hey brotherman, In ev I'm storing the position of evens not the value. :3
•  » » » » 8 days ago, # ^ |   0 Ok, here is your code giving AC in GNU C++17 : 172837822Changes :for(ll i=od.size()-2;i>=0;i--) ==> for(ll i=(ll)od.size()-2;i>=0;i--)for(ll i=ev.size()-1;i>=0;i--) ==> for(ll i=(ll)ev.size()-1;i>=0;i--)for(ll i=ev.size()-2;i>=0;i--) ==> for(ll i=(ll)ev.size()-2;i>=0;i--)for(ll i=od.size()-1;i>=0;i--) ==> for(ll i=(ll)od.size()-1;i>=0;i--)od.size() is unsigned, and when you tried to subtract a bigger value it caused a problem, you can search more about that.
•  » » » » » 8 days ago, # ^ |   0 great! thanks btw.
•  » » » » » » 8 days ago, # ^ |   0 you're welcome.
 » 9 days ago, # |   +3 such a great contest! orz 351F44
 » 9 days ago, # |   0 for the second case of B,why can't make each player won x times to achieve it? just like print:2 3 4 5 6 7 8 instead of -1? qwq
•  » » 9 days ago, # ^ |   +11 cause plyer1 won 0 times then
 » 9 days ago, # |   0 I have managed to pass D2 using a naive $n^3$ dp but checking only limited transitions. Feel free to hack this.https://codeforces.com/contest/1733/submission/172714403
•  » » 9 days ago, # ^ |   0 can you explain your dp?
 » 9 days ago, # |   +1 Can someone explain the recursive formula for D2?
 » 9 days ago, # |   0 Can anyone explain D1 in a simple way please? Thank you...
•  » » 9 days ago, # ^ | ← Rev. 2 →   +9 Count how many indices have mismatches. Each operation flips exactly two bits. If the number of mismatches is odd, then it's impossible to fix all the mismatches, so the answer is -1. Otherwise, there are two cases: The exceptional case to watch out for is when there are exactly two mismatches AND they are on adjacent bit positions. In this case, you can pair them directly for a cost of $x$, or you can pair each of them with some other distant bit position for a cost of $2y$ (note that this distant bit position flips twice, so it reverts to its original value). In this case, we output whichever of $x$ or $2y$ is smaller. In all other cases, it's always possible to resolve the mismatches using $y$ operations. If we have only two mismatches, then they're not next to each other (since that's covered by Case 1), so you can just use a $y$ operation. If there are more than two mismatches, you can divide the number of mismatches by 2, and pair indices from the first half with indices from the second half, so the paired indices are never adjacent and the cost is always $y$. Here, the answer is just (number of mismatches)/2 * y. This is always optimal because $x \geq y$.
•  » » » 9 days ago, # ^ |   0 Thank you,it's become clearer.
•  » » 9 days ago, # ^ | ← Rev. 2 →   0 First you must notice that if the parity of ones/zeros on string $a$ and string $b$ don't match. Then, it's impossible.Now, with the impossible case done, you can see that if for some index, the character in string $a$ isn't equal to the character at the same index in string $b$. Then, as the parity of ones and zeros of both string are equal, there must be even number of indices such that the characters don't match. You can try to prove this.So, finally, there is one last thing you have to see is that after being sure that the first two observations are indeed true.. If $k$ is the number of indices and positions are $p_{1}, p_{2}, \ldots, p_{k}$. Then, if $k \ge 4$, even if $p_{i + 1} - p_{i} = 1, 1 \le i \le k - 1$ is true, we can match $p_{i}$ with $p_{i + 2}$. The only other case is $k = 2$, for that it is simply $min(x, 2 * y)$.
 » 9 days ago, # | ← Rev. 2 →   +7 Me being happy for everyone else while getting prolly -80 myself
 » 9 days ago, # |   0 this was a nice round. solved 3 ques of Div 2 for the very first time. feels good :)
•  » » 9 days ago, # ^ |   0 and also can anyone tell me how to approach problem C.Thanks in advance
•  » » » 9 days ago, # ^ | ← Rev. 2 →   0 do l = 1 and r = n to make the edges equal then loop from 1+1 to n-1 using l = 1 and r = i to make either all evens or all odds equal to the edge then do the same from n-1 to 1+1 to make the opposite numbers this will make all the array entries equal didn't solve it yet but I think that is the correct answer.
•  » » » » 9 days ago, # ^ |   0 yes,sounds correct.will implement it ,lets see how it goes thanks btw
 » 9 days ago, # |   +18 D1 is like is it this easy, what the fuck?????
•  » » 9 days ago, # ^ |   +8 It's more like a second B problem
•  » » 9 days ago, # ^ |   +7 yes,same feeling .I checked if its a Div 2 or Div 4 contest lol
•  » » » 9 days ago, # ^ |   0 lol =)
 » 9 days ago, # |   0 When will be the editorial be uploaded for this contest ?
 » 9 days ago, # |   0 Great contest, interesting tasks, thanks!
 » 9 days ago, # |   +24 I have managed to solve problem D2 with O(N) time complexity using simple dp. https://codeforces.com/contest/1733/submission/172742046351F44 I think it would be better to make N up to 2e5, but anyway contest was great. Thanks for problems!
•  » » 9 days ago, # ^ |   +29 Thanks for enjoying! Actually, some testers gave O(n) solution of D2 already, but we decided to accept O(n^2) solution for difficulty balance.
 » 9 days ago, # | ← Rev. 2 →   +18 Submitted AC solution of D1 2 seconds after end of contest , sad
•  » » 9 days ago, # ^ |   -56 Nobody cares
 » 9 days ago, # |   0 This is my first contest. In contests this comes under unrated contest but the blog post says its rated. Can anyone clarify?
•  » » 9 days ago, # ^ |   +1 It's rated, but it takes some time for rating changes to apply, since there is system testing after the contest (which is already done for this one) and a procedure to find and remove cheaters (which can take quite a while). After that, the rating changes are applied and the contest should be moved to the rated contest list. There are exceptional scenarios in which a contest that is supposed to be rated becomes unrated (such as when a problemsetter unethically copies a problem directly from another source), but I don't think there were any issues for this particular contest, so it should hopefully be rated. Just be patient...
•  » » » 9 days ago, # ^ |   0 Thanks
•  » » 9 days ago, # ^ |   0 Until the rating changings will be done it is unrated (it usually takes about 12h-16h)
 » 9 days ago, # |   +7 OperationForces
 » 9 days ago, # |   +27 Ratings updated preliminarily. We will remove cheaters and update the ratings again soon!
 » 9 days ago, # |   0 when will solution get available ?
 » 9 days ago, # |   +16 For Problem B, I observed that either player 1 will win 0 matches or player 2 will win 0 matches. That means for a valid solution either x has to be 0 or y has to be zero.Am I correct?
•  » » 9 days ago, # ^ |   0 yes
 » 9 days ago, # |   +5 In D1 problem, I finded an bordercase.I sended two codes and both receive Accepted. But the output for this input:1 4 4 1 0110 0000is different. The correct output is 3, but in the second submission the output is 4.This special case is to n = 4, a2 != b2, a3 != b3 and x > 3y.
•  » » 9 days ago, # ^ |   +22 True. But n is guaranteed to be at least 5. So you can ignore this special case.
 » 9 days ago, # |   +3 A memorable round for me!
 » 9 days ago, # |   +18 All Top 10 USERS are newly registered except 1-2. this is so demotivated things I have seen on CF
 » 9 days ago, # | ← Rev. 2 →   -26 .
 » 8 days ago, # |   0 How to Solve E,the last problem?
 » 8 days ago, # |   0 Cyan Gang finally
 » 8 days ago, # |   0 I was inspired by this question https://codeforces.com/contest/1728/problem/D ，and write the dp dp[l][r] from dp[l+2][r], dp[l][r-2],dp[l+1][r-1], but it failed. It seems be same as the dp like others, but it is sure may be wrong. my failed solution is https://codeforces.com/contest/1733/submission/172731642 , thanks for comments!
•  » » 8 days ago, # ^ |   0 I solved this by change the initial DP, like this https://codeforces.com/contest/1733/submission/172778355and the test date is: 1 6 100 1 111111 000000
 » 8 days ago, # |   0 As an expert, i messed up in this contest :((
 » 8 days ago, # |   0 Hey, how i can check all input for Problem A? im getting wrong in test 2 in the 158 exemple, but i can't see it because has some others before.[problem:A. Consecutive Sum — Round #821 (Div. 2)]
•  » » 8 days ago, # ^ |   0 You can't. But your code fails in this test case : 1 6 2 1 9 4 7 14 1 it gives 21 as an answer but the wright answer should be 23.
•  » » » 8 days ago, # ^ | ← Rev. 3 →   0 Thanks for your help! I tried now with some repairs. In your example is giving 23. Now im stuck at example 427th lol. I started coding a few weeks ago, and i searching for new ways to solve the problems, but im trying to understand my mistakes in my logic at the contest
•  » » » » 8 days ago, # ^ |   0 1 6 3 1 1 0 0 0 1 your code gives 2, but it should be 3.
 » 8 days ago, # | ← Rev. 3 →   +1 I tried solving Problem D1, but getting wrong answer on 49th entry of test case 2, Please tell me where I am wrong....Please Help. I already did 9 wrong Submissions. ll f(ll i, string s, string s1, ll n, ll x, ll y) { if(s==s1) return 0; if(i>=n) return 1e10+7; if(s[i]==s1[i]) return f(i+1, s, s1, n, x, y); ll p=(ll)1e10+7, q=(ll)1e10+7; if(i+1>n>>x>>y; string s,s1;cin>>s>>s1; ll ans = f(0, s, s1, n, x, y); if(ans>=(ll)1e10+7) cout<<-1; else cout<
•  » » 8 days ago, # ^ |   +1 Here is a counterexample: 5 3 1 00011 00000 Your algorithm returns 3, but the correct answer is 2. You can simply apply the operation on indices $(1, 4)$ and then on $(1, 5)$. Index 1 flips twice, so it reverts to 0, while indices 4 and 5 each flip once and become 0. The cost is $2y = 2$, which is better than spending $x = 3$ cost on flipping $(4, 5)$ directly.
•  » » » 8 days ago, # ^ |   0 My code for problem D2 is giving Time Limit Exceeded at test case 3, Please help me in optimising my Approach, suggest me with this intution only, please help. ll f(ll i, string s, string s1, ll n, ll x, ll y,map&dp) { if(s==s1) return 0; if(i>=n) return 1e10+7; if(dp[s]!=0) return dp[s]; if(s[i]==s1[i]) return dp[s]=f(i+1, s, s1, n, x, y,dp); ll p=(ll)1e10+7, q=(ll)1e10+7; for(int j=0;j>n>>x>>y; string s,s1;cin>>s>>s1; mapdp; ll ans = f(0, s, s1, n, x, y,dp); if(ans>=(ll)1e9+7) cout<<-1; else cout<
 » 8 days ago, # |   0 it was good . But I miss one condition in problem D.
•  » » 8 days ago, # ^ |   0 Yeah same. Problems were fun though
 » 8 days ago, # |   0 Please upload the editorial !!! 351F44
•  » » 8 days ago, # ^ |   0 Now editorial is available.
 » 8 days ago, # |   0 No tutorial?
 » 8 days ago, # | ← Rev. 5 →   +40 Problem E is quite beautiful. First we note, for each slime its sum of coordinates increases by 1 each step. So each diagonal can hold only one slime per timestep. So Slimes will never combine. Now we look at a modified game. Imagine there are $t-x-y$ slimes in $(0,0)$. We move them all at once. If there are $S(X,Y)$ slimes in $(X,Y)$, then $\left \lceil{S(X,Y)/2}\right \rceil$ will move to the right and $\left \lfloor{S(X,Y)/2}\right \rfloor$ will move down. This way in dp-style we can determine how many slimes $S(X,Y)$ will have passed through each field. Now we start a lonely last heroic slime at $(0,0)$ and move it along the axes. It is the only one that possibly can fulfil the query (because, as we have noted, their sum of coordinates always increases by one). If $S(X,Y)$ is even, we move it to the right, because an even number of slimes passed this field so the conveyor will point to the right. If it is odd, we move the slime down. If it ever reaches $(x,y)$, then the answer is YES. Else the answer is NO. See also here, my commented code: 172810570Also here's a program and some snapshots to animate the state of the conveyor after each slime: 1k slimesOOO_O_____OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO __OOOO____OO_OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO _OOOOOO_O__O_O_OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO O___OOOO_O____OO_OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO ___OO_O_______OOOO_OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO O___O_O__OO__O__O___OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OO___OO__OO___O_O__OO_OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOO_OOO_OOOO_O_OOOO____OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OO_OOOOOO_OO__OO__OO__OO_OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOO_O___O___O___OOO_O_O___OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO __OOO________O__OOO__OOO_OO_OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO ___OOOO_____OO__O__O______O__OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO _OOOOOOOOOO_OOOO_OO_O____OOOOO_OOOOOOOOOOOOOOOOOOOOOOOOOOOOO ___OO_O_OOO_OO__O__OOO___O__OO__OOOOOOOOOOOOOOOOOOOOOOOOOOOO __O__O_O_OO__O_O___OO__O_OO_O____OOOOOOOOOOOOOOOOOOOOOOOOOOO _____OO__OO__OOOOO___OOOOOOOOO_OOO_OOOOOOOOOOOOOOOOOOOOOOOOO ___O____O__O__O___OOO_OO_O__O___OO__OOOOOOOOOOOOOOOOOOOOOOOO _____OO_O__OO_O____O_OOO___OOO_OO____OOOOOOOOOOOOOOOOOOOOOOO ____OOO____O__OOOOOOO_O_O_OO____O_OOOO_OOOOOOOOOOOOOOOOOOOOO _____O_O_OO_OOO__OOO__O_OO_O_O_OOOO_OO__OOOOOOOOOOOOOOOOOOOO _______OO_OO_____O_O_OO____O____O_O__O___OOOOOOOOOOOOOOOOOOO ______OOOO_OO_OO__OOOO_O_O_O__OOOOOOOOOOOO_OOOOOOOOOOOOOOOOO _______O___OOOO_OOOOO__OO___O__OO_O_OO_OOO__OOOOOOOOOOOOOOOO _________O_OOO____OOOO_OOOOO_O__O____O__OO___OOOOOOOOOOOOOOO ________OOOOOOO_OO__OOOOOOOO_OO____OOOOOO_____OOOOOOOOOOOOOO _________O_O_____OO_O_O_____O___OOOO_O_OO_OOOOO_OOOOOOOOOOOO _____________O__OO_OOOO______OO_OOOO____O__OOOO__OOOOOOOOOOO __________OO_OO_O_____O_______O_____O_OOOOOO_OO___OOOOOOOOOO ___________O______OOOO_OOOOOOOOOO____O_OO_OO__O____OOOOOOOOO ______________O_O_O_OOO__OOOOOO_O_O___O_O__O________OOOOOOOO ____________OOOOOOOOO_OO_O_OOOO_____O__O_______OOOOOO_OOOOOO _____________OO_O_O_O__OOOOO_OO__OO_OO__OOOO_OOO_OOOO__OOOOO ______________O_________O__O__O___O____O_OOO__OO__OOO___OOOO _________________OO_O_OOO__OOOOOOOOOO__OO_OO___O___OO____OOO _______________OOO_____OO__OO_O_OOO_O_OOOO_O________O_____OO ________________OO_OO_OO___OOOOOO_O____O___O____OOOOOOOOOOO_ _________________O__O__O_OO_OO__O____OOOO__O_____OOOO_OOOOO_ __________________________OO_OO_OOO_OO_O__OO______OOO__OOOO_ __________________OOO_OO_OO_O_OOOO___O___OO_O______OO___OOO_ ___________________OO__O__O__O_O___OOOOO_O__OO______O____OO_ ____________________O_________O_O__O_O_O___OOOO___________O_ ________________________OOO_OOO__O_OOOOOOO_O____O____OOOOOOO _____________________OOOO_O__OO___OOO__O_O___O__OO____OOOOO_ ______________________OOO_____O_______OOOOOO_OO_OOO____OOOO_ _______________________OO__OOOOOOOOOOO___O_O________O___OOO_ ________________________O___OOO_OOOOOOO__OOOOO__O___OO___OO_ _____________________________OO__OOOOOOO_OO__O_OOO__OOO___O_ _________________________OOOOO____OOOOOOOOOO_OOO___OOOOO____ __________________________OOOO_OOOO_OOOOO______O_O_O_____O_O ___________________________OOO__OOO__OOOOO___O_OOOOOO____OO_ ____________________________OO___OO___OOOOO__OOOO__O__O__OOO _____________________________O____O____OOOOO_OO___OOO_OO_OOO ________________________________________OOOOOOOO__O_________ ______________________________OOOOO_OOOOO_OOO____OOO__O__O__ _______________________________OOOO__OOOO__OOO___O___OOO_OO_ ________________________________OOO___OOO___OOO__OO__O______ _________________________________OO____OO____OOO_OOO_OO__O__ __________________________________O_____O_____OOOOOOOOOO_OO_ _______________________________________________OO____O______ ___________________________________OOOOOO_OOOOOO_O___OO__O__ 50k slimesOOOO_O_O__OOOO__OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO ____O_OO_OOO_O_OO__OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO ___OO_O__O______OO_OO_OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO __OO__O_O__OO_________O_OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOO__O_OOO_OOOOO_O_O_OOO__OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO _OO_OO__O_OOOO____OO_O__OO__OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO O__O_O___O_OO_OOOO______OOOO__OOOOOOOOOOOOOOOOOOOOOOOOOOOOOO __OOO___O_O_OOO___OO_O_OOOO___O_OOOOOOOOOOOOOOOOOOOOOOOOOOOO OOO__OO_O____O_OOOO___O________OO_OOOOOOOOOOOOOOOOOOOOOOOOOO O__O_OOO___O_OOOOOO__O_OOOOO__O_OOO_OOOOOOOOOOOOOOOOOOOOOOOO __OOO_OOOOO_OOOO_OOOO__O_OOOOOO______OOOOOOOOOOOOOOOOOOOOOOO __O____O_O__OO__O____O_O_OOOO__OO__O_O_OOOOOOOOOOOOOOOOOOOOO _OO______OO_OO___O__O_OO___O___O_O___OOO_OOOOOOOOOOOOOOOOOOO __OO__O_OOO_OOOOOOOOO_O_O_OOOOO_____OO____OOOOOOOOOOOOOOOOOO OOOO_O__O___O__O____OOOO_O_OO_O_O___O_OOO_O_OOOOOOOOOOOOOOOO O_OO_O_O____O_OO__O__OOO__O_O___OOOOO__O_OOOO_OOOOOOOOOOOOOO ___OOO_O__OO__OO____O_O_OO___OOOO_O_OOOOO_OO___OOOOOOOOOOOOO _O_O_O_O___OOO_O__O__O_OO_O__O__O___OOO___O_O_OO_OOOOOOOOOOO _OOOO_O____OO____OO__O_OOOO__OOO___OO_O___O_O_O___OOOOOOOOOO ___O__O_OO_OO__O_OO_O_OO__OOOOOOOO__OOOO_O___O_O_OO_OOOOOOOO ___OOOOOOO_O__O_O_OOO_O_OOOO__O_O_O_O____O_OO_OO_O___OOOOOOO __OO__O_O_O_OO_O_OO_O____OO_OO__OOO______O_O__OOO_O_OO_OOOOO _____OOO_OOO____O_OOOOOOO___O____OO______O__O_OO___OO___OOOO ___O_OO_O____O__OOOO_____O__O_OOO__O_OO__O__O_OO_O_OOO_OO_OO ____O___O_OOO_OO___OOOOOO___O_O______O____O__O_O___O_OOO___O ____O___O___OO_O_O_O_O_O____O___O_O___O__OOO_OOOOO_O_O___OOO _____O__O___O_O_O______O_____O___OO_OOO___OO_O___O__O_OOO__O _____O_OO______OOOO__O_O____O_____OO_OO___OOO_OOO_OO_OOO_O_O ______OOOO__O___OOO_O_OO__O_O____O_OO_O____O_O__OO___OO_OO_O ______OOOO_OO_OO____O_OO__OO__O_O_O__O_____OO_O_O_O__OO_OOO_ ________O__OO__O_O___OO_OO___OOOOO_____OOOOO_OOOOOO__OO___O_ _______O_OO__OOO_O__OOO_O____O__OOO______OOOOO_OO_O__OO__O__ __________O_OO____O___O_OOOOOOO_O__OOOO____O___O_O___OO_____ ________O_OO_OO_OOO_O__OOOOO___O____OO_OOO__O_O______OO___O_ __________OOOOO__OOO___OO__OO______OO_O_OOO_O___O__O_OO_____ _________OO_OOO_OO_OOOO_OOO_OOO_OO_OOOOOO_O__OO__OOO___O___O __________OOO________OOOOO_O_____O_OO__OOOO___OO_O__OOO_O___ ______________OO__O_OOO__O__OOOOOOOO__O_OOOO__OO__O_O_OOOO__ ___________O_O_O____OOO_O____O___OOOO_OO_O___OO__O___O_O_O_O _____________O___OO_OOOOOOOOOOOO__O_OOOOO_OOO____O_O___OOO__ ____________OO_O_OOOOOOOOOOOOO_______O____O__O__OOO_OO___O_O _____________OO_OOO_____O_OOOO_OOOO___O___OOOOOO_O_OO_O____O ___________________OOOOO____OO___O_OOO_O__OO____OO___O__OOO_ ______________O__OOO__OOO_______O_OOO____OOOOO_OO_O__OO__OO_ ________________O__O_O__OOO_O_O_OOO_OO____O__OO___OO_O___OOO _______________OOOO_OOOO___O_O__OOOO_OO_OO__OO__OO_OOOOOO___ ________________O__O____O_O_O__OO_O_OOOO___O_O___O__O__O__OO __________________O_______O_OO___OOO__O_____OO__O_O_O__O_OO_ _________________OOOO_OOO_O_____OO_OOOO_O_OO___OO_O__OO_O_O_ __________________O__OO_O__O_O_O_OO__O_OO_O___O_O_O_O_O___O_ ____________________O_OOOOO_O___OOO_O_OO__OO__OOO_OOO___OOO_ ___________________OOO____O_OOOOOO__OOO_OO_OO__OO____OO_OOOO ____________________O___OO_OOOOOOOOO__OO___OOO_O_OOOO__OOOO_ ______________________O___O________O_O_O_OOOOOO_O_OO____OOO_ _____________________OOO_O_________O__OOO_O_O____O_____OOO__ ______________________O__O__OOOOOOO_O___OOOOO_O__O_OOO_OOO__ ________________________OO_O__OOOOOO__O_OO_OO_O_O_OOO__OO__O _______________________OO_O___O_OOOOO____O___OOO_____O_O___O ________________________O_OOO__OO_OOOOOOOO___O__O_OOOOO_____ _____________________________OOOOOO_OO_O__OO_O_OO_O_OO__O_OO Program for Animation#include using namespace std; int n=60; int steps=50000; int solve() { vector> rtable(n, vector(n, true)); for(int i = 0; i < steps; ++i) { string s; s += "\n\n"; s += to_string(i); s+= ": --------------------\n"; int x = 0, y = 0; while(x < n && y < n) { bool rmove = rtable[y][x]; rtable[y][x] = !rtable[y][x]; if(rmove) { x++; } else { y++; } } for(int y = 0; y < n; ++y) { for(int x = 0; x < n; ++x) { s += (rtable[y][x] ? "_" : "O"); } s += "\n"; } cout << s; cout.flush(); } return 0; } //====================== // Technical stuff //====================== int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); freopen("input.txt", "r", stdin); solve(); return 0; }
 » 8 days ago, # |   0 Could you please share the editorial?
 » 8 days ago, # |   -8 My code for problem D2 is giving Time Limit Exceeded at test case 3, Please help me in optimising my Approach, suggest me with this intution only, please help. ll f(ll i, string s, string s1, ll n, ll x, ll y,map&dp) { if(s==s1) return 0; if(i>=n) return 1e10+7; if(dp[s]!=0) return dp[s]; if(s[i]==s1[i]) return dp[s]=f(i+1, s, s1, n, x, y,dp); ll p=(ll)1e10+7, q=(ll)1e10+7; for(int j=0;j>n>>x>>y; string s,s1;cin>>s>>s1; mapdp; ll ans = f(0, s, s1, n, x, y,dp); if(ans>=(ll)1e9+7) cout<<-1; else cout<
 » 5 days ago, # |   0 good
•  » » 5 days ago, # ^ |   0 yes
 » 5 days ago, # |   0 Can someone guide me how to increase my rating, what questions should I practice, what concepts should be focused, what should be my approach as a beginner I was not consistent earlier, but now I seek to grow.
 » 5 days ago, # |   0 LoL
 » 3 days ago, # |   -12 Ah, yes. Here we go again! How can we prove that we didn`t cheated if the problem was very simple and we wrote some same fucking "for"s and "if"s? Please, can you do something about it? sadly I have no suggestions. Внимание!Ваше решение 172700828 по задаче 1733D1 значительным образом совпадает с решениями других участников и находится в группе одинаковых решений magnuscarlsum/172691072, allcasepass2/172699857, Daqlet/172700828, ashutosht-code1845/172701732, Willcheatyou/172703661, Eccentric_9/172704862, master_codencode/172707763, 3ayzMedal/172710754, abdelrahmanlotfy317/172712290, nithinkumar7070/172713581, rank01/172713911, manojkumar1438/172714519, Peeyush556/172715164, Ssr_536/172715571, aditya_ahlawat_1309/172715592, 2001atanughosh/172716000, 2000032121/172716579, SouvikCH/172716698, VeeraVamshi/172716771, comddingg/172717409, off_campus/172717545, new_start_for_win/172717554, lohith1216/172718150, gandesaikiran8902/172718165, Krilin/172719125, padmasai1216/172719379, praneethadevulapalli/172719576, Sase/172719821, 2000031362/172719887, rishav__01/172720183, abhinavvvv131/172720486, Kal.El/172721004, poojith_mannepalli/172721475, Rai_Utkarsh/172721634, klu_2000031535/172721653, Abhyudai_Mishra_2024/172721673, Twinkle_Star29/172721976, janender0707/172722279, sriya30295/172722593, CheatPlusPlus2/172722888, s23singh/172723100, yashika_03/172723830, KL_2000031102/172724435, oko053651/172725936, officialnj26/172726410, asal.jahanshiri/172726760, abhishek_090802/172727205, Raj088/172727415, suiiiii/172727578, pera2008/172727869, MananPopat/172728011, brainsoft/172728527, NoDrop30/172728830, dharabindal123/172728942, pasyanthi/172728989, azhakim/172729176, kl_2000032077/172729267, testac2/172729273, Sultanov_I/172729734, Parthverma22/172729855, ROBOSTAR/172730887, 2000031415JayanthKrishna/172731001, MomenSh306/172731333, Omar_Khaled_Me/172731412, Mohammd_Benni/172731596, Kither/172732436, ankitkr22201/172732495, Mohd_aman000/172732598, el_2000030813/172732819, uokeynoname/172733416, klh2010030535/172733528, Pranav1903/172733534, stunner2k22/172733859, Youssef_mkdaad/172734296, harshit0077/172734836, Coding1212/172734863, Sai_Chandu/172734996, kruthik/172735039, navneetguptacse/172735437, Pavan_Yaddanapudi/172735715, g_aadesh29/172735885, VLovesD/172735998, max_d/172736062, Pinakakali/172736150, umamhesh/172736756, 2010030159/172736858, xanaxrehabclub/172737066, ahmedfereg480/172737296, Kaustubh01/172737441, klu_2000031628/172737629, CeLLxMaTTriX/172737688, anujmishra/172737884, ishivchaudhary/172738211, Levii_Ackerman/172738319. Такое совпадение является явным нарушением правил. Отметим, что непреднамеренное утечка тоже является нарушением. Например, не следует пользоваться ideone.com с настройками по умолчанию (публичным доступом к вашему коду). Если вы имеете неоспоримые доказательства, что совпадение произошло по причине использования общего источника, опубликованного до соревнования, то напишите комментарий к посту о раунде со всеми деталями. Подробнее можно прочитать по ссылке http://codeforces.com/blog/entry/8790. Такое нарушение правил может являться основанием для блокировки вашего аккаунта или других штрафных санкций. В случае повторения нарушений, ваш аккаунт может быть заблокирован.
 » 3 days ago, # |   0 Regarding Similar Solution between ojasGupta/172672316, smit086/172709047. I think its mere coincidence that the codes where so similar, I havent cheated once and was only using vscode. Whereas the other person has been caught cheating multiple times. Please review.