ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 2024. Adventure Time

Gospers hack
Posted by Mahilewets Nikita [BSUIR] 5 Sep 2017 01:20
Very good opportunity to apply Gosper's hack trick.

m is number of different colors in the input.

Then iterate through all subsets of size k of m.
Re: Gospers hack
Posted by Anti 28 Nov 2023 16:07
It's really works. But I don't understand why this algo work. Can you explain me?