prithivMLmods/Coder-Stat
Coder-Stat Dataset Overview The Coder-Stat dataset is a collection of programming-related data, including problem IDs, programming languages, original statuses, and source code snippets. This dataset is designed to assist in the analysis of coding patterns, error types, and performance metrics. Dataset Details Modalities Tabular: The dataset is structured in a tabular format. Text: Contains text data, including source code snippets.… See the full description on the dataset page: https://huggingface.co/datasets/prithivMLmods/Coder-Stat.
3139
1 2<H1><font color="#000">Problem H:</font> Inherit the Spheres</H1>3 4<p>5In the year 2xxx, an expedition team landing on a planet found strange objects made by an6ancient species living on that planet. They are transparent boxes containing opaque solid spheres7(Figure 1). There are also many lithographs which seem to contain positions and radiuses of8spheres.9</p>10 11<center>12<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_inheritTheSpheres1">13<p>Figure 1: A strange object</p>14</center>15 16<p>17Initially their objective was unknown, but Professor Zambendorf found the cross section formed18by a horizontal plane plays an important role. For example, the cross section of an object19changes as in Figure 2 by sliding the plane from bottom to top.20</p>21 22<center>23<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_inheritTheSpheres2">24<p>Figure 2: Cross sections at different positions</p>25</center>26 27<p>28He eventually found that some information is expressed by the transition of the number of29connected figures in the cross section, where each connected figure is a union of discs intersecting30or touching each other, and each disc is a cross section of the corresponding solid sphere. For31instance, in Figure 2, whose geometry is described in the first sample dataset later, the number32of connected figures changes as 0, 1, 2, 1, 2, 3, 2, 1, and 0, at <i>z</i> = 0.0000, 162.0000, 167.0000,33173.0004, 185.0000, 191.9996, 198.0000, 203.0000, and 205.0000, respectively. By assigning 1 for34increment and 0 for decrement, the transitions of this sequence can be expressed by an 8-bit35binary number 11011000.36</p>37<p>38For helping further analysis, write a program to determine the transitions when sliding the39horizontal plane from bottom (<i>z</i> = 0) to top (<i>z</i> = 36000).40</p>41 42<H2>Input</H2>43 44<p>45The input consists of a series of datasets. Each dataset begins with a line containing a positive46integer, which indicates the number of spheres <i>N</i> in the dataset. It is followed by <i>N</i> lines47describing the centers and radiuses of the spheres. Each of the <i>N</i> lines has four positive integers48<i>X<sub>i</sub></i>, <i>Y<sub>i</sub></i>, <i>Z<sub>i</sub></i>, and <i>R<sub>i</sub></i> (<i>i</i> = 1, . . . , <i>N</i>) describing the center and the radius of the <i>i</i>-th sphere,49respectively.50</p>51<p>52You may assume 1 ≤ <i>N</i> ≤ 100, 1 ≤ <i>R<sub>i</sub></i> ≤ 2000, 0 < <i>X<sub>i</sub></i> - <i>R<sub>i</sub></i> < <i>X<sub>i</sub></i> + <i>R<sub>i</sub></i> < 4000, 0 < <i>Y<sub>i</sub></i> - <i>R<sub>i</sub></i> < <i>Y<sub>i</sub></i> + <i>R<sub>i</sub></i> < 16000, and 0 < <i>Z<sub>i</sub></i> - <i>R<sub>i</sub></i> < <i>Z<sub>i</sub></i> + <i>R<sub>i</sub></i> < 36000. Each solid sphere is defined as the set of53all points (<i>x</i>, <i>y</i>, <i>z</i>) satisfying (<i>x</i> - <i>X<sub>i</sub></i>)<sup>2</sup> + (<i>y</i> - <i>Y<sub>i</sub></i>)<sup>2</sup> + (<i>z</i> - <i>Z<sub>i</sub></i>)<sup>2</sup> ≤ <i>R<sub>i</sub></i><sup>2</sup>.54</p>55<p>56A sphere may contain other spheres. No two spheres are mutually tangent. Every <i>Z<sub>i</sub></i> ± <i>R<sub>i</sub></i> and57minimum/maximum <i>z</i> coordinates of a circle formed by the intersection of any two spheres differ58from each other by at least 0.01.59</p>60<p>61The end of the input is indicated by a line with one zero.62</p>63 64<H2>Output</H2>65 66<p>67For each dataset, your program should output two lines. The first line should contain an integer68<i>M</i> indicating the number of transitions. The second line should contain an <i>M</i>-bit binary number69that expresses the transitions of the number of connected figures as specified above.70</p>71 72<H2>Sample Input</H2>73<pre>7437595 20 180 1876125 20 185 187740 27 195 10781795 5 5 4802815 5 5 4825 5 5 3832845 5 5 4855 7 5 38616872338 3465 29034 710881571 14389 25019 842891706 8015 11324 1155901899 4359 33815 888912160 10364 20511 1264922048 8835 23706 1906932598 13041 23679 618941613 11112 8003 1125951777 4754 25986 929962707 9945 11458 617971153 10358 4305 755982462 8450 21838 934991822 11539 10025 16391001473 11939 12924 6381011388 8519 18653 8341022239 7384 32729 8621030104</pre>105 106<H2>Output for the Sample Input</H2>107<pre>108810911011000110211110112211310114211510116281171011100100110101101000101100118</pre>119 120 