Comments

Never mind, I just realized that!

Hi dude, can you explain me why your greedy approach is correct?

Another approach for Problem C is using Segment Trees, it was very interesting.

Thanks bro, now I get it!

On problem C, Isn't it suppose to take always a pair and then replace it with mod of sum of them? If I use this array: [110 120 130 140], I take 2 pairs (110, 120) and (130, 140), it's obvious that I got 2 candies, but, when I replace them the array now is [0 0], so I only take 2 candies. If I use Editorial's claim I got 50 candies. I think I can't understand the problem, can anyone help me with this doubt?

Those problem have something in common and that's you need to transform the input graph into a tree to solve their queries. Sorry if didn't explain myself.

Hey bro, Should it be the answer to your test case?

https://pastebin.com/snkSXV4G

Hello, I got stuck on problem E because my Algorithm outputs weird ans and If I run my solution on another compiler it can output the real answer, so I dont kow if I doing a mistake reading graph. Here is my last Subm: 48689549

Thanks bro, I figured out that I need lots of practice at number theory.

I can't figure out why just pick up prime numbers, can you explain me please?

Hello and Happy new Year everybody. I have a though about problem F, I wanna solve it with only DFS without using any segmented tree algorithm. Is this possible?

Actually I thought the same approach at the contest but I got WA.

Hi everyone, I have a problem with 702B, I do some math for solve this problem, I use this ecuation: exp = log(arr[i] + arr[j]) / log(2), if exp is an integer, them, (i,j) are a pair. The problem is when I put my solution in the page, in the first case my code drops 1 whem the answer is 2, but if I run my code in other online compiler, my code will drop 2, the real answer. My ecuation is bad?, thanks for helping me!