|
0
The position of set bits in binary representation of |
|
0
Should have done this (I haven't done this in contest either )- You want to compare two expressions: 2^x + 2^y vs 2^a + 2^b Instead of computing powers directly, you can exploit the properties of exponentials. If x > a, then 2^x > 2^a and dominates the sum If x < a, then 2^a > 2^x => done If x == a, then compare the second term, i.e., 2^y vs 2^b => again y > b => greater |
|
0
Missed this (crying) |
|
+3
The solution code for Problem C shows "you are not allowed to view this page" error. If it opens for anyone, can they share the code in comments! |
|
+3
Waiting for the logic explanation! Someone who understood the solution please explain |
|
0
In the first claim, can you check if you have got it right-
I tried to find the assumptions which would hold true. Can you check if I got them right —
|
|
0
I was thinking the same thing. I tried out few test cases and maybe this will clear answer you question — Not every operation will cost you 2 queries. Say you start your query with Basically, your suffix of size I hope I was able to explain! |
|
0
Very well explained. This should be a part of the editorial! Thanks bruh |
|
0
Yes. I did the same. F with DSU. |
|
0
In problem C, can you explain what difference it makes logically (in dp transition) if we replace the original transition, F[i][0] = min( F[i-1][0]+y[i-1]*x[i],F[i-1][1]+x[i-1]*x[i] ); F[i][1] = min( F[i-1][0]+y[i-1]*y[i],F[i-1][1]+x[i-1]*y[i] ); to this transition, F[i][0] = min( F[i-1][0]+x[i-1]*x[i],F[i-1][1]+y[i-1]*x[i] ); F[i][1] = min( F[i-1][0]+x[i-1]*y[i],F[i-1][1]+y[i-1]*y[i] ); The answer for the second transition is coming different from the original answer but both of the transitions seem correct to me logically. |
|
0
In problem C, can anyone explain what difference it makes logically (in dp transition) if we replace the original transition, to this transition, The answer for the second transition is coming different from the original answer but both of the transition seem correct to me logically. |
|
-8
In question C , on using |