Comments
On Ermiooo159 → A Love letter to Problem C, 13 months ago
+1

Lol, I found problem C easier than problem B

On cry → Codeforces Round 1050 (Div. 4), 13 months ago
0

All the best you can do it!!

On cry → Codeforces Round 1050 (Div. 4), 13 months ago
0

As a 1398 , I hope get to 1400+ this div 4

0

Gpt is able to solve D (I gave it some help to think but yeah)

Spoiler
0

gpt was able to solve d

you gotta do 2 ups, 2 rights, and 4 downs and then your code will work fine

yes I did, I am the retard who did it and wasted soo much time

dude , you did the same blunder like me, (-10^9, 10^9) fails for you too

yeah , I understood my stuff now, it is sad that I did not see that I willl have to move 4 times at least

thanks for trying , I am working hard to reach a higher rating so that I can switch from software to quant. lowkey gonna grind fr fr and everyday

lowkey fr fr, I just observed that, I gave my code to gpt and it solved it in 2 mins, I am 100% sure that gpt cannot take my job as no-one can write just bad code

yk like I am only taking 4 steps and the current answer has given 8 steps, so it seems sus in the logic

how will it help exactly? like this is for finding the corners yk, and I feel I might have messed up here

#define int long long int

I use this all the time

Spoiler

why does my logic fail for test case 5 in the div2 D ?? I think we can solve it by moving to extreme positions of the board (top right and bottom left) and then get 2 equations 2 variables to solve for the positions. Am I missing something here?

may I know how? I used dp + fenwick trees and found it really really complex

div2c is not a simple dp as n = 10^5, it is classic fenwick tree . like it was asked before if I am not wrong in cf

0

understood, thanks alot, I just saw your solution.

0

so this is the top down approach right? like we are doing something like prefix min dp? like we are updating from n to 1 right?

0

I had tried to approach from the front but then how do you decide the fall back conditions on the remaining elements, like can you explain your logic with some code, I wanna try it but with little bit of hint

On _.-_-._ → Indians >> LGMs, 14 months ago
0

not exactly , I have solved it before during the learning phase, so it is very easy and direct so i just took that code and did some modifications and pasted it here as digit dp is template based

On _.-_-._ → Indians >> LGMs, 14 months ago
0

please send the link, lowkey problem D is already and is an direct digit dp problem. But others are hard as f like C especially

0

Thank you for your thinking process

On hugopm → Codeforces Round 1039 (Div. 2), 15 months ago
0

Damm fr fr, but I am still not sure how is binary search event used, I will up solve them soon, is there any other topcis to read apart from the tags to solve it?

On hugopm → Codeforces Round 1039 (Div. 2), 15 months ago
0

long long ans = (long long)n * (n + 1) / 2; for (int i = 0; i + 1 < n; ++i) { if (v[i] > v[i + 1]) { long long left = i + 1; long long right = n - i - 1; ans += left * right; } } cout << ans << "\n";

I did something like this, like it is similar logic without dp

On hugopm → Codeforces Round 1039 (Div. 2), 15 months ago
+1

I took the idea that, for a given ith index (expect the first one), You need to construct the a[i] using the minimum of all the elements that occured till now. So Based on that you can maintain a set till the ith element. and then see if ~~~~~ // this is code auto it = *(s.begin()); if( a[i]<=2*it-1){ s.insert(a[i]); } else{ // failed as we cannot construct this element } ~~~~~

. Basically what we are doing is taht , for 5 6 1 1, we want to see for 5 0 0 0 , can we construct 6 or not , and given our set minimum is just 5, so we can construct next element up to 2*5 — 1 (till 11) . So , ussing this you can do this problem in O(1) per element, and overall O(n)