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 E:</font> Manhattan Wiring</H1>3 4<p>5There is a rectangular area containing <i>n</i> × <i>m</i> cells. Two cells are marked with "2", and another two with "3". Some cells are occupied by obstacles. You should connect the two "2"s and also the two "3"s with non-intersecting lines. Lines can run only vertically or horizontally connecting6centers of cells without obstacles.7</p>8<p>9Lines cannot run on a cell with an obstacle. Only one line can run on a cell at most once. Hence,10a line cannot intersect with the other line, nor with itself. Under these constraints, the total11length of the two lines should be minimized. The length of a line is defined as the number of12cell borders it passes. In particular, a line connecting cells sharing their border has length 1.13</p>14<p>15Fig. 6(a) shows an example setting. Fig. 6(b) shows two lines satisfying the constraints above16with minimum total length 18.17</p>18<br>19<center>20<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_manhattanWiring">21<p>22Figure 6: An example setting and its solution23</p>24 25</center>26 27<H2>Input</H2>28 29<p>30The input consists of multiple datasets, each in the following format.31</p>32<pre>33 <i>n m</i>34 row<sub>1</sub>35 ...36 row<sub><i>n</i></sub>37</pre>38 39<p>40<i>n</i> is the number of rows which satisfies 2 ≤ <i>n</i> ≤ 9. <i>m</i> is the number of columns which satisfies412 ≤ <i>m</i> ≤ 9. Each row<sub><i>i</i></sub> is a sequence of <i>m</i> digits separated by a space. The digits mean the42following.43</p>44 45 46<p><span>0</span>: Empty</p>47<p><span>1</span>: Occupied by an obstacle</p>48<p><span>2</span>: Marked with "2"</p>49<p><span>3</span>: Marked with "3"</p>50 51<p>52The end of the input is indicated with a line containing two zeros separated by a space.53</p>54 55<H2>Output</H2>56 57<p>58For each dataset, one line containing the minimum total length of the two lines should be output.59If there is no pair of lines satisfying the requirement, answer "0" instead. No other characters60should be contained in the output.61 62</p>63 64<H2>Sample Input</H2>65<pre>665 5670 0 0 0 0680 0 0 3 0692 0 2 0 0701 0 1 1 1710 0 0 0 3722 3732 2 0740 3 3756 5762 0 0 0 0770 3 0 0 0780 0 0 0 0791 1 1 0 0800 0 0 0 0810 0 2 3 0825 9830 0 0 0 0 0 0 0 0840 0 0 0 3 0 0 0 0850 2 0 0 0 0 0 2 0860 0 0 0 3 0 0 0 0870 0 0 0 0 0 0 0 0889 9893 0 0 0 0 0 0 0 2900 0 0 0 0 0 0 0 0910 0 0 0 0 0 0 0 0920 0 0 0 0 0 0 0 0930 0 0 0 0 0 0 0 0940 0 0 0 0 0 0 0 0950 0 0 0 0 0 0 0 0960 0 0 0 0 0 0 0 0972 0 0 0 0 0 0 0 3989 9990 0 0 1 0 0 0 0 01000 2 0 1 0 0 0 0 31010 0 0 1 0 0 0 0 21020 0 0 1 0 0 0 0 31030 0 0 1 1 1 0 0 01040 0 0 0 0 0 0 0 01050 0 0 0 0 0 0 0 01060 0 0 0 0 0 0 0 01070 0 0 0 0 0 0 0 01089 91090 0 0 0 0 0 0 0 01100 3 0 0 0 0 0 0 01110 0 0 0 0 0 0 0 01120 0 0 0 0 0 0 0 01130 0 0 0 0 0 0 0 01140 0 0 0 0 0 0 0 01150 0 0 0 0 0 0 0 01160 0 0 0 0 0 0 0 01170 0 0 0 0 0 2 3 21180 0119</pre>120 121<H2>Output for the Sample Input</H2>122<pre>123181242125171261212701285212943130</pre>131 132 133 134 135 