Hi,
From now on, we are going to provide video editorials for Codeforces rounds. So, Codeforces rounds are not going to be limited to text editorials, but also video editorials!
We want to seek feedback and try to improve these video editorials as much as possible. We will try different ideas like recorded videos and livestreams to see which one helps you the best. So, please help us make a better content for you!
The blog will be shortly accessible in contest materials.
1986A — X Axis
1986B — Matrix Stabilization
1986C — Update Queries
1986D — Mathematical Problem
1986E — Beautiful Array
1986F — Non-academic Problem
1986G — Permutation Problem
I hope it helps!
Why
it would help beginners ig
Because he thinks about others as well.
Kring
I believe text was much better for learning where you can take hints from each line and then work your way out to solve the problem.
you are handsome bro
why is not anyone solving d with dp i can not understood
Because using dp, the order of computation can't be controlled. For e.g., 2*3+4. First, it will go in-depth and compute (3+4), then multiply it with 2. which does not comply with the precedence of operators. You got accepted because the minimum value will be achieved by multiplying (if it's 1); otherwise, performing addition. Multiplying by 1 does not change the result, so the order does not matter. I have ignored the edge cases when min 0 is achievable and n <=3
ya i understood now i also read the code of others i understood the conditions
I solved it with dp: 267111101
can u explain ur approach in dp recursion?
Problem E; wrong answer 5th numbers differ — expected: '118834745', found: '123022038' my code is failing this test case, can someone help me? i could come up with the entire solution on my own apart from the prefix and suffix sum stuff to find the element that needs to go in the middle, i'm struggling to understand how i would use prefix and suffix to find this element, can someone explain how it would work? I did it in a different way in my code but it's missing this test case-
Oh for fucking love of god, please don't paste your shitty code like this.
1. Use a spoiler
2. Use the Code block feature that codeforces provides
like this:
thanks buddy lol
Goddaym, you angry baka. I love internet
Video tutorials might be targeting certain group of individuals usually beginners and text tutorials might be concise and leave enough room for the individuals to think and figure why the solution works by themselves.
I think text tutorials are needed irrespective of video tutorials,
I presume vast majority of problem solvers prefer text tutorials ?
Let me know what you guys think.
Video solutions are my last resort when I can't understand what editorial is trying to say / the approach is too unintuitive. Otherwise, I see no reason it putting link for a video here.
Thank you Shayan
My G's code is O(n^2) ,but it passed.
I did G1 through brute force, that is checking each for the condition. Resulting in O(n^2). Its failing at when len is around 30k+. Wanted to know whats the difference bw g1 and g2 problem?
I am working on https://mirror.codeforces.com/contest/1986/problem/E and got some interesting timing result that I cannot explain.
In short, I have two submissions, one accepted and another TLE, but I can't understand why the TLE version is slower.
The only difference between two submissions is that the accepted version sort the whole array once, and the TLE version sorts the bucket individually.
In principle, sorting the individual bucket has a time bound of
O(sum (b log b)) <= O(n log (max b))
, and it should be smaller thanO(n log n)
in all cases.Local testing of sorting arrays by buckets or not does not show much difference, it could end up in many buckets, or it could end up with fewer but huge buckets, but the timing is more or less the same.
But in the submission, the timing difference is huge, the sorting by bucket version didn't complete in 2 seconds, but the sorting one version completed in 217ms.
This benchmark seems to show very similar timing:
No way the difference in sorting caused a 10 fold timing difference. I also submitted multiple times to confirm it is not a glitch on the judge.
thank you for this! keep going