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.md34 linesDownload Raw Back to quals
1Sandy's store has \(N\) pre-owned clock parts for sale, where the \(i\)th part is of style \(S_i\). The store also has two display cases, each capable of holding at most \(K\) parts. To maximize the aesthetics of Sandy's secondhand second hands, she'd like to put each of the \(N\) parts into one of the two cases so that neither case ends up with two different parts of the same style, and neither case has more than \(K\) parts total. Can you determine if this is possible?2 3# Constraints4 5\(1 \leq T \leq 90\)6\(1 \leq N, K, S_i \leq 100\)7 8 9# Input Format10 11Input begins with an integer \(T\), the number of test cases. For each test case, there is first a line containing \(2\) space-separated integers, \(N\) and \(K\). Then, there is a line containing \(N\) space-separated integers, \(S_1, ..., S_N\).12 13 14# Output Format15 16For the \(i\)th test case, print "`Case #i:` " followed by "`YES`" if it's possible to arrange the \(N\) parts into two cases satisfying the description above, or "`NO`" otherwise.17 18 19# Sample Explanation20 21In the first test case, there are \(3\) parts of styles \(1\), \(2\), and \(2\), with the display cases having capacity \(2\). One solution, depicted below, is to put the first and third parts in one display case, and the second part in the other.22 23{{PHOTO_ID:459254706243127|WIDTH:500}}24 25In the second test case, there are \(5\) parts of styles \(1\), \(2\), \(3\), \(3\), \(1\), with the display cases having capacity \(3\). One solution, depicted below, is to put the first three parts in one display case, and the last two in the other.26 27{{PHOTO_ID:1183048075593188|WIDTH:500}}28 29In the third test case, there are \(5\) parts, but the display cases can each only hold \(2\). Therefore, there is no solution.30 31In the fourth test case, style \(1\) will always be duplicated in some display case for any given arrangement. Therefore, there is no solution.32 33 34