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_second_friend.md35 linesDownload Raw Back to quals
1**Note: The only difference between this problem and [problem B1](https://www.facebook.com/codingcompetitions/hacker-cup/2022/qualification-round/problems/B1) is that here, scenes are larger and may contain rocks.**2 3Boss Rob painted a beautiful scene on a 2D canvas of \(R\) rows by \(C\) columns, containing zero or more happy little trees **and zero or more rocks.**4 5To make sure none of his trees are lonely, Rob would like you to add as many trees as you'd like (possibly \(0\)) to empty spaces so that each tree in the final painting has at least two tree *friends*, that is, two trees which are each adjacent to it (directly to its north, south, east, or west). If there are multiple solutions, you may print any one of them. 6 7 8# Constraints9 10\(1 \leq T \leq 80\)11\(1 \leq R, C \leq \mathbf{3{,}000}\)12 13 14# Input Format15 16Input begins with an integer \(T\), the number of test cases. For each case, there is first a line containing two space-separated integers, \(R\) and \(C\). Then, \(R\) lines follow, each of which contains \(C\) characters, either "`.`" (an empty space), "`^`" (a tree), **or "`#`" (a rock)**, representing the initial painting.17 18 19# Output Format20 21For the \(i\)th case, print "`Case #i:` ", followed by "`Possible`" and \(R\) lines of \(C\) characters each representing the final painting (if a solution exists), otherwise "`Impossible`".22 23 24# Sample Explanation25 26In the first case (depicted below), we could add two tree friends to either side of the middle tree, but they themselves would each only have one tree friend. Therefore, it's impossible to get two friends for each tree in the final painting.27 28{{PHOTO_ID:604840697695882|WIDTH:295}}29 30In the second case, there are no trees in the initial painting, so the condition of two friends for each tree is already satisfied.31 32In the third case, one possible solution is depicted below.33 34{{PHOTO_ID:749016109740997|WIDTH:700}}35