-
Notifications
You must be signed in to change notification settings - Fork 20.5k
Added mos algorithm and dice thrower #6591
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added mos algorithm and dice thrower #6591
Conversation
- Mo's Algorithm: Square root decomposition for offline range queries(Imp in CP) - DiceThrower: Recursive backtracking for dice combinations(very imp) - Both algorithms include comprehensive test suites - Formatted with clang-format and i follow contribution guidelines
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #6591 +/- ##
============================================
+ Coverage 75.93% 76.06% +0.13%
- Complexity 5845 5885 +40
============================================
Files 707 709 +2
Lines 19965 20085 +120
Branches 3871 3897 +26
============================================
+ Hits 15160 15278 +118
Misses 4219 4219
- Partials 586 588 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…/BEASTSHRIRAM/Java into added-mos-algorithm-dice-thrower
there was an dicethrow.java file but it mainly focuses on finding the number of ways to get sum x with n dice, each having m faces. but mine is is not a problem it gives recursive and backtracking approach. |
…/BEASTSHRIRAM/Java into added-mos-algorithm-dice-thrower
* Fixed PartitionProblem.java documentation comment placement
@alxkm i have fixed partitionproblem.java file and also fixed Mos algorithm and Dicethrower which i had commited but got less patch coverage by codecov please merge this commit under hacktoberfest 2025 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m fine with the proposed algorithms
Thankyou so much |
After contributing to TheAlgorithms, I realized many CP students visit this repository for learning resources. I've added two important algorithms that were missing:
Mo's Algorithm - Square root decomposition for offline range queries(https://www.geeksforgeeks.org/dsa/mos-algorithm-query-square-root-decomposition-set-1-introduction/)(https://codeforces.com/blog/entry/7383)
DiceThrower - Recursive backtracking for dice combinations
Both algorithms include comprehensive test suites and follow all contribution guidelines. These will help students build stronger foundations in competitive programming.
clang-format -i --style=file path/to/your/file.java