Hello, Codeforces!
I and tanmaytaneja2 have curated a Solo Practice Contest in the gym, Coding Challenge Alpha IV — by AlgoRave. This is for anyone who loves giving contests and solving problems. This contest will be of most interest upto Expert rated coders, but I would also invite Div. 1 coders to participate as well. For anyone who wants to practice or just wants to go through the problems can register for our contest. Hope you guys will enjoy solving the problems!
I would like to thank:
Our problem setters JainWinn, kaichisaki, 0x4F5F6F and myself.
Our problem testers tanmaytaneja2, kaichisaki and myself.
JainWinn for the amazing poster design.
A special thanks to 0x4F5F6F for co-ordinating the round.
Contest Details:
- Date/Time: Sunday, January 7, 2024 at 18:05UTC+5.5
- Problems: 6
- Contest Invite: Coding Challenge Alpha IV — by AlgoRave
Good Luck and Have Fun!
Note: You can also register for the contest while it is going on. You may want to check out our group for past contests.
UPD: Congratulations to the winners!
Congratulations to first solves as well!
A: pattagobhii
B: cuiaoxiang
C: 18o3
D: cuiaoxiang
E: tvmpqx_8601
F: Tobo
UPD 2: The gym contest has been made private in order to view failed testcases and submissions to everyone. Please use the contest invite (given above) to access it or you can also join our codeforces group by this link to view all the contests.
UPD 3: Editorial is out!
Auto comment: topic has been updated by vrintle (previous revision, new revision, compare).
Gentle reminder: less than 30 mins left before the start.
Nice contest, I enjoyed solving the problem.
I'd like to give my short Editorial:
The answer is the longest subarray that contains digit $$$7$$$ only
Submission
Do some casework, and found out some of the followings:
Submission
Use Sweep Line, basically store events in the form of
(time, type, index)
, for inserting we usetype = 0
, for the query usetype = 1
, and for deletion usetype = 2
.See my submission
Use DP from back to beginning, where $$$dp[i] = (x, y)$$$ such that $$$x$$$ is the first player's point and $$$y$$$ is the second player's point, if we chose to take the $$$i$$$-th character.
To get the recursion, $$$dp[i] = (cnt[i] + dp[j][1], dp[j][0])$$$ we want the difference between the second player and the first player to be as large as possible (Since the second player is the one controlling the $$$j$$$ index).
Submission
The number of distinct possible value of $$$\displaystyle\left\lfloor \frac{n}{i} \right\rfloor$$$ is around $$$O(\sqrt{N})$$$.
To get all the values, we can use the following code:
Submission
Let's store the following value for each zombie:
Now we need to kill the nearest zombie first, so we can sort $$$p$$$.
Iterate over all the zombies, and let $$$sum$$$ be the summation of $$$t_i$$$ that we take:
Submission
B is simply n*k/3 if n>3 0 otherwise
thanks for fast editorial
Thanks, we really appreciate your contribution!
Would love to hear your feedback.
Why this won't work for D? https://pastebin.com/kZC07anz Ideally Alice or Bob after Aice's first turn will try to choose the greator character which has the most number of occurences as an optimal move.
a-5
b-7
c-6
Bob loses if he picks b
Auto comment: topic has been updated by vrintle (previous revision, new revision, compare).
I hope you guys enjoyed the contest and found some of the problems interesting, we have updated the blog with winners and first solves. Also, I apologize for any misunderstanding in Problem D: "Alice vs. Bob Again", I have updated the problem statement now.
Problem F was nice
Yeah, had the same feeling after testing it. It was authored by 0x4F5F6F
Update: The gym contest has been made private in order to view failed testcases and submissions to everyone. Please use this contest invite to access it or you can also join our codeforces group by this link to view all the contests.