ABC #162 F – Select Half

Problem Statement - here We will be using 1d DP to solve the problem. We will make the prefix sum array for odd positions beforehand. Let's denote it as ps[ ].…

Continue Reading ABC #162 F – Select Half

E: Active Infants

Problem Statement - here To make ourselves clear, we can rearrange them in any order we like. So, it is clear that for every element we have to keep it as…

Continue Reading E: Active Infants

D – Multiple of 2019

Problem Statement: here We are told to find out the number of pairs such that the base 10 representation of the string gets divisible by 2019.  The problem could have been…

Continue Reading D – Multiple of 2019

JTREE

Problem Statement -https://www.codechef.com/problems/JTREEhttps://www.codechef.com/problems/JTREE The problem, in short, says: You have a tree with edges directed towards the root and nodes having some tickets. Each ticket allows you to move k…

Continue Reading JTREE