CIRMERGE - Editorial

well I used modulo as well :stuck_out_tongue:

1 Like

simply because he declared it globally

You have a nice knowledge of algos. Good !

2 Likes

she herself said she was an icpc silver medalist bro.

1 Like

Thanks great. I will learn more and more when people like her be active on discuss.

2 Likes

Konsa waala silver? Regionals yaa world finals? Apne yahaa India mai kuch gold/silver nhi milta for regionalsšŸ˜…

Why don’t you go there (where loopfree is) XD?

2 Likes

you should learn balloon popping problem. This question is very similar to that problem. Here is the link : - LeetCode

why modulus is so time consuming

I used the greedy approach that you stated will pass the Subtask #2 (with distinct powers of 2).
Can you tell me why this greedy approach gave WA for other Subtasks? For which test case my greedy approach will give WA?

Thanks in advance.

I know it only because of experience btw you can refer here - https://stackoverflow.com/questions/27977834/why-is-modulus-operator-slow

1 Like

Bade hi experienced ho aap toh :stuck_out_tongue:

2 Likes

Bs apse kuch 5-10%. Dot dot dot

1 Like

might be because of integer overflow, try having long dp[][]

1 Like

Where can we find material to read about Garsia Wachs algortihms?

What does ā€œLinear Caseā€ mean??

it means just a normal array, i.e. not taking the first and last elements to be adjacent here.

That was really a great problem . Learned many things .

Try making an algorithm to find division and modulus using bitwise operations.
You will realize why.

Solve similar problems like mixture(spoj),matrix chain multiplication