Hello, Codeforces!
The Competitive Programming Club of IIIT Lucknow is happy to invite you to participate in Dream In Code '24 which will be held on Thursday, April 11, 2024 at 20:00 IST (UTC+5.5).

You will have 2 hours to solve 8 problems (one of the problems has 2 subtasks), the round will be held as a Codeforces gym contest and will therefore be unrated.
The problems have been prepared by members of the club, atharv_tiwari, AnikateKoul, akshitnandan, saavrm and Ankit_102.
The prizes for the winners are as follows:
1st place: 5,000 INR
2nd place: 3,000 INR
3rd place: 2,000 INR
(Prizes for international winners will be transferred via crypto)
Thanks to MikeMirzayanov for the great platforms Codeforces and Polygon which allowed us to setup the contest easily.
You can access the contest using this link.
Good luck and have fun!
The Dream in Code series is part of Equinox, the Annual Techno-Cultural fest of IIIT Lucknow. The contest is open for everyone and we would love to see your participation in the contest.








As a setter, the problems are really interesting and I recommend everyone to participate.
Excited>>>
No Prizes?
We were awaiting confirmation from a couple places, hence the delay. The prizes will soon be updated in the blog now
The registration is now live!!
Auto comment: topic has been updated by AlphaGaurav (previous revision, new revision, compare).
Late announcement
Will there be editorial or PCD?
Hey! If you have any doubts about the questions, you can message me or any of the writers. We will assist you directly. If you feel a more general discussion would be better, you can comment your idea or doubt under this blog :)
Nice contest,i implemented Matrix Exponentiation for the first time today.
Which problem?
H1
Can anyone explain E and F.
For E, you can maintain two sorted multisets $$$m_1$$$ and $$$m_2$$$: $$$m_1$$$ holds all the current elements of $$$a$$$, and $$$m_2$$$ stores the differences between consecutive elements of $$$m_1$$$. Now to make an update:
For F, you can maintain a 2D DP array where $$$dp_{i, x}$$$ stores the maximum coop value among the first $$$i$$$ groups only at most $$$x$$$ people can be used from group $$$i$$$. To calculate this, let $$$c_{i, x}$$$ be the maximum coop value we can get in the first $$$i$$$ groups if exactly $$$\min(a_{i-1}, x)$$$ people are used from group $$$i$$$. This can be calculated simply: $$$c_{i, x} = \min(P_i, P_{i-1})\times\min(a_{i-1}, x) + dp_{i-1, P_{i-1} - \min(x, P_{i-1})}$$$. Once $$$c$$$ is calculated, $$$dp_{i, x} = \max_{0\leq j\leq x}(c_{i, j})$$$, which can be done efficiently by taking prefix maximums. The answer will just be $$$dp_{n, a_n}$$$.
Thats a clever solution. I was thinking about segment tree or bit..
For A How would we solve it for A[i] ^ A[j] == 1 and we need to find the largest A[i] * A[j]?
Just a alternate problem which I thought of while solving the problem.
just check consecutive numbers where the first number is even
Can you elaborate.
A[i] ^ A[j] won't result in 1 for all even odd pairs right.
Since 15 ^ 16 = 31.
the smaller number should be even, it is always true in that case
you can maintain set and iterate form 1 to n , for each index find the (1^a[i]) in set if it exist update the answer
What's the intended solution for problem G?
Can someone tell me why this code gives RTE Problem D : 256406705