Challenge Page: https://patdash.planetchili.net/challenges/2
Announcement Video: https://youtu.be/JAA19vXSRto
Guide Video: https://youtu.be/63uc34wNSdk
Ultimate Solution: https://patdash.planetchili.net/series/4 (*see notes below)
You are given a struct that contains A) a field size and B) a std::vector of commands. Each command has 3 parameters: i) quantity, ii) offset, and iii) count. Each command encodes an operation on an array of ints g[fieldsize] (field of meme graves) in which you add the value quantity to a contiguous range of elements in the array g (bury memes in the graves). Quantity indicates amount to add to each element. Offset indicates start element. Count indicates the number of elements to act on. Return the maximum value in g after all commands have been executed. Each element of g starts with a value of 0.
Available on the challenge page (see link above). Also see the guide video (link above).
1 <= fieldsize <= max unsigned int
0 <= quantity <= max int
0 <= offset <= fieldsize - 1
1 <= count <= fieldsize - offset
1 <= commands.size() <= 8000000
Write your solution in Solution.cpp (follow the directions in that file). Code will be compiled/evaluated using VS2017 C++ compiler in x64 configuration. You may use the stdlib + visual studio compiler intrinsics, but no other libraries. If code is suspected of potentially trying to subvert the test or the test system, it will be rejected (so do not obfuscate).
Test will run on Intel i7 4770k (Haswell) CPU. You may not consume more than 1 GB ram in total. Algorithm must complete within 3000ms.
Submit on the challenge page (link above). See challenge page for submission deadline. Submit only your Solution.cpp file as a zip archive. The name of the zip archive itself does not matter, but must have the .zip extension. Zipped solution must be less than 20kb in size. See the guide video (link above) for a walk-through on submission.
Full points given for passing all tests. Part points given for passing all low-n tests but timing out on high-n. Mono bounties for top 3 fastest algorithms and the earliest submission that passes all tests. Poly bounty for beating Chili in speed performance. Poly bounty also available for supplying test data that breaks Chili solution. See challenge page for details on the number of algos awarded.
- See announcement video for additional explanation. Discussion / questions should happen here rather than in the comments on the announcement video (I will not answer clarification questions in the comments).
- Bounty for "Break Chili" will be awarded by providing a valid dataset that breaks Chili's published solution code. Provide data on forum or Discord.
- As the second run with the new system, this is still somewhat of a beta test. Expect that there might be some bumps in the road.
- Ultimate Solution will be unlockable on the patron-exclusive challenge playlist soon after the basic solution video is released.
- Max runtime updated 11.5
- Some challenges will not have an Ultimate Solution.