JOI2008HO C
from Typical ideas for coming up with solutions in competitive programming
JOI2008HO_C
PDF
https://gyazo.com/503913df0873f6aed45912d413fa40a1
https://atcoder.jp/contests/joi2008ho/tasks/joi2008ho_c
Find the maximum value that does not exceed M out of 1000 values by selecting 4 or less and adding them.
Pre-enumerate the number of possible combinations of 0 to 2, sort, and find the largest number that does not exceed M when added together by a binary search.
half-full enumeration
#TODO I think you're wrong.
---
This page is auto-translated from /nishio/JOI2008HO C using DeepL. If you looks something interesting but the auto-translated English is not good enough to understand it, feel free to let me know at @nishio_en. I'm very happy to spread my thought to non-Japanese readers.