The proof: at the end the operations for of each index i ( 1 0 now in this case the only way to make the difference 0 is to apply suffix on arr[i] because further decreasing arr[i - 1] is stupid case ii:arr[i] - arr[i-1] < 0 in this case the only way to make the differece 0 to apply prefix arr[i-1] because further decreasing arr[i] is stupid because of this we always get the best possible answer
@competitivecoding-newtonsc96012 жыл бұрын
Nice
@shahinsiddiquei45132 жыл бұрын
Great Explanation!!!!!
@competitivecoding-newtonsc96012 жыл бұрын
Thanks Shahin
@Karthik-ox6jv2 жыл бұрын
Very nice, best explanation 👍 . The main thing is to understand why we are trying to make everything equal which is clear after watching the video. As you mentioned, it doesn't matter in what order we perform the operations. The method which we follow to get same elements justifies that every move is a must. I still can't prove it but I feel that what we are doing is the best way to do it.
@competitivecoding-newtonsc96012 жыл бұрын
Nicely summarised :)
@arijitdey84192 жыл бұрын
very good explanation..keep up the good work and thanks a lot
@competitivecoding-newtonsc96012 жыл бұрын
Thanks Arijit
@rudranilacharya52932 жыл бұрын
thanks, please also upload the video for lost array and maximum shift after xor of codechef lunchtime 19 june
@competitivecoding-newtonsc96012 жыл бұрын
Will surely try.
@meetbrahmbhatt15312 жыл бұрын
Best! Thanks alot for this.
@competitivecoding-newtonsc96012 жыл бұрын
:)
@devilronak72622 жыл бұрын
Very good explanation 🔥
@competitivecoding-newtonsc96012 жыл бұрын
Thanks Ronak
@revanthkalavala18292 жыл бұрын
Its not always true that addition operation will be used at the end. It might be op1, if min element of array is +ve in array as we are trying to make all elements equal.
@competitivecoding-newtonsc96012 жыл бұрын
Yeah I mentioned that in the video.
@aryamantodkar65582 жыл бұрын
I'm not able to solve div2 C's, how should i improve?
@competitivecoding-newtonsc96012 жыл бұрын
Solve previous div2c's
@aryamantodkar65582 жыл бұрын
@@competitivecoding-newtonsc9601 I have to see the solution of C's, I'm not able to solve them on my own. Should i try practicing lower rated problems?
@abcefg70452 жыл бұрын
how will you proove that this will be the minimum number of operations? and why codeforces gives this kind of problems I hate constructive algo and greedy
@competitivecoding-newtonsc96012 жыл бұрын
I dont have a concrete proof, but I think the first observation helps with the intuition.
@rahulsrivastava31722 жыл бұрын
D wale ka bhi soln upload kr dia kr bhai..
@EpsilonCodes2 жыл бұрын
I intern too bro, hard to take out 4 hrs/ a day, and problem D usually gets a poor engagement. Will surely try to though, if I get the time tonight.
@rahulsrivastava31722 жыл бұрын
@@EpsilonCodes theek h bro.. Tere soln and approach mujhe pasand aati.. So i usually get on this channel or one created by IITM peeps.. D mai he thoda issue rehta and D ka soln usually milta ni jldi.. So i said.. Anyways.. Great work.. Keep going bro
@EpsilonCodes2 жыл бұрын
@@rahulsrivastava3172 thanks man, appreciate that :)
@ganeshchowdhary30242 жыл бұрын
Lost at implementation part
@competitivecoding-newtonsc96012 жыл бұрын
Which part?
@ganeshchowdhary30242 жыл бұрын
@@competitivecoding-newtonsc9601 Yours is clear. I lost while i am solving. Got AC after seeing your clean implementation