Comments

Hi, could someone please take a look at my solution for problem E and point out problems with the approach? I have added comments on the DP state and transition. Would really appreciate your help. The code snippet is not long.

Code Snippet

Here is a solution for harder version based on monotonic stack.

Hey callmepandey, when small == 0 and you are placing the same digit, why did you consider only one more border and not additional borders?

Attaching the code snippet from your submission:

if(a[i] == s[j]) {
    ans += memo(i + 1 , 0 , done , j + 1 , 1);
} else if(a[i] == s[nxj - 1]) {
    ans += memo(i + 1 , 0 , done , nxj , 1);
} else {
    ans += memo(i + 1 , 0 , done , 0 , 1);
}

How to do problem E?

Thank you! I should have observed that removing a complete sub tree at (h-1) is better than removing each of its children at (h).

can you please explain (z + y + 1) % 2 in your solution?

In D, why does this greedy solution starting from the root and cutting whenever the depth exceeds the candidate does not work? TIA

Could someone please help me understand Div 2 problem D editorial?

Thanks!

Could you please explain B solution?

number of 0's >= number of 1's at any bit position.

Hi, I have recently learned this technique. Could you please explain your solution? That would be great help.Thanks

Hi, Could someone please help me in understanding the proof in E editorial? I think it is a beautiful proof but I could only get a sense of it using intuition. Thanks!

Thank you so much. JFTR, toggling here means querying a cell.

Thanks for sharing. I understood the pattern in figure but how does it prove the original construction in editorial. By toggling a cell (1, x) in row 1, do you mean that we take that cell by querying the below cell (2, x) which in turn triggers this pattern?

Could you please explain why is there no optimal substructure property?

Edit: I think I got this. For a given mask the path to achieve that mask matters and that's why the state mask is inappropriate.

Hi, can someone please explain this proof of the editorial construction in a bit more detail? I am unable to understand even from the above proof. Thanks in advance.

A really nice recent problem directly based on this blog: 1619H - Permutation and Queries

BSTA?

0

Can you please briefly explain the (segment tree + binary search) solution for F about which you talked in the video? TIA

Can you please also explain why the order of doing dp matters in this problem. If we do dp by choosing k strings from 1....i, it gives WA but when we do dp by choosing k strings from i....n, it gives AC? Thanks

Thank you!!

Is it possible to solve problem A by dp? My dp solution submission fails on most test cases. Can someone please help in finding the problem.

Thanks!! Really nice solution

Hey, can you please explain why only those points have to be updated? I think points like (x, y-2) also need to be updated

Can you please elaborate your visualization?

Can you please briefly explain the solution? I'm unable to understand the editorial.

Mo's algorithm

Yeah simple binary search

Each wall is a straight line of the form x+y=a. For a point (x1, y1) to lie outside the line, x1+y1>a should satisfy. So for each point, you just have to find the last line/wall such that it is outside the line/wall. This can be done by binary searching (x1+y1) in the array of sorted walls.

Thanks!!

How to solve CLLEXO? I was trying to compare right and below character but could not decide in case both are equal. Thanks

Auto comment: topic has been updated by leetcode07 (previous revision, new revision, compare).

Passages denote edges. So let's say if a node is isolated from the rest of the graph, then there is no way to reach 1

same problem

Hey can you please explain in brief what is wrong with this dp? I am unable to follow your conclusion.

I tried to do it with dp but could not reduce states. If somebody has done it using dp, please share the approach. Thanks

I appreciate your hard work. I will finally have dinner with my parents after a long time.

Please provide proof of your construction in D

Such Salty

Can we print the cyclic order starting from the smallest element? Thank you

It is the "BEST".

Can you please explain your solution? Thanks

I am highly interested but the sad part is I am not rated between 1500-1700.

Very nice initiative. Thank You!

I loved the contest. Thank you dreamoon_love_AA

It seems there is a typo in the solution of 949B — A Leapfrog in the array. It should be "At the moment of jumping to cell p there are p/2 elements to the left of the position p". Please correct me if I am wrong.

Please help me in solving D. Thank You.

Please help me in solving question D. Thank You.

0

super helpful!

0

in d) why ((x-a)+a-1)/a where x is remainder when divided by (a+b), please help?