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
scoreboard.html74 linesDownload Raw Back to finals
1<p>2The 2019 Hacker Cup Finals have just concluded! There were <strong>N</strong> participants (numbered 1 to <strong>N</strong>), 3including yourself (competing as participant 1), and <strong>M</strong> problems (numbered 1 to <strong>M</strong>).4</p>5 6<p>7Participant <em>i</em> solved problem <em>j</em> if <strong>S<sub>i,j</sub></strong> = "Y", and otherwise they didn't solve it (if <strong>S<sub>i,j</sub></strong> = "N"). 8Problem <em>i</em>'s point value is 2<sup>i</sup>, and each participant's score is the sum of the point values of the problems that they solved. 9No two participants solved exactly the same set of problems, which also means that all participants have distinct scores.10</p>11 12<p>13Before the final results get announced, you have an opportunity to rearrange the <strong>M</strong> columns of the scoreboard <strong>S</strong> 14into any permutation of problems 1 to <strong>M</strong>. 15For example, if you swap columns 1 and 2, then everybody who had originally solved problem 1 will now be considered to have solved problem 2 16(thus earning 4 points for it rather than 2), and vice versa.17</p>18 19<p>20Of course, you'd like to use this opportunity to your benefit &mdash; it would be irresponsible to just let it pass by! 21However, it would be too suspicious if you simply made yourself win the whole competition. 22As such, you'd like to cause yourself to end up in 2nd place, such that you (participant 1) have exactly the second-highest score out of all <strong>N</strong> participants. 23Now you just need to determine whether or not this is achievable...24</p>25 26 27<h3>Input</h3>28 29<p>30Input begins with an integer <strong>T</strong>, the number of scoreboards.31<br />For each scoreboard, there is first a line containing the space-separated integers <strong>N</strong> and <strong>M</strong>.32<br />Then, <strong>N</strong> lines follow, the <em>i</em>th of which contains a length-<strong>M</strong> string, the characters33<strong>S<sub>i,1</sub></strong> through <strong>S<sub>i,M</sub></strong>.34</p>35 36 37<h3>Output</h3>38 39<p>40For the <em>i</em>th scoreboard, print a line containing "Case #<em>i</em>: " followed by41one character, either "Y" if you can end up in 2nd place, or "N" otherwise.42</p>43 44 45<h3>Constraints</h3>46 47<p>481 &le; <strong>T</strong> &le; 200 <br />492 &le; <strong>N</strong> &le; 400 <br />501 &le; <strong>M</strong> &le; 400 <br />51</p>52 53<p>54The sum of <strong>N</strong> * <strong>M</strong> across all <strong>T</strong> test cases is no greater than 1,000,000.55</p>56 57 58<h3>Explanation of Sample</h3>59 60<p>61In the first case, there's only one possible permutation of problems: [1]. This results in you having a score of 2 and participant 2 having a score of 0, which puts you in 1st place rather than 2nd.62</p>63 64<p>65In the second case, if you preserve the original permutation of problems, [1, 2], you'll have a score of 2 while participant 2 has a score of 4, putting you in 2nd place, as required. 66The permutation [2, 1] would have put you in 1st place instead.67</p>68 69<p>70In the third case, if you choose the problem permutation [2, 1], the 4 participants' scores will be 4, 0, 6, and 2, respectively. This puts you in 2nd place, as required. 71The problem permutation [1, 2] would have put you in 3rd place instead.72</p>73 74