CoolFace
Datasetpublic

hackercupai/hackercup

Data Preview The data available in this preview contains a 10 row dataset: Sample Dataset ("sample"): This is a subset of the full dataset, containing data from 2023. To view full dataset, download output_dataset.parquet. This contains data from 2011 to 2023. Fields The dataset include the following fields: name (string) year (string) round (string) statement (string) input (string) solution (string) code (string) sample_input (string) sample_output (string)… See the full description on the dataset page: https://huggingface.co/datasets/hackercupai/hackercup.

sourceHugging Faceapache-2.0updated 2y agoView on Hugging Face
24likes2.2kdownloads
second_hands_sol.md10 linesDownload Raw Back to quals
1If \(N > 2K\), then the answer is "`NO`", because we lack the capacity to hold all the parts.2 3If there are \(3\) parts of the same style, then the answer is "`NO`". By the pigeonhole principle, any assignment of parts to cases will yield a case with two or more parts of the same style.4 5Otherwise the answer is "`YES`" using the following strategy: First, for any style we have two parts of, put one in each case. Next, evenly distribute the remaining parts (each being a unique style in the store) between the two cases. Informally, this distributes the parts as close to evenly as possible, so we will have enough room in each case.6 7Formally, one case will have \(\lfloor N/2 \rfloor \) parts and the other will have \(\lceil N/2 \rceil \) parts. Since \(N \le 2K\), we have \(N/2 \le K\), and thus \( \lceil N/2 \rceil  \le \lceil K \rceil = K\) (inequality preserved since \(\lceil x \rceil\) is a nondecreasing function). Having shown \(\lfloor N/2 \rfloor \le \lceil N/2 \rceil \le K\), we see that neither case will exceed capacity.8 9[See David Harmeyer's solution video here.](https://youtu.be/8Eg2-HIUP-w)10