Skip to content

Added internal solution for Atcoder - Grouping#5937

Merged
eysbutno merged 23 commits intocpinitiative:masterfrom
Kiruthees:Cses2421
Feb 14, 2026
Merged

Added internal solution for Atcoder - Grouping#5937
eysbutno merged 23 commits intocpinitiative:masterfrom
Kiruthees:Cses2421

Conversation

@Kiruthees
Copy link
Contributor

Place an "x" in the corresponding checkbox if it is done or does not apply to this pull request.

  • I have tested my code.
  • I have added my solution according to the steps here.
  • I have followed the code conventions mentioned here.
    • I understand that if it is clear that I have not attempted to follow these conventions, my PR will be closed.
    • If changes are requested, I will re-request a review after addressing them.
  • I have linked this PR to any issues that it closes.

While going through DP Bitmasks section, I came across this problem. When I clicked to view solution, it said "view editorial". But, In Atcoder, there was no editorial for this question or overall editorial for the contest. So, I decided to write this Internal solution

Updated solution metadata kind from autogen to internal.
…in official site, but says check editorial in USACO site

Add detailed explanation and implementation for AC-Grouping as it did not have editorial in official site, but says check editorial in USACO site
Updated document structure and improved explanation of the approach for grouping rabbits.
@Kiruthees Kiruthees requested a review from envyaims as a code owner February 7, 2026 13:46
Copy link
Contributor

@eysbutno eysbutno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO the explanation is too verbose, and I think the code kind of overcomplicates it (e.g. why calculate sc[m]? you can do it all in one pass, as seen here)

also, should prob link the module section for merging submasks, since it's the key part of this problem

Updated the explanation and implementation details for the Bitmask DP solution for grouping rabbits. Adjusted formatting and clarified sections on bitmask representation, precalculation, and DP transitions.
Co-authored-by: Justin Ji <68484800+eysbutno@users.noreply.github.com>
Copy link
Contributor

@eysbutno eysbutno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

explanation looks good now, just some minor formatting things

good work!

Co-authored-by: Justin Ji <68484800+eysbutno@users.noreply.github.com>
Copy link
Contributor

@eysbutno eysbutno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

Correct the formula for updating dp[i], remove header "dp state and transition", removed last line
@Kiruthees
Copy link
Contributor Author

Done

@eysbutno eysbutno enabled auto-merge February 14, 2026 23:32
@eysbutno eysbutno merged commit a0de84c into cpinitiative:master Feb 14, 2026
4 checks passed
@Kiruthees Kiruthees deleted the Cses2421 branch February 15, 2026 03:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants